From patchwork Wed Apr 25 13:08:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dupuis, Chad" X-Patchwork-Id: 10363167 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 416426032C for ; Wed, 25 Apr 2018 13:09:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3001A28DF1 for ; Wed, 25 Apr 2018 13:09:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 24C4D28DFA; Wed, 25 Apr 2018 13:09: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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, 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 4BB8228DF6 for ; Wed, 25 Apr 2018 13:09:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754012AbeDYNJb (ORCPT ); Wed, 25 Apr 2018 09:09:31 -0400 Received: from mail-bl2nam02on0054.outbound.protection.outlook.com ([104.47.38.54]:61024 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752893AbeDYNJY (ORCPT ); Wed, 25 Apr 2018 09:09:24 -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=ad8Euewv9ZSx3XGBEsGNA7xhzIqe9eSzPsiK7QnGsJE=; b=hAAnM2rwJZ30XZEGtFuYk59lz5FRDvS0NT2cBe2H0ZO79rZviC1oS5rlwmeXlcSkY9bNQEmoaVIlhvSEjlq5AxB1U3Ef+pig7hJZ3DtZk2OsZelod51lxLPLa12tYCuYScu5IpaTJzj0E16C7BvST0fxZqD3gOw63zx66pwt1CA= Received: from BY2PR07CA0025.namprd07.prod.outlook.com (2a01:111:e400:7bff::20) by CY1PR07MB1510.namprd07.prod.outlook.com (2a01:111:e400:50ed::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Wed, 25 Apr 2018 13:09:22 +0000 Received: from BN1AFFO11FD013.protection.gbl (2a01:111:f400:7c10::137) by BY2PR07CA0025.outlook.office365.com (2a01:111:e400:7bff::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.696.13 via Frontend Transport; Wed, 25 Apr 2018 13:09:21 +0000 Authentication-Results: spf=pass (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=bestguesspass action=none header.from=cavium.com; Received-SPF: Pass (protection.outlook.com: domain of cavium.com designates 50.232.66.26 as permitted sender) receiver=protection.outlook.com; client-ip=50.232.66.26; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BN1AFFO11FD013.mail.protection.outlook.com (10.58.52.73) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.653.14 via Frontend Transport; Wed, 25 Apr 2018 13:09:20 +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; Wed, 25 Apr 2018 06:09: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 w3PD97mb006452; Wed, 25 Apr 2018 06:09:07 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id w3PD97Ei006451; Wed, 25 Apr 2018 06:09:07 -0700 From: Chad Dupuis To: CC: , , Subject: [PATCH 08/21] qedf: Honor priority from DCBX FCoE App tag. Date: Wed, 25 Apr 2018 06:08:52 -0700 Message-ID: <20180425130905.6385-9-chad.dupuis@cavium.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20180425130905.6385-1-chad.dupuis@cavium.com> References: <20180425130905.6385-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)(396003)(376002)(39860400002)(346002)(39380400002)(2980300002)(438002)(189003)(199004)(478600001)(6916009)(87636003)(72206003)(81166006)(8936002)(316002)(42186006)(106002)(16586007)(50226002)(1076002)(4326008)(48376002)(86362001)(356003)(2351001)(6666003)(5660300001)(81156014)(446003)(8676002)(107886003)(50466002)(47776003)(11346002)(305945005)(476003)(54906003)(51416003)(336012)(2906002)(2616005)(80596001)(69596002)(106466001)(486006)(36756003)(44832011)(186003)(76176011)(126002)(26005)(59450400001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR07MB1510; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Pass; LANG:en; PTR:50-232-66-26-static.hfc.comcastbusiness.net; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD013; 1:PE6PndcAsTuGaBWK0l/zTxhGI5RQB+sFtHihAzu4l6tjWgJi7YF7dQ2+f2EcI3+py1SpxNzg31WYkIDyMELCWUQm4ue7qZwboZ0FuySWBIdWYt4lQFF25YO7/F1BYRXc X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:CY1PR07MB1510; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB1510; 3:I/X5HViEL/INzi9fhegaPrF1s9lgz7KTkkfI+JlVzPPrXDEZzv07v+MYdjsR1ujF0jnIqN9RGZEUhJLIH2dUEioqzt0X3UhPyCtTK6Y3FuAwkIgYPXGxVaTSWGOCnnhkKpwoIUiqb0mWJ0zSA+dyFdgLtDtnXf7AhVLiYA6p1SC/NBZB7bFJFOvI0ljq4iCEklTmDY7N81FBTPVujjThiGIyU3W3o7FqIvaMiaswGldm5ULXKL2+f3f0Om20G2WPE9edz5oNo2NXq0qo3TX0MyLZNs18mQu+wBv2W9SiAK1xrrX4jQmfuL44PowAmTdqzzoGTnxCIFG2SSRW4GrcrSnByd1H9u7l0442Zq65Dpw=; 25:Gkomc6Yu7ygfmCFipwfo3lI6Y7e7y+FgS3bNbB3nvsF+mvXXXd6VeypAD5C2ChqsiTnPEKZ89/5b0btCF8mUAH5lr9oZzprT0vEw3XDPN7noDjCRIwVugBGnncynQtAM154D+MSvbpCG1M5y3BliB6XtUMfYCLUKi26mMI5ROE8bH3yprZXrSDWNcyxiDpRwKlM6rqWU3pFW6p23d/sD+qE+N+mqjrslVbJlEJDw3JHUymBjEFkMHoM3hzmT1xXs5TbaNaYKNUUZvUy1NC399xh/tnerAuhHWeTcSyDX0UFwWyd8GV+OYwS/YkZHSVsYbh2EnYbKHTcr05vSFem6CA== X-MS-TrafficTypeDiagnostic: CY1PR07MB1510: X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB1510; 31:iEltX/Ov72y0/WmypyFqeaoyazVlDk541QPt7Ulg/9x9J/vSehba/6TfkBIlSFX1flG/lEyZ7xx9YCnPkYQjNXCp1CcghxImp4XRp0XSsz7GbQMRCS0B0EpkCT/AsidcCvLBL/r4iGIVobGLCetXu7dY8uOJkflFW3PogYbc2FWZn+wG3Larw8BithCgl6kTHQv76oQhFXcKwQA5irm+bfqfvwy7vFuDGbk//Ivwdbg=; 20:4J3+3eiVOf2xmg+ZTkMZ8yO2Fgp+eDzKKa/AhnTBujC32/9NxWF83v4CfkpzZDVPcogWwX76MjG53czTaBJYz9qzQz0q+0X71BNKyHhtpUqJvILJQ4O9bO7rWZSyoVpWUCPdiyLAm0OMl3sRhlWdaUZXeIZkXXFI6OzH1j3XrAhXoHq6HxHrWzXxedoxu6iefFVWOD4kxtiMbJqncbH01ZKAdSRMPrzxVlQxZ3Ok/vZCsfIWVkeI3RksUpblHYueHvWIckYZaDBahZyI+sI8vQo2M5F9Ms1VkZ9XdDX4RQaJN+7ROBjD5Ztfg13fQluy/xwwb7FEz9H5gAWjtLR4COJBrlKDziP0wJQ6Hp9lfO2uhvKOgwTjNJaKR/D6oQTMeJF4sqUAXks6V5tvhR4nM4OnyM27b0cvQRscf/BNyTDIaT9yqeUR6x2aBa1/BjWAlvQd51i4mFrBpbMSp+HJplk9GDh3WUcTm4OfSihH8SaGbSK6weyYMRfdtMpLPa4l X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93004095)(3231232)(944501410)(52105095)(6041310)(20161123560045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:CY1PR07MB1510; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB1510; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB1510; 4:Te+pyGcfBK9S8Oh3Jb37P9c9irKbbZsrJtXelHEaV+iZUq9X2vIqz+Q6GOKEfRWtkkssQLBkdEipmNMzmRfVxAIZnH2aTuC8UQgAQvvVErhq+GgwbLRKbyjVvnEByl18Iu6mI6t3Sm60RkRWQAuDm+JZ3KeqC+/FZiEg60yKY+9C0gyA8NScxpsVHlqBMUAYJFpJUFPS+cGKvEcv/hntK2cBXu3cvWOVS3UOxYX9OSp9BbPkn4YkLSoZhUdI3lLkrT8hj3J8HQGY5oVal0zYOA== X-Forefront-PRVS: 06530126A4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB1510; 23:gVQ/O/iiJJOoqsRC30r7VD/YUdPcJvxwAekGe/35y?= =?us-ascii?Q?4nXg7Qb3kK7FtTuEbihZDCFL6ysQvW8LfIbNkqe9De+6Vbi16o7yeMJL0fLX?= =?us-ascii?Q?FarFkU9c3EGnl3e5SnqdKbgeat52SGEOgfraTpjxXwiMxUobrwsrN4wlq00t?= =?us-ascii?Q?4o+yrQgcz+iJCmTkzGu+TOQTZxu+R0ofL+6HnogLyyk2otamxPyrs2fZUj30?= =?us-ascii?Q?x0Q8pApSst2NSxh66jxWjt+mIIkw9YHi4CecgGiloRsU2920wZVAf9wSssos?= =?us-ascii?Q?LOBkN3rJVmoiL5uoO7id5041tzYeGzYuQN41RaG0uW/0YKF3ieRePmqweYdG?= =?us-ascii?Q?eUy12iHJLSZIfCj9R6Ndk3gG1Oj7NkEmH9tPAYb8nayXJDfQqyw8vYL76WBD?= =?us-ascii?Q?pKiDom6KOTwkQLcv+4L0hxgeAdScgnEAtHU7vKEeUc+3l3Lq6+L2lh6rg2ak?= =?us-ascii?Q?cyri/EwGMtrLqVE577eqqRYXidBbhGtzrquq3p9AC93p4XxMODyyy4D0ZRxs?= =?us-ascii?Q?v2DbJieg6piT9SbsB2ApxsoVisye62occyV4h9TyQ1SWrPRrV2KNntkNDGIU?= =?us-ascii?Q?YAFt7wKuVQPRwWcQsqSV3QO0/0wcaHtCJvHKAp1IK4aygV3D8M9rXS00YUEb?= =?us-ascii?Q?p+saqBB+l8bZPQQ3VZez5U6rzGdFYwzx/Mn91cmfxJ/TfH2oDcFkWuTXI8FX?= =?us-ascii?Q?a/ECdHWLb6Dd/SJyDLIWcKsjd1/h/RisVh8fYkGSGJnCm12fpxIB79k2k2cb?= =?us-ascii?Q?k04/u4zjYT3ar2990L/MvsOAYE1/7VAln9oZbjrnb4iiSCM7XJKUcwLuMq89?= =?us-ascii?Q?ibRHJPRB4c27zNkJLixoGfiTowRbQGlFqq0N2hIzGeQn03OHCBj8iyh4g8qW?= =?us-ascii?Q?BJP6LnENn45Emqww+OCLDBF95FtNXyxADL/2azgxwEZZ6RZ3LkjIDaof3HGr?= =?us-ascii?Q?uMLknQdydBuRcex3lt3ZammZ4L437i3ny68CrAy4U+VsKtOQlm3difl0XQ7e?= =?us-ascii?Q?V8mZXVXtNIjyoS7nfKmRhJKqzlz5XNQJiCLYXBZbIFjk8q/VoPtiseEa+tm5?= =?us-ascii?Q?i5rr5jIu0spbBPRO5V+ILCeaZS7KZUYegSDDGUe6LaR2/NREDtIzQ4jixmIz?= =?us-ascii?Q?OiCZ9gOL5dbz4e3u+eoHoVn3kl1aMBeV/NLCQWQUIqtmSdqf/Vo+GfQhZ0GN?= =?us-ascii?Q?Q78ktTFnFcqUJE=3D?= X-Microsoft-Antispam-Message-Info: xgQuJdi6Vif//WkzURVEdrfLIvPdbtkWDR1Yx+fxvRoHIaUNvowIKQ3j4JH+apaunzdVG/AWQX1P4XZryc08ePWhB5yzswNKrrKBWgLAzu3PfWos8GEJqeZPJ06Wb9uH2CHYRoEOnAoc7HzRcDftvkWPpB7+XFg4XPHevSAgvFp4qSlKEdKlNEkuRI12kUiy X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB1510; 6:tODB2fWsD1jydXyuoEx/fYmbOyUeOCsUoJ1y/aVUBiq5DxclKzr73PG4PQyy4H+7wzE3jSOCIHy9RZjhpBtdHDK9FebjqRrLnRnn6MWvjPkbG+Ar6NpLDzze1eEM2QSpJg3nZmERiSgeRL9RmiPYNMLdCQL5ZFogYxtH2fZr5YuehD4hde8q2MQk2hKR+5jY5l+COvYV4dfFiYX8XfmiHuQbF8OYo0wCBBlPsizFDxNYI3I0OxTBxkGUYSORQm5CK2h1fswE1Au/JBbrWJcCx3iCCkMf7Aq1rUhbVEh1sscnVOguBljWaSRGBhqm3HOyusibpB3gEx9sXhKfA2ev/9R5dF1OjaP8zL0l1I8XiWpyDN810u1MjMgDf5/S6M518Njd/2llcBtmaVjZ7zkDTHbl8g/OAiGeSc+plg6diNXg66KbLL6CyaGIihTNsrZtjSZ1QnXB+L11RKtaKi17aQ==; 5:ILv4a2O2eJ7SmGx/VecNUnXDDaU/9sYM4d+uItVXPQIEsubwRpxU0MBzHHVtJF1b4W2s7kMld6KIGymk06V/8RFmL9mgzs90NRxSW8aaCm/V4BNdGNW9iTTTtDKoimYwe3bl4M/QhhdYvVsUpBmlRBcV1Xr6kg0KkGcI6A+Z8U4=; 24:L2WPKxHbBZfvoVd0Vmlfb0XmOV5KCwX2t4mVLHab7pcEGxiJbczoaZ7HDajnUTqjH0yyhJ1t5ZwGMFVQAviuJs2nwzulmqvQROfvpIRLQM0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB1510; 7:/zLdg/phblXZXe17DcTw5DH+LDoFxBGET9GPbsseVN8V6pliu6UjdbqpWxrVGoUDwweRVCpf+c61OLmvm/WXcetHyDxaHAPdkDVuZdexDZZHP2rNPcgvu4dW3LNlcGvuQ1GkUN0KneE/6Jz0/gx/8fri8lX06QnQFaHa6u+X/Jlj0H5/SwB+2O6MLVqpLKqCCmL2uwPyVQ59zvx2dUlDR6oeOyF+Tne/93BCbyLjDM/kFqWjMlBhkYIYv8sYJ9b5 X-MS-Office365-Filtering-Correlation-Id: 446a8bf0-4f11-4046-e834-08d5aaadc292 X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Apr 2018 13:09:20.9832 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 446a8bf0-4f11-4046-e834-08d5aaadc292 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: CY1PR07MB1510 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 We currently hard code the priority in the 8021q tag to 3 for FCoE traffic. The vast majority of the time this is fine but if the priority is something else besides 3, any VLAN ID comparison either in the non-offload path or offload path will fail and cause dropped frames where none are expected. Change the behavior so that the driver default is 3 if we do not get any DCBX convergence. If DCBX does converge, then set the FIP/FCoE priority in the following manner: 1. If the qedf_default_prio modparam is set use that 2. If the DCBX FCoE priority is not in range (0..7) use 3 3. Use the DCBX FCoE priority we get in the driver's DCBX handler Signed-off-by: Chad Dupuis --- drivers/scsi/qedf/qedf.h | 1 + drivers/scsi/qedf/qedf_main.c | 52 +++++++++++++++++++++++++++++++------------ 2 files changed, 39 insertions(+), 14 deletions(-) diff --git a/drivers/scsi/qedf/qedf.h b/drivers/scsi/qedf/qedf.h index 996bd791783d..1dffe21873d0 100644 --- a/drivers/scsi/qedf/qedf.h +++ b/drivers/scsi/qedf/qedf.h @@ -301,6 +301,7 @@ struct qedf_ctx { #define QEDF_FALLBACK_VLAN 1002 #define QEDF_DEFAULT_PRIO 3 int vlan_id; + u8 prio; struct qed_dev *cdev; struct qed_dev_fcoe_info dev_info; struct qed_int_info int_info; diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c index 8df151ec143d..64491ae60059 100644 --- a/drivers/scsi/qedf/qedf_main.c +++ b/drivers/scsi/qedf/qedf_main.c @@ -54,10 +54,10 @@ module_param_named(fallback_vlan, qedf_fallback_vlan, int, S_IRUGO); MODULE_PARM_DESC(fallback_vlan, " VLAN ID to try if fip vlan request fails " "(default 1002)."); -static uint qedf_default_prio = QEDF_DEFAULT_PRIO; +static int qedf_default_prio = -1; module_param_named(default_prio, qedf_default_prio, int, S_IRUGO); -MODULE_PARM_DESC(default_prio, " Default 802.1q priority for FIP and FCoE" - " traffic (default 3)."); +MODULE_PARM_DESC(default_prio, " Override 802.1q priority for FIP and FCoE" + " traffic (value between 0 and 7, default 3)."); uint qedf_dump_frames; module_param_named(dump_frames, qedf_dump_frames, int, S_IRUGO | S_IWUSR); @@ -114,9 +114,9 @@ static struct kmem_cache *qedf_io_work_cache; void qedf_set_vlan_id(struct qedf_ctx *qedf, int vlan_id) { qedf->vlan_id = vlan_id; - qedf->vlan_id |= qedf_default_prio << VLAN_PRIO_SHIFT; + qedf->vlan_id |= qedf->prio << VLAN_PRIO_SHIFT; QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, "Setting vlan_id=%04x " - "prio=%d.\n", vlan_id, qedf_default_prio); + "prio=%d.\n", vlan_id, qedf->prio); } /* Returns true if we have a valid vlan, false otherwise */ @@ -521,7 +521,7 @@ static void qedf_link_update(void *dev, struct qed_link_output *link) "Starting link down tmo.\n"); atomic_set(&qedf->link_down_tmo_valid, 1); } - qedf->vlan_id = 0; + qedf->vlan_id = 0; qedf_update_link_speed(qedf, link); queue_delayed_work(qedf->link_update_wq, &qedf->link_update, qedf_link_down_tmo * HZ); @@ -532,6 +532,7 @@ static void qedf_link_update(void *dev, struct qed_link_output *link) static void qedf_dcbx_handler(void *dev, struct qed_dcbx_get *get, u32 mib_type) { struct qedf_ctx *qedf = (struct qedf_ctx *)dev; + u8 tmp_prio; QEDF_ERR(&(qedf->dbg_ctx), "DCBx event valid=%d enabled=%d fcoe " "prio=%d.\n", get->operational.valid, get->operational.enabled, @@ -547,6 +548,24 @@ static void qedf_dcbx_handler(void *dev, struct qed_dcbx_get *get, u32 mib_type) atomic_set(&qedf->dcbx, QEDF_DCBX_DONE); + /* + * Set the 8021q priority in the following manner: + * + * 1. If a modparam is set use that + * 2. If the value is not between 0..7 use the default + * 3. Use the priority we get from the DCBX app tag + */ + tmp_prio = get->operational.app_prio.fcoe; + if (qedf_default_prio > -1) + qedf->prio = qedf_default_prio; + else if (tmp_prio < 0 || tmp_prio > 7) { + QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC, + "FIP/FCoE prio %d out of range, setting to %d.\n", + tmp_prio, QEDF_DEFAULT_PRIO); + qedf->prio = QEDF_DEFAULT_PRIO; + } else + qedf->prio = tmp_prio; + if (atomic_read(&qedf->link_state) == QEDF_LINK_UP && !qedf_dcbx_no_wait) { if (atomic_read(&qedf->link_down_tmo_valid) > 0) @@ -1114,7 +1133,7 @@ static int qedf_offload_connection(struct qedf_ctx *qedf, conn_info.vlan_tag = qedf->vlan_id << FCOE_CONN_OFFLOAD_RAMROD_DATA_VLAN_ID_SHIFT; conn_info.vlan_tag |= - qedf_default_prio << FCOE_CONN_OFFLOAD_RAMROD_DATA_PRIORITY_SHIFT; + qedf->prio << FCOE_CONN_OFFLOAD_RAMROD_DATA_PRIORITY_SHIFT; conn_info.flags |= (FCOE_CONN_OFFLOAD_RAMROD_DATA_B_VLAN_FLAG_MASK << FCOE_CONN_OFFLOAD_RAMROD_DATA_B_VLAN_FLAG_SHIFT); @@ -2985,8 +3004,9 @@ static int __qedf_probe(struct pci_dev *pdev, int mode) qedf->link_update_wq = create_workqueue(host_buf); INIT_DELAYED_WORK(&qedf->link_update, qedf_handle_link_update); INIT_DELAYED_WORK(&qedf->link_recovery, qedf_link_recovery); - qedf->fipvlan_retries = qedf_fipvlan_retries; + /* Set a default prio in case DCBX doesn't converge */ + qedf->prio = QEDF_DEFAULT_PRIO; /* * Common probe. Takes care of basic hardware init and pci_* @@ -3412,12 +3432,16 @@ static int __init qedf_init(void) if (qedf_debug == QEDF_LOG_DEFAULT) qedf_debug = QEDF_DEFAULT_LOG_MASK; - /* Check that default prio for FIP/FCoE traffic is between 0..7 */ - if (qedf_default_prio > 7) { - qedf_default_prio = QEDF_DEFAULT_PRIO; - QEDF_ERR(NULL, "FCoE/FIP priority out of range, resetting to %d.\n", - QEDF_DEFAULT_PRIO); - } + /* + * Check that default prio for FIP/FCoE traffic is between 0..7 if a + * value has been set + */ + if (qedf_default_prio > -1) + if (qedf_default_prio > 7) { + qedf_default_prio = QEDF_DEFAULT_PRIO; + QEDF_ERR(NULL, "FCoE/FIP priority out of range, resetting to %d.\n", + QEDF_DEFAULT_PRIO); + } /* Print driver banner */ QEDF_INFO(NULL, QEDF_LOG_INFO, "%s v%s.\n", QEDF_DESCR,