From patchwork Tue Aug 15 17:08:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 9902219 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 4838160230 for ; Tue, 15 Aug 2017 17:09:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 332592888C for ; Tue, 15 Aug 2017 17:09:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 27CFD288AD; Tue, 15 Aug 2017 17:09:01 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 7BFCB2888C for ; Tue, 15 Aug 2017 17:09:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752535AbdHORJA (ORCPT ); Tue, 15 Aug 2017 13:09:00 -0400 Received: from mail-sn1nam02on0087.outbound.protection.outlook.com ([104.47.36.87]:46160 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751702AbdHORI6 (ORCPT ); Tue, 15 Aug 2017 13:08:58 -0400 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=pzIFHNwFjLSqFYVBL+vxgpVETqyL2eiAU1fWd638PM8=; b=Cq+K3eJD3biw0LmkHSNBKq+8RCOMZqi2GZTPglGJwXBSsj7HNpP0Q7uuoDlkuxV36i6kSC7NHPuRofnSTZY1oelA4snVJqxTgh1XvNUqlIVGbElyYSN4JUXEHkiROOsi9NgwyMLv5XkEDjBoC6j6GmPLcsSPHUSN0mLSXzo1rNs= Received: from BY2PR07CA0017.namprd07.prod.outlook.com (10.166.107.12) by CY1PR07MB2133.namprd07.prod.outlook.com (10.164.112.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1341.21; Tue, 15 Aug 2017 17:08:56 +0000 Received: from BN1AFFO11FD017.protection.gbl (2a01:111:f400:7c10::171) by BY2PR07CA0017.outlook.office365.com (2a01:111:e400:7bff::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1304.22 via Frontend Transport; Tue, 15 Aug 2017 17:08:56 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none; oracle.com; 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 BN1AFFO11FD017.mail.protection.outlook.com (10.58.52.77) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1304.16 via Frontend Transport; Tue, 15 Aug 2017 17:08:54 +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.347.0; Tue, 15 Aug 2017 10:08:22 -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 v7FH8MXc020853; Tue, 15 Aug 2017 10:08:22 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id v7FH8MUB020852; Tue, 15 Aug 2017 10:08:22 -0700 From: Chad Dupuis To: CC: , , Subject: [PATCH 3/6] qedf: Corrent VLAN tag insertion in fallback VLAN case. Date: Tue, 15 Aug 2017 10:08:18 -0700 Message-ID: <20170815170821.20806-4-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20170815170821.20806-1-chad.dupuis@cavium.com> References: <20170815170821.20806-1-chad.dupuis@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)(2980300002)(428002)(199003)(189002)(76176999)(2351001)(50986999)(42186005)(189998001)(101416001)(106466001)(1076002)(356003)(105586002)(50226002)(8936002)(81166006)(81156014)(4326008)(47776003)(8676002)(36756003)(80596001)(305945005)(6666003)(54906002)(33646002)(5660300001)(69596002)(626005)(72206003)(2950100002)(6916009)(87636003)(50466002)(110136004)(478600001)(107886003)(5003940100001)(2906002)(575784001)(48376002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB2133; 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; BN1AFFO11FD017; 1:SAAwS+V9TrEitzvoLfkwL95zYnDoyJDYkr3ybiePSMi0ErHxUqbUmQ+dUWwcAm/2/Mgdg5UeN2IwaX/m8Ba2RN5MDz9DdqahPPNL8c7gXkMB9pkypFaWUQE18Xz0WPvfCKlLEtiSDR2O27UUOH9gGEYagq7z2RfioJaMznETdDgMv4olFXSmJxelicvO1sIihbRQGlzVLFf1BMwiyZb5CgWwCC/RSnbFdTwgWJsrwnReUVKaaeUVYEG/NvkcObbQctiDyZzO0LOpJjw/KMG1mtVJZ889PJIL6tkj5lVO5aQkP2HGp9RYx8+GIGwHkwXqO++BsKJjTzzmIwD/tyN+ycrIc/NY21pPERyNWvdstPrQkIgj6Ymtbei5WOq3Z0O4avI4U8hhT+zsl7WLUIjWasclM03kx5iLFJ9iEmHr3ztsTOsJp1aGNOVKnQAMiEKn1CghfO3/Et0jtIr8igfKqHLR726lljgDvgf9GiZKiAp9hSj2MJ22ZdWiSPxo3fB4dVZnune2ZLW1DhjWLClg4dF6q/CxhcPNU9VeCS1qMoXFcq8m8dfVNmNKCZkH0MBJv1qx+tiwvxlEjpAusHLIvBHkNYwp5sGZ6z+5KCzIhDiZC/1j1ingnWSsS5DlR6YtIo0iwL2MaJcVBuPpyNsUvqfZfHvwkasmQp1LEB1y4jbOicHkkRdZCo6rZIIVDUOiPmfrImaBDa7kFIQn694d1wLJsLxxbco1jDTSY0fm9+ePc5IAp7QogYUDCJJja0TGOqgrZi/Ma8ExykixW9h/bLVbJSZqHpRo/NXKmGWjUng= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ae6a2416-04a5-4ba1-dddf-08d4e4004ff4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR07MB2133; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2133; 3:eYIiZ7AioF0nYtg+KIpW7Ei3JboCHSxDz7kJkdreJ64TW2J8ClVoQkovquDqNjHpKFJYQU7QFPpDemjvtvgxRl+fuKW/GU09kURrHKiV4ZHhn9w5T3eSB0nCZ47KYlAdvLfdWNW0vXIsQSK68E2LHC+BvuZ1OiUd8rRQBZ1WCB6PKU4NRQtCgNMxLazLadoS+5/qP5j1azBHzL8SZQZDPcBqIrlOYfwQyVsQGIEOpgDkwcIZX1lHXebPyqAapGkUHa1Pdfi+eN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4wTMrahosbomsPtP0b6NT6Yr6R8ZdPaPF9VXFSTk5yMRouit88z9zD7eqFPOO7HfzNi3bZNQk82+uOx/goo82rkadS8aFq/7RI6sTSCHqRzm93eor/ZzDu8S3zALyxTyXPlXEP9kWkYMsGM50TAPH67j5f50DwJ5ob; 4:NnGhVZTtayFWerxj/KLYTkqyJiZ/qKTNe5QOl/lIu6tKU7rXPyvB2j8zcReHytwEaT5ft+Tlpvb2/Lj8BDNUisd278ufKHzxPrDwIr7dtacxZxpOOJjVTdhyr6B2TXt/F+/jDa86/YT2SvpRYKuFy71XrfIieaHhvsF112lJeaSZO1gsyYOmQh3WGgbBVzUG0ac0UXpmYcTKE3Jw8J271KBdrKpTWuuGZnW61XpKcILYDc77XF5DkcwET2u40MLz X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13018025)(13016025)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR07MB2133; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR07MB2133; X-Forefront-PRVS: 04004D94E2 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2133; 23:uu8j5RjhGBshQDlBPmd+0e0zc7N/u0on2Xowr3mAK?= =?us-ascii?Q?H0hteG6Em7SZvYx6+fEF8wrKJoEMbvk2xjysgFAVEegEmaBbdw3puBHQ171U?= =?us-ascii?Q?zvzHbe09TIhwiKRnWk6Jhg3k8aib1Oq+F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7jC2BuSP4lw2ZTv6F6CcNGMyb/duBPV5j2EeB96NEeHXSG00uVoSyK?= =?us-ascii?Q?6kyJuI=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2133; 6:6tB9QtIPrsEyDxkx7V2L/3gjZ8i6qhrSWJOrGatzLAc5rzvyzi52mY9mKx/Ib5Pqi/N3fYE7G1UDkf9HtNbJDLaJ2zRH0zveCzLJU0i0VFQDwpqUMBmqKIidfLQKMuAec14prgBqjN65yE2Ke/J1qfOcjPHditRwmlprgA1wc1g9thBbZDQQVqBnWoON3K5K5G0MQ+8v/LLVSquBLoBtSAQejeZZ3LcSl8ESoCyHNl2Gr2nZbqLaE8nLauFZzU9e++pNh+nE8D/ydVDo4pQPZoVxhCUWZaYu6NoYW+NlD51hnH2OvPCTaTmavDGFmj+WciEEF3TXFmDzG+WlJoMNAA==; 5:PT4CV13Z/tieWbHGMhsw+piKF4fzUEbYFoQ4AUD+vj97HLB5h0/VswyvQ4Vteehy1M6STSCtNRgRKd+CULF+8D0KcInxg3P8p+YDhX2/PJu3cHJNkJhjbboKR+2CWg5sRA33ebvL7H5I9nGdEvyOwJTydypK6jwZhUTycfkkRIQ=; 24:IN6SfTNxc6g13Q21pkA6AvjAlsFDVBxxjfgGTvj3zdkpWH8puJyId/ArlMAYww8a4CK2Flr63DzhuEmEj5PQPBiLUSp2ZyZy2SwNsjKURPA=; 7:zcgj1golxetrNIIjoauSZxYisHX9NCXrPGWEz+7kNpXY8Hf0/WibqhEX2dXxJ256paxoh4strM6FH/TSPfOnJ7tBVyho/yBLyV5yFEJk+zz/P7E8b39dC8+QzzEhKcEqS2LZYn7/RJETjhJ/jrL2CmiybKPdMv2dAejnbqR22nJ4Y3XVG1qWmACI1dRqf8b5kgbfeOYOqWEZ/HTvyrZnnO8TgCnoVe0VJ6CPIMB4f+Y= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2017 17:08:54.6183 (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: CY1PR07MB2133 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 Currently in the driver the qedf_ctx attribute vlan_hw_insert is used to which whether to insert a VLAN tag in FIP frames (except for FIP VLAN request which is explicitly sent out untagged at least from the driver's point of view). When we receive a FIP VLAN response, we set qedf->vlan_hw_insert to 0 which makes the qedf_fip_send function insert the VLAN. However when we exhaust our FIP VLAN retries, we do not set qedf->vlan_hw_insert to 0 which means that the driver will not tag the FIP frame with the correct VLAN ID. The result that was observed on the wire is that some entity either int he LL2 or L2 firmware is adding a NULL VLAN tag which can cause FIP solicitation to fail. The offload FCoE frame function, qedf_xmit, does not use the vlan_hw_insert attribute to decide whether to tag frames with the FIP/FCoE VLAN. Instead it unilaterially tags the offload frames with the VLAN ID stored in qedf->vlan_id. This is the correct behavior so the driver can guarantee that non-offload FIP frames go out with the correct VLAN ID. Also use the Linux network layer helpers instead of doing the VLAN insert manually. Also fix setting the fallback VLAN so that it used the module parameter and is not hardcoded to 1002 (though 1002 is the default). Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf.h | 1 - drivers/scsi/qedf/qedf_fip.c | 18 +++++++----------- drivers/scsi/qedf/qedf_main.c | 12 ++++++++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h index e05ec331557b..9bf7b227e69a 100644 --- a/drivers/scsi/qedf/qedf.h +++ b/drivers/scsi/qedf/qedf.h @@ -300,7 +300,6 @@ struct qedf_ctx { #define QEDF_FALLBACK_VLAN 1002 #define QEDF_DEFAULT_PRIO 3 int vlan_id; - uint vlan_hw_insert:1; struct qed_dev *cdev; struct qed_dev_fcoe_info dev_info; struct qed_int_info int_info; diff --git a/drivers/scsi/qedf/qedf_fip.c b/drivers/scsi/qedf/qedf_fip.c index 28ce0f7ffc7b..773558fc0697 100644 --- a/drivers/scsi/qedf/qedf_fip.c +++ b/drivers/scsi/qedf/qedf_fip.c @@ -108,7 +108,6 @@ void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) { struct qedf_ctx *qedf = container_of(fip, struct qedf_ctx, ctlr); struct ethhdr *eth_hdr; - struct vlan_ethhdr *vlan_hdr; struct fip_header *fiph; u16 op, vlan_tci = 0; u8 sub; @@ -124,16 +123,14 @@ void qedf_fip_send(struct fcoe_ctlr *fip, struct sk_buff *skb) op = ntohs(fiph->fip_op); sub = fiph->fip_subcode; - if (!qedf->vlan_hw_insert) { - vlan_hdr = skb_push(skb, sizeof(*vlan_hdr) - sizeof(*eth_hdr)); - memcpy(vlan_hdr, eth_hdr, 2 * ETH_ALEN); - vlan_hdr->h_vlan_proto = htons(ETH_P_8021Q); - vlan_hdr->h_vlan_encapsulated_proto = eth_hdr->h_proto; - vlan_hdr->h_vlan_TCI = vlan_tci = htons(qedf->vlan_id); - } + /* + * Add VLAN tag to non-offload FIP frame based on current stored VLAN + * for FIP/FCoE traffic. + */ + __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), qedf->vlan_id); - /* Update eth_hdr since we added a VLAN tag */ - eth_hdr = (struct ethhdr *)skb_mac_header(skb); + /* Get VLAN ID from skb for printing purposes */ + __vlan_hwaccel_get_tag(skb, &vlan_tci); QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_LL2, "FIP frame send: " "dest=%pM op=%x sub=%x vlan=%04x.", eth_hdr->h_dest, op, sub, @@ -174,7 +171,6 @@ void qedf_fip_recv(struct qedf_ctx *qedf, struct sk_buff *skb) /* Handle FIP VLAN resp in the driver */ if (op == FIP_OP_VLAN && sub == FIP_SC_VL_NOTE) { qedf_fcoe_process_vlan_resp(qedf, skb); - qedf->vlan_hw_insert = 0; kfree_skb(skb); } else if (op == FIP_OP_CTRL && sub == FIP_SC_CLR_VLINK) { QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, "Clear virtual " diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 1df80aa03da1..0520dd1be749 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -164,7 +164,7 @@ static void qedf_handle_link_update(struct work_struct *work) QEDF_WARN(&(qedf->dbg_ctx), "Did not receive FIP VLAN " "response, falling back to default VLAN %d.\n", qedf_fallback_vlan); - qedf_set_vlan_id(qedf, QEDF_FALLBACK_VLAN); + qedf_set_vlan_id(qedf, qedf_fallback_vlan); /* * Zero out data_src_addr so we'll update it with the new @@ -361,8 +361,9 @@ static void qedf_link_recovery(struct work_struct *work) /* Since the link when down and up to verify which vlan we're on */ qedf->fipvlan_retries = qedf_fipvlan_retries; rc = qedf_initiate_fipvlan_req(qedf); + /* If getting the VLAN fails, set the VLAN to the fallback one */ if (!rc) - return; + qedf_set_vlan_id(qedf, qedf_fallback_vlan); /* * We need to wait for an FCF to be selected due to the @@ -964,6 +965,10 @@ static int qedf_xmit(struct fc_lport *lport, struct fc_frame *fp) skb->mac_len = elen; skb->protocol = htons(ETH_P_FCOE); + /* + * Add VLAN tag to non-offload FCoE frame based on current stored VLAN + * for FIP/FCoE traffic. + */ __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), qedf->vlan_id); /* fill up mac and fcoe headers */ @@ -3172,8 +3177,7 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) } set_bit(QEDF_LL2_STARTED, &qedf->flags); - /* hw will be insterting vlan tag*/ - qedf->vlan_hw_insert = 1; + /* Set initial FIP/FCoE VLAN to NULL */ qedf->vlan_id = 0; /*