diff mbox

[1/7] scsi/scsi_transport_iscsi: Add iface struct to kernel.

Message ID 20170606180717.5007-2-robert@leblancnet.us (mailing list archive)
State Changes Requested, archived
Headers show

Commit Message

Robert LeBlanc June 6, 2017, 6:07 p.m. UTC
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 <robert@leblancnet.us>
---
 include/scsi/scsi_transport_iscsi.h | 95 +++++++++++++++++++++++++++++++++++++
 1 file changed, 95 insertions(+)

Comments

kernel test robot June 8, 2017, 12:29 p.m. UTC | #1
Hi Robert,

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on v4.12-rc4 next-20170608]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Robert-LeBlanc/Enable-iSCSI-offload-drivers-to-use-information-from-iface/20170607-211934
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 6.2.0
reproduce:
        wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All errors (new ones prefixed by >>):

   In file included from include/scsi/libiscsi.h:35:0,
                    from drivers/scsi/be2iscsi/be_iscsi.c:15:
>> include/scsi/scsi_transport_iscsi.h:308:16: error: 'IFNAMSIZ' undeclared here (not in a function)
     char   netdev[IFNAMSIZ];
                   ^~~~~~~~

vim +/IFNAMSIZ +308 include/scsi/scsi_transport_iscsi.h

   302	struct iface_rec {
   303		struct list_head	list;
   304		/* iscsi iface record name */
   305		char			name[ISCSI_MAX_IFACE_LEN];
   306		uint32_t		iface_num;
   307		/* network layer iface name (eth0) */
 > 308		char			netdev[IFNAMSIZ];
   309		char			ipaddress[NI_MAXHOST];
   310		char			subnet_mask[NI_MAXHOST];
   311		char			gateway[NI_MAXHOST];

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

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;