iscsi-target: add int (*iscsit_validate_params)()
authorVarun Prakash <varun@chelsio.com>
Tue, 19 Apr 2016 18:30:12 +0000 (00:00 +0530)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 10 May 2016 06:12:08 +0000 (23:12 -0700)
Add int (*iscsit_validate_params)() to
struct iscsit_transport, iscsi-target
uses this callback for validating
conn operational parameters.

cxgbit.ko needs this callback to check
and update the value of
MAXXMITDATASEGMENTLENGTH.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_login.c
include/target/iscsi/iscsi_transport.h

index 8436d56c5f0c377e07caa7e0b1766051c11cf929..83574eea0be780fdb16c145c8c18e396cf0c1fd7 100644 (file)
@@ -1387,6 +1387,16 @@ static int __iscsi_target_login_thread(struct iscsi_np *np)
                        goto old_sess_out;
        }
 
+       if (conn->conn_transport->iscsit_validate_params) {
+               ret = conn->conn_transport->iscsit_validate_params(conn);
+               if (ret < 0) {
+                       if (zero_tsih)
+                               goto new_sess_out;
+                       else
+                               goto old_sess_out;
+               }
+       }
+
        ret = iscsi_target_start_negotiation(login, conn);
        if (ret < 0)
                goto new_sess_out;
index ccc68a0334c231a242781a7050b51a736fbdacf2..46aa219be1ae9b078103299aa8e6209e1f9a7b10 100644 (file)
@@ -26,6 +26,7 @@ struct iscsit_transport {
                               struct iscsi_datain_req *, const void *, u32);
        void (*iscsit_release_cmd)(struct iscsi_conn *, struct iscsi_cmd *);
        void (*iscsit_get_rx_pdu)(struct iscsi_conn *);
+       int (*iscsit_validate_params)(struct iscsi_conn *);
        enum target_prot_op (*iscsit_get_sup_prot_ops)(struct iscsi_conn *);
 };