From patchwork Tue Jun 6 18:07:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert LeBlanc X-Patchwork-Id: 9769465 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFE3260353 for ; Tue, 6 Jun 2017 18:07:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDABE2846F for ; Tue, 6 Jun 2017 18:07:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B13EC28500; Tue, 6 Jun 2017 18:07:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AE58F2846F for ; Tue, 6 Jun 2017 18:07:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751573AbdFFSHb (ORCPT ); Tue, 6 Jun 2017 14:07:31 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33131 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbdFFSHa (ORCPT ); Tue, 6 Jun 2017 14:07:30 -0400 Received: by mail-pf0-f194.google.com with SMTP id f27so25047699pfe.0 for ; Tue, 06 Jun 2017 11:07:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leblancnet-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RIzTkYCbMTQCy5Mn0AycjG2U/l03rJXK8+GcWgixxeg=; b=o73CgcXdZ237trKIsQRBP2DfPSVtQBWRaiGVXr8CwGUmtG3mCy+ku9fI4JL74NDED6 xsWpoVvbJ8qBFEWFTFYk3yDpHaYst5b05nxcUusLDhedFdP8GudLs1uirz7C14Ne6KQ5 Pc5Qy7cWOJsVA33B4wmFl/ReTsc5yVecTFlU/27876hmHdMGq7FrlehVnt1gBl+sIWB+ SMvRSP2LB8ktdJb5WH0CC5k5i5cIzLBffPIbTONvgrpXBgb7kh8Lub4MVQros7mm3REW YwT0QVMG0vTv19JJoor7g6eEM+L+wMk1jGVunbF8Nipe73S183AZs0J5cDM0DkoyOl9G Yszg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RIzTkYCbMTQCy5Mn0AycjG2U/l03rJXK8+GcWgixxeg=; b=icGiLsln0Xv9PwAOh8S2d7D5uPRW4eO3TPCNNtfoO6K1HOeSiazA6pRH9iNNeoGgq3 FXK3uUm1PPk01UKmXxJcHPIoke/EguKDQOa+oFScYQPOm7DNG000TW/wkgeJ82N8/NgC NfBGzScX/0DVkrxXdd//BL1zyhwxe/7NYqM+5KdKFijT6LLMnCrswEylj0M2C1wYBxE6 WXrb9s1PAb6wAGDGW8lm6/y/Db1VTgy+q2XYlR/Qtpa4Lpoblw6cw4dQ9oIWu3xHRbZf brHa5YU/nxuciO+KekCDKKAFzRKr4OSosWjN0gWMenIOZ56Hpx46P2anPRFwjxt7QFu8 pSvg== X-Gm-Message-State: AODbwcDeI1KLM5XmXcQPvQUDuRqEs9EWI3t5+TzonJFXbTbOYRJ3WKhd ewEt4sKPU9AkBuoc X-Received: by 10.84.224.206 with SMTP id k14mr23232441pln.195.1496772449736; Tue, 06 Jun 2017 11:07:29 -0700 (PDT) Received: from rleblanc-pc ([2604:ba00:2:1:1043:d22c:d907:91b1]) by smtp.gmail.com with ESMTPSA id l85sm5381188pfi.134.2017.06.06.11.07.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 06 Jun 2017 11:07:29 -0700 (PDT) Received: from rleblanc by rleblanc-pc with local (Exim 4.89) (envelope-from ) id 1dIIt6-0001Jg-5G; Tue, 06 Jun 2017 12:07:28 -0600 From: Robert LeBlanc To: lduncan@suse.com Cc: cleech@redhat.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, ogerlitz@mellanox.com, sagi@grimberg.me, roid@mellanox.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com, linux-rdma@vger.kernel.org, subbu.seetharaman@broadcom.com, ketan.mukadam@broadcom.com, jitendra.bhivare@broadcom.com, QLogic-Storage-Upstream@qlogic.com, varun@chelsio.com, Robert LeBlanc Subject: [PATCH 1/7] scsi/scsi_transport_iscsi: Add iface struct to kernel. Date: Tue, 6 Jun 2017 12:07:11 -0600 Message-Id: <20170606180717.5007-2-robert@leblancnet.us> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170606180717.5007-1-robert@leblancnet.us> References: <20170606180717.5007-1-robert@leblancnet.us> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow the userspace iscsiadm to pass the iface struct of the connection so that the underlying driver can use what is most appropriate to create the iSCSI connection. Signed-off-by: Robert LeBlanc --- include/scsi/scsi_transport_iscsi.h | 95 +++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 6183d20a01fb..26fe284daf9a 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -37,6 +37,7 @@ struct iscsi_cls_conn; struct iscsi_conn; struct iscsi_task; struct sockaddr; +struct iface_rec; struct iscsi_iface; struct bsg_job; struct iscsi_bus_flash_session; @@ -291,6 +292,100 @@ struct iscsi_endpoint { struct iscsi_cls_conn *conn; }; +/* max len of interface */ +#define ISCSI_MAX_IFACE_LEN 65 +#define NI_MAXHOST 1025 +#define ISCSI_HWADDRESS_BUF_SIZE 18 +#define ISCSI_TRANSPORT_NAME_MAXLEN 16 +#define ISCSI_MAX_STR_LEN 80 + +struct iface_rec { + struct list_head list; + /* iscsi iface record name */ + char name[ISCSI_MAX_IFACE_LEN]; + uint32_t iface_num; + /* network layer iface name (eth0) */ + char netdev[IFNAMSIZ]; + char ipaddress[NI_MAXHOST]; + char subnet_mask[NI_MAXHOST]; + char gateway[NI_MAXHOST]; + char bootproto[ISCSI_MAX_STR_LEN]; + char ipv6_linklocal[NI_MAXHOST]; + char ipv6_router[NI_MAXHOST]; + char ipv6_autocfg[NI_MAXHOST]; + char linklocal_autocfg[NI_MAXHOST]; + char router_autocfg[NI_MAXHOST]; + uint16_t vlan_id; + uint8_t vlan_priority; + char vlan_state[ISCSI_MAX_STR_LEN]; + char state[ISCSI_MAX_STR_LEN]; /* 0 = disable, + * 1 = enable */ + uint16_t mtu; + uint16_t port; + char delayed_ack[ISCSI_MAX_STR_LEN]; + char nagle[ISCSI_MAX_STR_LEN]; + char tcp_wsf_state[ISCSI_MAX_STR_LEN]; + uint8_t tcp_wsf; + uint8_t tcp_timer_scale; + char tcp_timestamp[ISCSI_MAX_STR_LEN]; + char dhcp_dns[ISCSI_MAX_STR_LEN]; + char dhcp_slp_da[ISCSI_MAX_STR_LEN]; + char tos_state[ISCSI_MAX_STR_LEN]; + uint8_t tos; + char gratuitous_arp[ISCSI_MAX_STR_LEN]; + char dhcp_alt_client_id_state[ISCSI_MAX_STR_LEN]; + char dhcp_alt_client_id[ISCSI_MAX_STR_LEN]; + char dhcp_req_vendor_id_state[ISCSI_MAX_STR_LEN]; + char dhcp_vendor_id_state[ISCSI_MAX_STR_LEN]; + char dhcp_vendor_id[ISCSI_MAX_STR_LEN]; + char dhcp_learn_iqn[ISCSI_MAX_STR_LEN]; + char fragmentation[ISCSI_MAX_STR_LEN]; + char incoming_forwarding[ISCSI_MAX_STR_LEN]; + uint8_t ttl; + char gratuitous_neighbor_adv[ISCSI_MAX_STR_LEN]; + char redirect[ISCSI_MAX_STR_LEN]; + char mld[ISCSI_MAX_STR_LEN]; + uint32_t flow_label; + uint32_t traffic_class; + uint8_t hop_limit; + uint32_t nd_reachable_tmo; + uint32_t nd_rexmit_time; + uint32_t nd_stale_tmo; + uint8_t dup_addr_detect_cnt; + uint32_t router_adv_link_mtu; + uint16_t def_task_mgmt_tmo; + char header_digest[ISCSI_MAX_STR_LEN]; + char data_digest[ISCSI_MAX_STR_LEN]; + char immediate_data[ISCSI_MAX_STR_LEN]; + char initial_r2t[ISCSI_MAX_STR_LEN]; + char data_seq_inorder[ISCSI_MAX_STR_LEN]; + char data_pdu_inorder[ISCSI_MAX_STR_LEN]; + uint8_t erl; + uint32_t max_recv_dlength; + uint32_t first_burst_len; + uint16_t max_out_r2t; + uint32_t max_burst_len; + char chap_auth[ISCSI_MAX_STR_LEN]; + char bidi_chap[ISCSI_MAX_STR_LEN]; + char strict_login_comp[ISCSI_MAX_STR_LEN]; + char discovery_auth[ISCSI_MAX_STR_LEN]; + char discovery_logout[ISCSI_MAX_STR_LEN]; + char port_state[ISCSI_MAX_STR_LEN]; + char port_speed[ISCSI_MAX_STR_LEN]; + /* + * TODO: we may have to make this bigger and interconnect + * specific for infiniband + */ + char hwaddress[ISCSI_HWADDRESS_BUF_SIZE]; + char transport_name[ISCSI_TRANSPORT_NAME_MAXLEN]; + /* + * This is only used for boot now, but the iser guys + * can use this for their virtualization idea. + */ + char alias[TARGET_NAME_MAXLEN + 1]; + char iname[TARGET_NAME_MAXLEN + 1]; +}; + struct iscsi_iface { struct device dev; struct iscsi_transport *transport;