From patchwork Tue Jun 6 18:07:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert LeBlanc X-Patchwork-Id: 9769497 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 95F7960353 for ; Tue, 6 Jun 2017 18:09:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 94F302846F for ; Tue, 6 Jun 2017 18:09:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8850E28500; Tue, 6 Jun 2017 18:09:12 +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 2CE452846F for ; Tue, 6 Jun 2017 18:09:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751794AbdFFSJI (ORCPT ); Tue, 6 Jun 2017 14:09:08 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:35123 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751622AbdFFSHc (ORCPT ); Tue, 6 Jun 2017 14:07:32 -0400 Received: by mail-pg0-f66.google.com with SMTP id f127so13657861pgc.2 for ; Tue, 06 Jun 2017 11:07:32 -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=1iZNuzdW/BYqj7JAIqjlRZxe85764NJXmSvhAFlQzvA=; b=0nMmryGGQo3YFuK5HJdkjfQoOdlhG9BDJ8PpX+V0m0n5kE7C4NqRU+J4z+ZgxQM5Ae 6ksqoN772Tud6kYE23cYc6EYQ9CDfQYeOxMQc4utn6QnZnDCQsrxCo6cZXMJuUadD7Mk AfyYl8SOEP53oxb82ydqScIDNs5xOQvmfZSxmmtZND71DRFvOhf3+AbeVpGKSbEZbPZU HzRJYFEdJr+qKR9AdYoyUuqOFNUPKUdczgvt2sPRfky/mvEPhszL8CG4OQGcJFcAU95Y cM9Cdyf8xF8p7VzafOzYUSMVbKzSazP4vfsIZvny8npcyQKZlwQzUXryNdtgXtMR8xYx IU3g== 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=1iZNuzdW/BYqj7JAIqjlRZxe85764NJXmSvhAFlQzvA=; b=jAvfgh9uptKABD45QO4zy9wb8gBpwtuwtZCCQBqBbBWBUgSUenQEEkNH5S/IX0MafD DcoaYndxIs4cxaPY7iJ/3ds8H2ZV4hFrnIc61N4PeONuIg7yHGOcXF6QobfHejVboZ4U I0YDpzzKIRozIumxHPWoxbp6DvT8jGSYpyvMUWmu5KJKJeF9umzher1xvvsH1m42VwZS JSR5LhDAnr4X9F+LpptQE56kPE72m42tsr9A6cwKZU+210/bLVWiP6kQB1WinZSklwdO HI6ZcFEBN3H8QyMgQYYXA32ikqF2evknPbUCljUZLMv9ia6Wpi6PKT3c4HyJNHLoua3V TXpQ== X-Gm-Message-State: AODbwcBcqTIj9Tbm9iW6Ud31k61V1d8EdPv6eg4pmfvcaG2/1r9z96sn 1mwV2eqb7iJQRYEb X-Received: by 10.99.146.13 with SMTP id o13mr8759476pgd.54.1496772451785; Tue, 06 Jun 2017 11:07:31 -0700 (PDT) Received: from rleblanc-pc ([2604:ba00:2:1:1043:d22c:d907:91b1]) by smtp.gmail.com with ESMTPSA id x6sm62404352pfk.22.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-0001Ji-6s; 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 2/7] scsi/scsi_transport_iscsi: Update ep_connect to include iface. Date: Tue, 6 Jun 2017 12:07:12 -0600 Message-Id: <20170606180717.5007-3-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 the ep_connect function to include the iface in the parameters passed to the driver. Since we have to make a change, also change the dst_addr to sockaddr_storage so that it is future proof and a static size. Signed-off-by: Robert LeBlanc --- drivers/scsi/scsi_transport_iscsi.c | 9 ++++++--- include/scsi/scsi_transport_iscsi.h | 5 +++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index a424eaeafeb0..64157a1d62e6 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c @@ -34,6 +34,7 @@ #include #include #include +#include #define ISCSI_TRANSPORT_VERSION "2.0-870" @@ -2794,7 +2795,8 @@ static int iscsi_if_ep_connect(struct iscsi_transport *transport, struct iscsi_uevent *ev, int msg_type) { struct iscsi_endpoint *ep; - struct sockaddr *dst_addr; + struct sockaddr_storage *dst_addr; + struct iface_rec *iface; struct Scsi_Host *shost = NULL; int non_blocking, err = 0; @@ -2813,8 +2815,9 @@ static int iscsi_if_ep_connect(struct iscsi_transport *transport, } else non_blocking = ev->u.ep_connect.non_blocking; - dst_addr = (struct sockaddr *)((char*)ev + sizeof(*ev)); - ep = transport->ep_connect(shost, dst_addr, non_blocking); + dst_addr = (struct sockaddr_storage *)((char*)ev + sizeof(*ev)); + iface = (struct iface_rec *)((char*)ev + sizeof(*ev) + sizeof(*dst_addr)); + ep = transport->ep_connect(shost, dst_addr, non_blocking, iface); if (IS_ERR(ep)) { err = PTR_ERR(ep); goto release_host; diff --git a/include/scsi/scsi_transport_iscsi.h b/include/scsi/scsi_transport_iscsi.h index 26fe284daf9a..c146e90e912b 100644 --- a/include/scsi/scsi_transport_iscsi.h +++ b/include/scsi/scsi_transport_iscsi.h @@ -133,8 +133,9 @@ struct iscsi_transport { void (*session_recovery_timedout) (struct iscsi_cls_session *session); struct iscsi_endpoint *(*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); int (*ep_poll) (struct iscsi_endpoint *ep, int timeout_ms); void (*ep_disconnect) (struct iscsi_endpoint *ep); int (*tgt_dscvr) (struct Scsi_Host *shost, enum iscsi_tgt_dscvr type,