From patchwork Mon Apr 22 05:44:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saurav Kashyap X-Patchwork-Id: 10910677 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A302161F for ; Mon, 22 Apr 2019 05:45:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2DB9428668 for ; Mon, 22 Apr 2019 05:45:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 221BC2866D; Mon, 22 Apr 2019 05:45:46 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 B626C28668 for ; Mon, 22 Apr 2019 05:45:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726751AbfDVFpp (ORCPT ); Mon, 22 Apr 2019 01:45:45 -0400 Received: from mail-eopbgr760059.outbound.protection.outlook.com ([40.107.76.59]:20497 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726645AbfDVFpp (ORCPT ); Mon, 22 Apr 2019 01:45:45 -0400 Received: from DM6PR07CA0027.namprd07.prod.outlook.com (20.176.74.40) by DM5PR07MB2956.namprd07.prod.outlook.com (10.168.104.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Mon, 22 Apr 2019 05:45:42 +0000 Received: from DM3NAM05FT059.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::202) by DM6PR07CA0027.outlook.office365.com (2603:10b6:5:94::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.16 via Frontend Transport; Mon, 22 Apr 2019 05:45:42 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by DM3NAM05FT059.mail.protection.outlook.com (10.152.98.176) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1792.7 via Frontend Transport; Mon, 22 Apr 2019 05:45:42 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Sun, 21 Apr 2019 22:45:30 -0700 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 x3M5jUsf003295; Sun, 21 Apr 2019 22:45:30 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x3M5jUoX003294; Sun, 21 Apr 2019 22:45:30 -0700 From: Saurav Kashyap To: CC: , Subject: [PATCH 09/12] qedf: Check the return value of start_xmit. Date: Sun, 21 Apr 2019 22:44:58 -0700 Message-ID: <20190422054501.3224-10-skashyap@marvell.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20190422054501.3224-1-skashyap@marvell.com> References: <20190422054501.3224-1-skashyap@marvell.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Matching-Connectors: 132003855428217999;(abac79dc-c90b-41ba-8033-08d666125e47);(abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38;IPV:CAL;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(376002)(39850400004)(346002)(136003)(2980300002)(1110001)(339900001)(189003)(199004)(105606002)(2351001)(356004)(8676002)(5660300002)(81156014)(50226002)(6666004)(76130400001)(81166006)(8936002)(336012)(26005)(70586007)(14444005)(48376002)(446003)(11346002)(2906002)(97736004)(36756003)(50466002)(126002)(2616005)(486006)(53936002)(476003)(70206006)(4326008)(76176011)(1076003)(6862004)(69596002)(54906003)(498600001)(87636003)(26826003)(86362001)(16586007)(80596001)(47776003)(51416003)(36906005)(305945005)(42186006)(316002)(68736007)(85426001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR07MB2956;H:CAEXCH02.caveonetworks.com;FPR:;SPF:Fail;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1664a7ba-adfd-481e-9e83-08d6c6e5c23e X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(5600141)(711020)(4605104)(2017052603328);SRVR:DM5PR07MB2956; X-MS-TrafficTypeDiagnostic: DM5PR07MB2956: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 00159D1518 X-Microsoft-Antispam-Message-Info: yiz1MeQaxlZO6nO28jjm2HfnjanPAlzqUU4qUGraksw+6PZqu7pqkK/3NniclC5OlbThUJ6X/Q9gFqssjNNvb+Ekmy4MYJdA9vPRagA81faSTFYEshnj1wu8iPes0mAfFDtGI7cC5A09Ysr78UeSo6sdu7A4nZcGOrAHJZQ9DxSUCi8dQQGur4bWdpg+4UD2b/EiDEKY7Fa72jHA2E37SRqzvxwHvmnSjra5KOoRNKc8ABoB22P+oE8doJNoqhjJZNZlPAKA7EluS2PS/l0nUHjIxmD+jcJTd6yplxajlRomgasVi3rwa5TfQedt41OX2XiGH9SYLyCUly1+IGNTyDdkuLt8H6UWMwokkfvC33NISkoc1/1o2lx3Gv5wAJ2uaSoZtqhGOK5Kv+GlQgCXLaMgfK3Tzi786k+yEHwMQoY= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Apr 2019 05:45:42.4675 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1664a7ba-adfd-481e-9e83-08d6c6e5c23e X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[199.233.58.38];Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB2956 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Log the reason for start xmit failure. Signed-off-by: Saurav Kashyap Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf_fip.c | 17 +++++++++++++++-- drivers/scsi/qedf/qedf_main.c | 7 ++++++- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c index 49d0724..d4741f8 100644 --- a/drivers/scsi/qedf/qedf_fip.c +++ b/drivers/scsi/qedf/qedf_fip.c @@ -23,6 +23,7 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf) #define MY_FIP_ALL_FCF_MACS ((__u8[6]) { 1, 0x10, 0x18, 1, 0, 2 }) static u8 my_fcoe_all_fcfs[ETH_ALEN] = MY_FIP_ALL_FCF_MACS; unsigned long flags = 0; + int rc = -1; skb = dev_alloc_skb(sizeof(struct fip_vlan)); if (!skb) @@ -66,7 +67,13 @@ void qedf_fcoe_send_vlan_req(struct qedf_ctx *qedf) } set_bit(QED_LL2_XMIT_FLAGS_FIP_DISCOVERY, &flags); - qed_ops->ll2->start_xmit(qedf->cdev, skb, flags); + rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, flags); + if (rc) { + QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); + kfree_skb(skb); + return; + } + } static void qedf_fcoe_process_vlan_resp(struct qedf_ctx *qedf, @@ -118,6 +125,7 @@ void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) struct fip_header *fiph; u16 op, vlan_tci = 0; u8 sub; + int rc = -1; if (!test_bit(QEDF_LL2_STARTED, &qedf->flags)) { QEDF_WARN(&(qedf->dbg_ctx), "LL2 not started\n"); @@ -146,7 +154,12 @@ void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) print_hex_dump(KERN_WARNING, "fip ", DUMP_PREFIX_OFFSET, 16, 1, skb->data, skb->len, false); - qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + if (rc) { + QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); + kfree_skb(skb); + return; + } } static u8 fcoe_all_enode[ETH_ALEN] = FIP_ALL_ENODE_MACS; diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index e2f3228..1de2b18 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -1141,7 +1141,12 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp) if (qedf_dump_frames) print_hex_dump(KERN_WARNING, "fcoe: ", DUMP_PREFIX_OFFSET, 16, 1, skb->data, skb->len, false); - qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + rc = qed_ops->ll2->start_xmit(qedf->cdev, skb, 0); + if (rc) { + QEDF_ERR(&qedf->dbg_ctx, "start_xmit failed rc = %d.\n", rc); + kfree_skb(skb); + return rc; + } return 0; }