From patchwork Tue Jun 6 18:07:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert LeBlanc X-Patchwork-Id: 9769479 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 CAB9660353 for ; Tue, 6 Jun 2017 18:08:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA24F2846F for ; Tue, 6 Jun 2017 18:08:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF25C28500; Tue, 6 Jun 2017 18:08:33 +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=unavailable 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 71F972846F for ; Tue, 6 Jun 2017 18:08:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751619AbdFFSID (ORCPT ); Tue, 6 Jun 2017 14:08:03 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33541 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751693AbdFFSHe (ORCPT ); Tue, 6 Jun 2017 14:07:34 -0400 Received: by mail-pg0-f66.google.com with SMTP id a70so5387622pge.0 for ; Tue, 06 Jun 2017 11:07:34 -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=xrbdtJX44a1QDXP3icgHGzOAaqp2nclOe3d8Jg45N0k=; b=OMpUz8IjzOfLNgY2fdPnPQiH402UZ7cBFdxq0AQwF/qh8HI2XUYEemFabIIgV1D1Ub ZLWMO7gw2pZ76N5td4v3by1g4xT0mzNeOnXXPb9zJn9vf7UIQskKRAkLjyS/Jps+jBR0 8WCXOXkmbv+9EBKOyAtrZQdrqSjtbANwoqodZRVTXUAr4ayxZNj2sjj2dE0cVWX1jxw7 G9ohzAwu2Vu30/hrHxMHEakTlaLZykkrD3LsfmDWSIdIMPwY1dbo94vqDd3HI8/SApYS nIO73V5LGoRAl+lvX1hbInn/TLuJZVKu7khovYngqpI5OH0+teTXWCq/lLh9qlwJaF+r uOrg== 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=xrbdtJX44a1QDXP3icgHGzOAaqp2nclOe3d8Jg45N0k=; b=chbPEODLaOpeaEvwzneQPwjC1mU3ol5pmiJo2fDrIKqtSwW6Uf2N8usK6tCfr3Ein2 WhrITvuHHwUDcmMXODXq/etxNm1qoAN9zMcxPdpwRFN3KKZBHjHHz8KQmg6PRvc63ipm yeYGx5zWVdSw4ZR99/JBrzXm6Q/yiTFGg5urmZTXJ0yVzkWzdFnQ03iHKgUEQ5/be2XZ Msct6XOi74i1VyOeVWuZEAoQD2gty4UVAy083lGG8bbbwcKKqzZK8JMTkoojT8JOVfvw 47OhQ4S8205BvQhhcKsKPDiCyU1I6bbJ1DwN4Y4dd+O1WJJ01J/4hX9MwghJWgYiVRpC 6RTA== X-Gm-Message-State: AODbwcBNi4fUa62HHHRHaaXDNROTAdAxuU4AotSCX2jskYAgAPAsLwU1 1Nw2T4/l9iixbzyx X-Received: by 10.98.103.134 with SMTP id t6mr18614358pfj.41.1496772453721; Tue, 06 Jun 2017 11:07:33 -0700 (PDT) Received: from rleblanc-pc ([2604:ba00:2:1:1043:d22c:d907:91b1]) by smtp.gmail.com with ESMTPSA id a187sm36451307pge.45.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-0001Js-C2; 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 5/7] scsi/bnx2i: Update bnx2i_ep_connect to accept iface and sockaddr_storage. Date: Tue, 6 Jun 2017 12:07:15 -0600 Message-Id: <20170606180717.5007-6-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 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 --- 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 +#include #include #include #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 +#include #include #include +#include #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;