mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Robert LeBlanc <robert@leblancnet.us>
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 <robert@leblancnet.us>
Subject: [PATCH 5/7] scsi/bnx2i: Update bnx2i_ep_connect to accept iface and sockaddr_storage.
Date: Tue,  6 Jun 2017 12:07:15 -0600	[thread overview]
Message-ID: <20170606180717.5007-6-robert@leblancnet.us> (raw)
In-Reply-To: <20170606180717.5007-1-robert@leblancnet.us>

Update QLogic NetXtreme II driver to accept the session iface for creating
the iSCSI connection. Also accept dst_addr as sockaddr_storage instead of
sockaddr.

Signed-off-by: Robert LeBlanc <robert@leblancnet.us>
---
 drivers/scsi/bnx2i/bnx2i_hwi.c   |  1 +
 drivers/scsi/bnx2i/bnx2i_iscsi.c | 13 ++++++++-----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/bnx2i/bnx2i_hwi.c b/drivers/scsi/bnx2i/bnx2i_hwi.c
index 42921dbba927..ce87ce2c2dc1 100644
--- a/drivers/scsi/bnx2i/bnx2i_hwi.c
+++ b/drivers/scsi/bnx2i/bnx2i_hwi.c
@@ -15,6 +15,7 @@
  */
 
 #include <linux/gfp.h>
+#include <linux/if.h>
 #include <scsi/scsi_tcq.h>
 #include <scsi/libiscsi.h>
 #include "bnx2i.h"
diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
index f32a66f89d25..515106367426 100644
--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
+++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
@@ -16,8 +16,10 @@
  */
 
 #include <linux/slab.h>
+#include <linux/if.h>
 #include <scsi/scsi_tcq.h>
 #include <scsi/libiscsi.h>
+#include <scsi/scsi_transport_iscsi.h>
 #include "bnx2i.h"
 
 struct scsi_transport_template *bnx2i_scsi_xport_template;
@@ -1771,8 +1773,9 @@ static int bnx2i_tear_down_conn(struct bnx2i_hba *hba,
  *	sending down option-2 request to complete TCP 3-way handshake
  */
 static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
-					       struct sockaddr *dst_addr,
-					       int non_blocking)
+					       struct sockaddr_storage *dst_addr,
+					       int non_blocking,
+					       struct iface_rec *iface)
 {
 	u32 iscsi_cid = BNX2I_CID_RESERVED;
 	struct sockaddr_in *desti = (struct sockaddr_in *) dst_addr;
@@ -1792,7 +1795,7 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
 		 * check if the given destination can be reached through
 		 * a iscsi capable NetXtreme2 device
 		 */
-		hba = bnx2i_check_route(dst_addr);
+		hba = bnx2i_check_route((struct sockaddr *)dst_addr);
 
 	if (!hba) {
 		rc = -EINVAL;
@@ -1887,11 +1890,11 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
 	clear_bit(SK_TCP_TIMESTAMP, &bnx2i_ep->cm_sk->tcp_flags);
 
 	memset(&saddr, 0, sizeof(saddr));
-	if (dst_addr->sa_family == AF_INET) {
+	if (dst_addr->ss_family == AF_INET) {
 		desti = (struct sockaddr_in *) dst_addr;
 		saddr.remote.v4 = *desti;
 		saddr.local.v4.sin_family = desti->sin_family;
-	} else if (dst_addr->sa_family == AF_INET6) {
+	} else if (dst_addr->ss_family == AF_INET6) {
 		desti6 = (struct sockaddr_in6 *) dst_addr;
 		saddr.remote.v6 = *desti6;
 		saddr.local.v6.sin6_family = desti6->sin6_family;
-- 
2.11.0

  parent reply	other threads:[~2017-06-06 18:08 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-06 18:07 [PATCH 0/7] Enable iSCSI offload drivers to use information from iface Robert LeBlanc
2017-06-06 18:07 ` [PATCH 1/7] scsi/scsi_transport_iscsi: Add iface struct to kernel Robert LeBlanc
2017-06-08 12:29   ` kbuild test robot
2017-06-06 18:07 ` [PATCH 2/7] scsi/scsi_transport_iscsi: Update ep_connect to include iface Robert LeBlanc
2017-06-08 12:24   ` kbuild test robot
2017-06-08 12:53   ` kbuild test robot
2017-06-06 18:07 ` [PATCH 3/7] ib/iSER: Add binding to source IP address Robert LeBlanc
2017-06-06 18:07 ` [PATCH 4/7] scsi/be2iscsi: Update beiscsi_ep_connect to accept iface and sockaddr_storage Robert LeBlanc
2017-06-06 18:07 ` Robert LeBlanc [this message]
2017-06-06 18:07 ` [PATCH 6/7] scsi/cxgbi: Update cxgbi_ep_connect " Robert LeBlanc
2017-06-06 18:07 ` [PATCH 7/7] scsi/qla4xxx: Update qla4xxx_ep_connect " Robert LeBlanc
2017-06-07  8:09 ` [PATCH 0/7] Enable iSCSI offload drivers to use information from iface Hannes Reinecke
2017-06-07 16:28 ` Chris Leech
2017-06-07 18:30   ` Robert LeBlanc
2017-06-13 16:49     ` Robert LeBlanc
2017-06-14  9:20       ` Rangankar, Manish
2017-06-14 16:47         ` Robert LeBlanc
2017-07-24 18:32           ` Robert LeBlanc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170606180717.5007-6-robert@leblancnet.us \
    --to=robert@leblancnet.us \
    --cc=QLogic-Storage-Upstream@qlogic.com \
    --cc=cleech@redhat.com \
    --cc=dledford@redhat.com \
    --cc=hal.rosenstock@gmail.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jitendra.bhivare@broadcom.com \
    --cc=ketan.mukadam@broadcom.com \
    --cc=lduncan@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ogerlitz@mellanox.com \
    --cc=open-iscsi@googlegroups.com \
    --cc=roid@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=sean.hefty@intel.com \
    --cc=subbu.seetharaman@broadcom.com \
    --cc=varun@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®