• Nicholas Bellinger's avatar
    iscsi-target: Add login negotiation multi-plexing support · d381a801
    Nicholas Bellinger authored
    This patch adds support for login negotiation multi-plexing in
    iscsi-target code.
    
    This involves handling the first login request PDU + payload and
    login response PDU + payload within __iscsi_target_login_thread()
    process context, and then changing struct sock->sk_data_ready()
    so that all subsequent exchanges are handled by workqueue process
    context, to allow other incoming login requests to be received
    in parallel by __iscsi_target_login_thread().
    
    Upon login negotiation completion (or failure), ->sk_data_ready()
    is replaced with the original kernel sockets handler saved in
    iscsi_conn->orig_data_ready.
    
    v3 changes:
      - Convert iscsi_target_sk_data_ready() lock access to
        write[lock,unlock]_bh()
      - Only clear LOGIN_FLAGS_READ_ACTIVE when iscsi_target_do_login()
        returns zero
      - Add LOGIN_FLAGS_READY + LOGIN_FLAGS_CLOSED bit checks to
        iscsi_target_sk_data_ready()
      - Make INIT_DELAYED_WORK() + iscsi_target_set_sock_callbacks() setup
        happen earlier by moving from iscsi_target_start_negotiation() into
        iscsi_target_locate_portal()
      - Set LOGIN_FLAGS_READY bit in iscsi_target_start_negotiation()
        after iscsi_target_do_login() returns zero.
    
    v2 changes:
      - Add login_timer in iscsi_target_do_login_rx() to avoid
        possible endless sleep with MSG_WAITALL for traditional
        iscsi-target in certain network configurations.
      - Convert lprintk() -> pr_debug()
      - Remove forward declarations of iscsi_target_set_sock_callbacks(),
        iscsi_target_restore_sock_callbacks() and iscsi_target_sk_data_ready()
      - Make iscsi_target_set_sock_callbacks + iscsi_target_restore_sock_callbacks()
        static (Fengguang)
      - Make iscsi_target_do_login_rx() safe for iser-target w/o conn->sock
    Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
    d381a801
iscsi_target_tpg.h 2.36 KB