From patchwork Fri Feb 3 22:40:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Madhani, Himanshu" X-Patchwork-Id: 9555251 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 06471602B7 for ; Fri, 3 Feb 2017 22:42:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5A1327B13 for ; Fri, 3 Feb 2017 22:42:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA8912815E; Fri, 3 Feb 2017 22:42:20 +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 7F37C27B13 for ; Fri, 3 Feb 2017 22:42:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753077AbdBCWmR (ORCPT ); Fri, 3 Feb 2017 17:42:17 -0500 Received: from mail-cys01nam02on0087.outbound.protection.outlook.com ([104.47.37.87]:7040 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753024AbdBCWly (ORCPT ); Fri, 3 Feb 2017 17:41:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AT7EuYMlH1/gHUEqpA5U0SYZ9+qUCMhKUoDpQoLNxJo=; b=Gf6dj/0ScynqlB7GHxaCYsZqYg4JsuEBKinX50M3NzL60kYNOORbJgpgupEZWRcZHukIgD4E1T4RhY4MX2LAJ+hRmPN7bQAcMrb66DiNf0NMHUZEqAqhUg6goPFu4FFctr8eoa1C0CSWPAIuC81unHhsO0sthRPXsAWGgu8hpLE= Received: from BN6PR07CA0005.namprd07.prod.outlook.com (10.173.33.143) by SN2PR07MB030.namprd07.prod.outlook.com (10.255.174.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Fri, 3 Feb 2017 22:41:46 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:142) by BN6PR07CA0005.outlook.office365.com (2603:10b6:404:3a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16 via Frontend Transport; Fri, 3 Feb 2017 22:41:46 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; linux-iscsi.org; dkim=none (message not signed) header.d=none; linux-iscsi.org; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.888.7 via Frontend Transport; Fri, 3 Feb 2017 22:41:45 +0000 Received: from dut1171.mv.qlogic.com (172.29.51.171) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.309.2; Fri, 3 Feb 2017 14:41:25 -0800 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id v13MfCBv002384; Fri, 3 Feb 2017 14:41:12 -0800 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v13MfCsZ002383; Fri, 3 Feb 2017 14:41:12 -0800 From: Himanshu Madhani To: , , , CC: , , Subject: [PATCH v2 12/14] qla2xxx: Add async new target notification Date: Fri, 3 Feb 2017 14:40:53 -0800 Message-ID: <1486161655-2307-13-git-send-email-himanshu.madhani@cavium.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1486161655-2307-1-git-send-email-himanshu.madhani@cavium.com> References: <1486161655-2307-1-git-send-email-himanshu.madhani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(2980300002)(428002)(199003)(189002)(356003)(101416001)(8656002)(54906002)(8676002)(86362001)(48376002)(92566002)(2201001)(6666003)(81166006)(81156014)(2950100002)(1691005)(5001770100001)(305945005)(189998001)(36756003)(5003940100001)(2906002)(33646002)(106466001)(4001430100002)(107886002)(4326007)(50466002)(5660300001)(38730400001)(105586002)(42186005)(626004)(80596001)(69596002)(8936002)(4720700003)(50226002)(50986999)(76176999)(47776003)(87636001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR07MB030; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; PTR:50-232-66-26-static.hfc.comcastbusiness.net; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:zsN1gkPQpoqNe+jBYrRVQSkIwmlAiZQr9hxqkRQ4i2HzROwCKPP2a9anup2fvHmWvU6JlqmmbH7e1HGOflfCeojjxjPyvR44CkRfQA4NWZnRiIY9iGPPCfuYLpiSrPcyBsQS9O7tELB82m5kqhGngMISmvNNheQobFKZemrCVVFlNUCmd498GUmwYEDtqZnlhy3nRVIUUH/w82cFk64ehtPsa7+Dx2EAi8kmunBXsIIPfRMQvVwjziC7nVeiRyZmUi2Mlro9ZrPkn5NJUZhtjIwL5J2AHcnlPnuo9k7uZCSxpGh0fCykfY4hNHecucr1SC4kYdO7KrzgLmb/slhAUNrRXFv/0FZUWhuJDITDigWVglWJEOqi9Lodgx6sbrYh4MUfqNOl0r6pShsR2J4aczkmaqu4z+w42eh3bhITl+e6JN5dw7s4UC1IlvWUhynDiBkKpUdKlFUtMZq/yMunDEY73iH7yJlKKl3yKAlmzSBoj7V4ZaUZTIbX9YCO9FwLYVbALHLz8HgyUCrwAzz3+Bh0Gc9I0AqfYgCQTJl5u0M= X-MS-Office365-Filtering-Correlation-Id: d573ac08-389c-4e64-89d4-08d44c85d528 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:SN2PR07MB030; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB030; 3:RxFOb0L/0MNGiVtvPvnOCdU9Wnp1a0PTbYGNp8gMRgQvASU8R40l/c7LrOlv4UhY7Z44h9S4DYgmEgvVFtIczCibG+gWeCaaDD/IUVl6KKLqGST1aQlsPJ9Tq14wkFJdlmx1bBq0m6g2z98/GLPd9VO0lvvC7btUeB9Pj4IjN9w44lWIzYArqVW/1yExM1tN2Apr5UDAnqEBGJL8vxY4dl+FdF2gxCY0byWkoNVV880l8z1nBO6b19lYuS2fz/ei+OPdxiQtJkjpaWX+YfSGtXpa5/C7X2qi4b9HHfY+tMyzkBt/dKMDY38rFqMklOYJvYFesf35MXFZXKSsufE+TNuYbDgRQY4Zmxh70JB6x00jqLoCRXtX4Yjg6Tm03UVq; 25:su532SageUdrgGZhKbHeVunHGOGliGHIo17YrktNe5xQpHkV+VodLjd+rS9cdYH0kdCOZ3MsavKlEr/P5BgRfmHVpDrZPlpAEJqqisHBmrubnWZYCdQQnHfbOP/bBErvFUbrA1YwMgOPDw45r8+ib0LXZD4Qw8qUu1FutBSTfzT7xS6XHsRDab7IvsNk6olSXtWNUr+O4FA/ggmaxoIe0Sv8wE2J/SO4kgbESWTMfqlAp66tRUZnsJN0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Het0LBIR X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13024025)(13023025)(5005006)(8121501046)(13017025)(13018025)(13015025)(10201501046)(3002001)(6041248)(20161123555025)(20161123564025)(20161123560025)(20161123562025)(20161123558025)(6072148); SRVR:SN2PR07MB030; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB030; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB030; 4:FY8XywZv4r1tfmj1tx4J/JznbLOpJZ7zp2gPy8hMv728EMebGUIX6ppJyVFkDSIQHfGxALr10HsXEx2lc/b3HBYXaViOiKpWNvQHLjsRZEIzyXlclf1o5VLkiS0thmPO+qCWzsNYw59MUyo4CPPYHlB6NWSSJ8mhFYVNoT3uEask5IaKAn8lorJUdEWCM8ulCeOoYjIY4sofSnoNrlmnK1PS7bs1J9Vf6wAhbSogWaUpv9pYqjDSYbrpsGFt2xzAAdwjk6zSerSZ1RkrBM51yeBHItIFEGdylFIMQUZhUmxysBp9LyZGPM39oSkdQBWMsiMT3tm5BKcvoSbcF+VAhu9d89QfI9CyeO8ypVYsG6EM5jy344sgyO+t80CRpwvmwJgZZtZyB6gtf5JXKZq58xrjL8d1YCuUViq2PRA+tS8WdACL6TEYd8XcJj9sxcSJi5/2Zw4KtS5F8D39F9CJpim8rLQpAzIeiq9AXQEaO8V6OyR3vR656Gwpo9w7xixhoJIXqweU3e3WTWj1nlQVqZSguzIZI7+m6Y6sijR+o8TdGyuVItPQXaxtWIkn+Nd4r2zf1h9BLNwyWPuU5ec159z45d+PFHie/sBpyNUDllMFv/s+1CBkF5pShLlduztX1Yjs3sj9NLxRbwea+J9nBIzEoHoOiN27ZWN+Ru+4B6l1bwNcYcDRP0Ger9csUzZjo3+O9XP/A9zHLwoAhzscLQ== X-Forefront-PRVS: 02070414A1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR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sBqeQ6EBVvElEgaxdyiSpAl8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB030; 7:dIAFi6Vu3txb4+uka/LbK5vG3a6+m285AgcxcUks586kzjMto7gfqzrKEBW5WCexOGPfAEA1JiyRPj5WYO4Vm+FNU+fNMLaAbVWpzAu+sGYpSLQWasvoJHhau9ZZJPXC08qQroOtssTBTkAJiVx7HzwPU9+qgvwCVxHEEK8/ETMJoi7B8QpyVVVybewxsMwysQpzSwriqZt0Y+kBUUEhigJrSrHRBhJujN7ko6+nhNcAQoavaqVFTWeSHkJLreLulSOHtVq3KjZPihsDN+WPOaiW5foOy2qYkyIVskq/UckVlNr7NEfqT8a1HGd7tUDBxX23VTYeo/EZP4SBwv7NPZ8npbes1CrFkrnRWbb1ZJsaIZfFmJ2q4RVFJHvE1sbO42sTSbD/u+nu6f8vbCn2HbDxBf/4o7WOrUWHdpePh7QtjEAXr53HmpjBmAXslN2Oxp8O6TL5Hi6RoDaAlv9aS3t0rDcAgplbFuUQ82CcViMDIPz36X1tZ/30WhjmwbTEXEy+vyckLcQ0v0NV+O+0hw== X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2017 22:41:45.3215 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB030 Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Quinn Tran Signed-off-by: Quinn Tran Signed-off-by: Himanshu Madhani --- drivers/scsi/qla2xxx/qla_target.c | 6 +++--- drivers/scsi/qla2xxx/qla_target.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 8b372b2..2909b7b 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -5998,13 +5998,13 @@ int qlt_add_target(struct qla_hw_data *ha, struct scsi_qla_host *base_vha) tgt->datasegs_per_cmd = QLA_TGT_DATASEGS_PER_CMD_24XX; tgt->datasegs_per_cont = QLA_TGT_DATASEGS_PER_CONT_24XX; - if (base_vha->fc_vport) - return 0; - mutex_lock(&qla_tgt_mutex); list_add_tail(&tgt->tgt_list_entry, &qla_tgt_glist); mutex_unlock(&qla_tgt_mutex); + if (ha->tgt.tgt_ops && ha->tgt.tgt_ops->add_target) + ha->tgt.tgt_ops->add_target(base_vha); + return 0; } diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h index 82d53f3..20e25e5 100644 --- a/drivers/scsi/qla2xxx/qla_target.h +++ b/drivers/scsi/qla2xxx/qla_target.h @@ -693,6 +693,7 @@ struct qla_tgt_func_tmpl { void (*shutdown_sess)(struct fc_port *); int (*get_dif_tags)(struct qla_tgt_cmd *cmd, uint16_t *pfw_prot_opts); int (*chk_dif_tags)(uint32_t tag); + void (*add_target)(struct scsi_qla_host *); }; int qla2x00_wait_for_hba_online(struct scsi_qla_host *);