From patchwork Thu Sep 3 04:48:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76338 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 492E7A04D7; Thu, 3 Sep 2020 06:55:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3DF461C0D0; Thu, 3 Sep 2020 06:55:27 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B0E141C0B1 for ; Thu, 3 Sep 2020 06:55:24 +0200 (CEST) IronPort-SDR: 2Ia6loR49jGGoucutLpbjyPPiqX+nlIzZnI8cYlzPGSCVrf4d7+Je5or6Wj7HaDUh5qjDKN40N F0snrprdp1dw== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732224" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732224" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:24 -0700 IronPort-SDR: STyhVy85lNDyN3vTf0UirnwVBvrqV/fcHX1DoLF8GOSnkQwjt5gv4CvEvbRVwvOwqTCeAqwuj3 c+nCM7um23lA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349241" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:22 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Dawid Lukwinski Date: Thu, 3 Sep 2020 04:48:42 +0000 Message-Id: <20200903044856.61961-2-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 01/15] net/i40e/base: enable FEC on/off flag setting for X722 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Starting with API version 1.10 firmware for X722 devices has ability to change FEC settings in PHY. Code added in this patch checks API version and sets appropriate capability flag. Signed-off-by: Dawid Lukwinski Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_adminq.c | 6 ++++++ drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++ drivers/net/i40e/base/i40e_type.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/net/i40e/base/i40e_adminq.c b/drivers/net/i40e/base/i40e_adminq.c index c89e1fb3f..0da45f03e 100644 --- a/drivers/net/i40e/base/i40e_adminq.c +++ b/drivers/net/i40e/base/i40e_adminq.c @@ -603,6 +603,12 @@ STATIC void i40e_set_hw_flags(struct i40e_hw *hw) (aq->api_maj_ver == 1 && aq->api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_X722)) hw->flags |= I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE; + + if (aq->api_maj_ver > 1 || + (aq->api_maj_ver == 1 && + aq->api_min_ver >= I40E_MINOR_VER_FW_REQUEST_FEC_X722)) + hw->flags |= I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE; + /* fall through */ default: break; diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 1905167f5..f790183be 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -25,6 +25,8 @@ #define I40E_MINOR_VER_GET_LINK_INFO_X722 0x0009 /* API version 1.6 for X722 devices adds ability to stop FW LLDP agent */ #define I40E_MINOR_VER_FW_LLDP_STOPPABLE_X722 0x0006 +/* API version 1.10 for X722 devices adds ability to request FEC encoding */ +#define I40E_MINOR_VER_FW_REQUEST_FEC_X722 0x000A struct i40e_aq_desc { __le16 flags; diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index 014a4c132..b5b5b928d 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -745,6 +745,7 @@ struct i40e_hw { #define I40E_HW_FLAG_FW_LLDP_PERSISTENT BIT_ULL(5) #define I40E_HW_FLAG_AQ_PHY_ACCESS_EXTENDED BIT_ULL(6) #define I40E_HW_FLAG_DROP_MODE BIT_ULL(7) +#define I40E_HW_FLAG_X722_FEC_REQUEST_CAPABLE BIT_ULL(8) u64 flags; /* Used in set switch config AQ command */ From patchwork Thu Sep 3 04:48:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76339 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 57AC7A04D7; Thu, 3 Sep 2020 06:55:40 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 71C341C0D7; Thu, 3 Sep 2020 06:55:29 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id D1BC31C0CE for ; Thu, 3 Sep 2020 06:55:26 +0200 (CEST) IronPort-SDR: KVpID5AuNedwbrDn8agj36i98RQxz2FwjqJo1rmhKatDY7HWP7798Gchl3ud2d+/C1ZEI38zl2 fNbxUXNU7N4g== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732231" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732231" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:26 -0700 IronPort-SDR: YNQ/Z64gNaFPg4ie28qjVP5xQDW7ZjQknYLprlTL+9qPnwxTqk5a5tfrmvt3DAWILgAKq0Y5rO FgPfTvx4/Oyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349250" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:24 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Przemyslaw Patynowski Date: Thu, 3 Sep 2020 04:48:43 +0000 Message-Id: <20200903044856.61961-3-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 02/15] net/i40e/base: add PTYPE definition X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add I40E_RX_PTYPE_PARSER_ABORTED definition, so i40e driver will know opcode for parser aborted packets. Without this definition driver would have to rely on magic numbers. Signed-off-by: Przemyslaw Patynowski Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_type.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index b5b5b928d..0eeb55975 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -961,7 +961,8 @@ enum i40e_rx_l2_ptype { I40E_RX_PTYPE_GRENAT4_MAC_PAY3 = 58, I40E_RX_PTYPE_GRENAT4_MACVLAN_IPV6_ICMP_PAY4 = 87, I40E_RX_PTYPE_GRENAT6_MAC_PAY3 = 124, - I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153 + I40E_RX_PTYPE_GRENAT6_MACVLAN_IPV6_ICMP_PAY4 = 153, + I40E_RX_PTYPE_PARSER_ABORTED = 255 }; struct i40e_rx_ptype_decoded { From patchwork Thu Sep 3 04:48:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76340 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 743DFA04D7; Thu, 3 Sep 2020 06:55:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AEF471C10F; Thu, 3 Sep 2020 06:55:30 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id F32D31C0D7 for ; Thu, 3 Sep 2020 06:55:28 +0200 (CEST) IronPort-SDR: mDYQqgfAUn6RGPuEN6oU64MeAZootz55dkX3t7aedfwxtfPrNgDcfJi03eqCUxXAsbL3ItHR6r 7CWbfOveU7mQ== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732235" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732235" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:28 -0700 IronPort-SDR: gr+37rcZPs1RKwu9pSVCzFDgQntP5JNlcryeuPjB5HjfNuEDh86VhxZuKVXt2OUqs+RbAK9Zo1 gDWbJXN08t2Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349257" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:26 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Harshitha Ramamurthy Date: Thu, 3 Sep 2020 04:48:44 +0000 Message-Id: <20200903044856.61961-4-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 03/15] net/i40e/base: add new custom cloud filter types X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds the new filter types needed for custom cloud filters. These custom cloud filters will route traffic to VFs based on the dst IP for both tunneled and non-tunneled packets. Signed-off-by: Harshitha Ramamurthy Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_adminq_cmd.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index f790183be..21f544840 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -1406,6 +1406,8 @@ struct i40e_aqc_cloud_filters_element_data { #define I40E_AQC_ADD_CLOUD_FILTER_IMAC 0x000A #define I40E_AQC_ADD_CLOUD_FILTER_OMAC_TEN_ID_IMAC 0x000B #define I40E_AQC_ADD_CLOUD_FILTER_IIP 0x000C +#define I40E_AQC_ADD_CLOUD_FILTER_OIP1 0x0010 +#define I40E_AQC_ADD_CLOUD_FILTER_OIP2 0x0012 /* 0x000D reserved */ /* 0x000E reserved */ /* 0x000F reserved */ From patchwork Thu Sep 3 04:48:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76341 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 55654A04D7; Thu, 3 Sep 2020 06:55:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E81881C114; Thu, 3 Sep 2020 06:55:32 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 256611C114 for ; Thu, 3 Sep 2020 06:55:30 +0200 (CEST) IronPort-SDR: lsZQRv8TnqGyX4+6Oj0f9jd4gVikQ2m3PwqEE+KtVg8BzGUVBDzV9vynno/T2mTMg2ZsyYNyfu zvMeov5Tor7Q== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732237" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732237" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:30 -0700 IronPort-SDR: IxwFaV+uw6O3y+P5KCtA3lCZdRCnEPplV6YFFh1If+6hM9kjyzADkIJLsVH9qTqEjcy8OPv+Tl duX5Kx4x1Cjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349264" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:28 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Jacek Naczyk Date: Thu, 3 Sep 2020 04:48:45 +0000 Message-Id: <20200903044856.61961-5-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 04/15] net/i40e/base: update FW API version to 1.12 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Upcoming FW increment API version to 1.12 due to new bit and new fields in the Replace Cloud Filters AQ command. Signed-off-by: Jacek Naczyk Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_adminq_cmd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 21f544840..ba4b27f4d 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -12,8 +12,8 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR_X722 0x000A -#define I40E_FW_API_VERSION_MINOR_X710 0x000A +#define I40E_FW_API_VERSION_MINOR_X722 0x000B +#define I40E_FW_API_VERSION_MINOR_X710 0x000C #define I40E_FW_MINOR_VERSION(_h) ((_h)->mac.type == I40E_MAC_XL710 ? \ I40E_FW_API_VERSION_MINOR_X710 : \ From patchwork Thu Sep 3 04:48:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76342 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A242DA04D7; Thu, 3 Sep 2020 06:56:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3C7A31C11F; Thu, 3 Sep 2020 06:55:36 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id BE8B61C11B; Thu, 3 Sep 2020 06:55:33 +0200 (CEST) IronPort-SDR: qz5cq5LB8BrwU/Vc/d6MoCGXbgUuS+aSg4UZk76g6ZM25kKhLqULVsN11ne2mAyL+fz60M04A5 v0DdsAM0d/5g== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732239" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732239" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:33 -0700 IronPort-SDR: UCZbuxvB92I4e1hfXJvXcIqpBkAnkZEMnUmNDBjwEjlnc7mhao32ofB/YtiKJrEo89c6MM++Lv ny1nBsyh/Lhg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349272" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:31 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , stable@dpdk.org, Adam Ludkiewicz Date: Thu, 3 Sep 2020 04:48:46 +0000 Message-Id: <20200903044856.61961-6-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 05/15] net/i40e/base: fix possible uninitialized variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix possible uninitialized variable in i40e in the i40e_get_lpi_counters function. Fixes: 429bdc0cd967 ("net/i40e/base: add function to read LPI counters") Cc: stable@dpdk.org Signed-off-by: Adam Ludkiewicz Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 46a0b7881..85c22849e 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -7097,7 +7097,7 @@ enum i40e_status_code i40e_get_lpi_counters(struct i40e_hw *hw, I40E_AQ_RUN_PHY_ACT_DNL_OPCODE_GET_EEE_STAT, &cmd_status, tx_counter, rx_counter, NULL); - if (cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC) + if (!retval && cmd_status != I40E_AQ_RUN_PHY_ACT_CMD_STAT_SUCC) retval = I40E_ERR_ADMIN_QUEUE_ERROR; return retval; From patchwork Thu Sep 3 04:48:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76343 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4CC3A04D7; Thu, 3 Sep 2020 06:56:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1EA381C11B; Thu, 3 Sep 2020 06:55:38 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B2E3B1C0CF for ; Thu, 3 Sep 2020 06:55:35 +0200 (CEST) IronPort-SDR: RXxJtEm4TFipaozcc+vyIngi3PYK/t0rasop7guUh29XG488OLZUc70zqo0NCa+40BIZQOoPd4 ihlzN946rmcA== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732242" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732242" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:35 -0700 IronPort-SDR: o4stDC2c/nMeOln545Q5V+zC9kw+eNraLx1DL5zl5oAW+nt5VijkjIcpGh6k9rjzm+XSk3p5ov IFhhbNcZX8FQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349283" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:33 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Damian Milosek Date: Thu, 3 Sep 2020 04:48:47 +0000 Message-Id: <20200903044856.61961-7-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 06/15] net/i40e/base: support unused ports disabling X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch adds support for disabling unused ports. Signed-off-by: Damian Milosek Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_adminq_cmd.h | 1 + drivers/net/i40e/base/i40e_common.c | 6 ++++++ drivers/net/i40e/base/i40e_type.h | 1 + 3 files changed, 8 insertions(+) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index ba4b27f4d..439669ef9 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -440,6 +440,7 @@ struct i40e_aqc_list_capabilities_element_resp { #define I40E_AQ_CAP_ID_SDP 0x0062 #define I40E_AQ_CAP_ID_MDIO 0x0063 #define I40E_AQ_CAP_ID_WSR_PROT 0x0064 +#define I40E_AQ_CAP_ID_DIS_UNUSED_PORTS 0x0067 #define I40E_AQ_CAP_ID_NVM_MGMT 0x0080 #define I40E_AQ_CAP_ID_FLEX10 0x00F1 #define I40E_AQ_CAP_ID_CEM 0x00F2 diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 85c22849e..65317f6c6 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -4021,6 +4021,12 @@ STATIC void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, "HW Capability: wr_csr_prot = 0x%llX\n\n", (p->wr_csr_prot & 0xffff)); break; + case I40E_AQ_CAP_ID_DIS_UNUSED_PORTS: + p->dis_unused_ports = (bool)number; + i40e_debug(hw, I40E_DEBUG_INIT, + "HW Capability: dis_unused_ports = %d\n\n", + p->dis_unused_ports); + break; case I40E_AQ_CAP_ID_NVM_MGMT: if (number & I40E_NVM_MGMT_SEC_REV_DISABLED) p->sec_rev_disabled = true; diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index 0eeb55975..cf4134583 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -425,6 +425,7 @@ struct i40e_hw_capabilities { u32 enabled_tcmap; u32 maxtc; u64 wr_csr_prot; + bool dis_unused_ports; bool apm_wol_support; enum i40e_acpi_programming_method acpi_prog_method; bool proxy_support; From patchwork Thu Sep 3 04:48:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76344 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 37251A04D7; Thu, 3 Sep 2020 06:56:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1E66F1C128; Thu, 3 Sep 2020 06:55:40 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 220D91C123 for ; Thu, 3 Sep 2020 06:55:38 +0200 (CEST) IronPort-SDR: Ag+qrctKUeXSJ6oubS1OVvUHNhmJ9pLxIR+1Zt4b1w8MzA8pzBgWFajua4poQNDcPUeasnYyF7 lGGzfNTrNHIQ== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732243" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732243" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:37 -0700 IronPort-SDR: K9R8rzNLhB18JrdPAmDSmc2P3QALZ7KFupRu2t/qT8xnVSXQLc1qyhmQRWkY6TDsHdg1HLYRJ5 dVaNd653c3ug== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349293" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:35 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Jaroslaw Ilgiewicz Date: Thu, 3 Sep 2020 04:48:48 +0000 Message-Id: <20200903044856.61961-8-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 07/15] net/i40e/base: replace AQ command for NVM update X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add AQ command "NVM update in process" to replace the original AQ command "NVM progress". Signed-off-by: Jaroslaw Ilgiewicz Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/i40e_adminq_cmd.h | 12 +++++- drivers/net/i40e/base/i40e_common.c | 53 +++++++++++++++---------- drivers/net/i40e/base/i40e_prototype.h | 6 ++- 3 files changed, 46 insertions(+), 25 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 439669ef9..9ef01f371 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -240,7 +240,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_update = 0x0703, i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, - i40e_aqc_opc_nvm_progress = 0x0706, + i40e_aqc_opc_nvm_update_in_process = 0x0706, i40e_aqc_opc_oem_post_update = 0x0720, i40e_aqc_opc_thermal_sensor = 0x0721, @@ -2400,6 +2400,16 @@ struct i40e_aqc_nvm_config_data_feature { I40E_CHECK_STRUCT_LEN(0x6, i40e_aqc_nvm_config_data_feature); +/* NVM Update in Process (direct 0x0706) */ +struct i40e_aqc_nvm_update_in_process { + u8 command; +#define I40E_AQ_UPDATE_FLOW_END 0x0 +#define I40E_AQ_UPDATE_FLOW_START 0x1 + u8 reserved[15]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_nvm_update_in_process); + struct i40e_aqc_nvm_config_data_immediate_field { __le32 field_id; __le32 field_value; diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 65317f6c6..6c6fb4de4 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -3686,6 +3686,37 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, return status; } +/** + * i40e_aq_nvm_update_in_process + * @hw: pointer to the hw struct + * @update_flow_state: True indicates that update flow starts, false that ends + * @cmd_details: pointer to command details structure or NULL + * + * Indicate NVM update in process. + **/ +enum i40e_status_code +i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_nvm_update_in_process *cmd = + (struct i40e_aqc_nvm_update_in_process *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_nvm_update_in_process); + + cmd->command = I40E_AQ_UPDATE_FLOW_END; + + if (update_flow_state) + cmd->command |= I40E_AQ_UPDATE_FLOW_START; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + /** * i40e_aq_oem_post_update - triggers an OEM specific flow after update * @hw: pointer to the hw struct @@ -4257,28 +4288,6 @@ enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw, return status; } -/** - * i40e_aq_nvm_progress - * @hw: pointer to the hw struct - * @progress: pointer to progress returned from AQ - * @cmd_details: pointer to command details structure or NULL - * - * Gets progress of flash rearrangement process - **/ -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, - struct i40e_asq_cmd_details *cmd_details) -{ - enum i40e_status_code status; - struct i40e_aq_desc desc; - - DEBUGFUNC("i40e_aq_nvm_progress"); - - i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_nvm_progress); - status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); - *progress = desc.params.raw[0]; - return status; -} - /** * i40e_aq_get_lldp_mib * @hw: pointer to the hw struct diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h index 91fa23491..9a89f3002 100644 --- a/drivers/net/i40e/base/i40e_prototype.h +++ b/drivers/net/i40e/base/i40e_prototype.h @@ -254,8 +254,10 @@ enum i40e_status_code i40e_aq_update_nvm(struct i40e_hw *hw, u8 module_pointer, enum i40e_status_code i40e_aq_rearrange_nvm(struct i40e_hw *hw, u8 rearrange_nvm, struct i40e_asq_cmd_details *cmd_details); -enum i40e_status_code i40e_aq_nvm_progress(struct i40e_hw *hw, u8 *progress, - struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code +i40e_aq_nvm_update_in_process(struct i40e_hw *hw, + bool update_flow_state, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_get_lldp_mib(struct i40e_hw *hw, u8 bridge_type, u8 mib_type, void *buff, u16 buff_size, u16 *local_len, u16 *remote_len, From patchwork Thu Sep 3 04:48:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76345 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 728C1A04D7; Thu, 3 Sep 2020 06:56:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8A20E1C136; Thu, 3 Sep 2020 06:55:41 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 4D59B1C12B for ; Thu, 3 Sep 2020 06:55:40 +0200 (CEST) IronPort-SDR: PduimtEbO2A7UYpQT4a8H9J2BsE43kYJujZXpZIiqMifzQnUDve3xVKQIQadXdyPuSFOQQX8vq mO2D9asFpq0g== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732246" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732246" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:40 -0700 IronPort-SDR: 0SnrwiBbxogHJuDQZyBsIfwYfDb5YJf0e7sBXtCXy9j0Fa0wgOeJSgoai/BQ1egtl2wRFNslTV 1hGCTljCzLyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349300" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:38 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Przemyslaw Patynowski Date: Thu, 3 Sep 2020 04:48:49 +0000 Message-Id: <20200903044856.61961-9-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 08/15] net/i40e/base: add VLAN field for input set X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add VLAN bit used during flow director programming, as a part of input set for HW. Signed-off-by: Przemyslaw Patynowski Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_type.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/i40e/base/i40e_type.h b/drivers/net/i40e/base/i40e_type.h index cf4134583..c8e7164e1 100644 --- a/drivers/net/i40e/base/i40e_type.h +++ b/drivers/net/i40e/base/i40e_type.h @@ -1926,6 +1926,8 @@ struct i40e_lldp_variables { #define I40E_L4_DST_MASK (0x1ULL << I40E_L4_DST_SHIFT) #define I40E_VERIFY_TAG_SHIFT 31 #define I40E_VERIFY_TAG_MASK (0x3ULL << I40E_VERIFY_TAG_SHIFT) +#define I40E_VLAN_SRC_SHIFT 55 +#define I40E_VLAN_SRC_MASK (0x1ULL << I40E_VLAN_SRC_SHIFT) #define I40E_FLEX_50_SHIFT 13 #define I40E_FLEX_50_MASK (0x1ULL << I40E_FLEX_50_SHIFT) From patchwork Thu Sep 3 04:48:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76346 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9055AA04D7; Thu, 3 Sep 2020 06:56:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EB5421C12F; Thu, 3 Sep 2020 06:55:43 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 374B81C127 for ; Thu, 3 Sep 2020 06:55:42 +0200 (CEST) IronPort-SDR: DrvQMrSiq8otnO/mIXXW5Lu9iW4eS9bmNEMUeX1DPxcT2d7ITJVsaB690NNw3bTMM8o1dch8+Y MEaAxByePTgQ== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732249" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732249" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:41 -0700 IronPort-SDR: zPmAxvTNbGmei0FbvXq8/kadLC4HclOlQ3ddW4cMPXUsin7VLIpMSdEoSlJQs/TkLnhHlmfTLY p82ILLIxTkKQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349304" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:40 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Jesse Brandeburg Date: Thu, 3 Sep 2020 04:48:50 +0000 Message-Id: <20200903044856.61961-10-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 09/15] net/i40e/base: enable pipe monitor thresholds X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Enable several registers and defines for software controlled DCB, particularly around the receive pipe monitor configuration which is necessary to help ports achieve the right throughput under load in several different configurations. Signed-off-by: Jesse Brandeburg Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_register.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/i40e/base/i40e_register.h b/drivers/net/i40e/base/i40e_register.h index ee4f333f9..ee443e9c9 100644 --- a/drivers/net/i40e/base/i40e_register.h +++ b/drivers/net/i40e/base/i40e_register.h @@ -203,6 +203,9 @@ #define I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLU_ERROR_CNT_SHIFT) #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT 24 #define I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_MASK I40E_MASK(0xFF, I40E_VFCM_PE_ERRINFO1_RLS_ERROR_CNT_SHIFT) +#define I40E_PRT_SWR_PM_THR 0x0026CD00 /* Reset: CORER */ +#define I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT 0 +#define I40E_PRT_SWR_PM_THR_THRESHOLD_MASK I40E_MASK(0xFF, I40E_PRT_SWR_PM_THR_THRESHOLD_SHIFT) #define I40E_GLDCB_GENC 0x00083044 /* Reset: CORER */ #define I40E_GLDCB_GENC_PCIRTT_SHIFT 0 #define I40E_GLDCB_GENC_PCIRTT_MASK I40E_MASK(0xFFFF, I40E_GLDCB_GENC_PCIRTT_SHIFT) From patchwork Thu Sep 3 04:48:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76347 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E6B8A04D7; Thu, 3 Sep 2020 06:57:00 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 637CB1C192; Thu, 3 Sep 2020 06:55:47 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 96FE31C18E; Thu, 3 Sep 2020 06:55:44 +0200 (CEST) IronPort-SDR: YUK0lJ2L7f3kQcgPdl2KPdBNDrwmdFHnY1cxrFmfK20/lHRo59eyO1SnjSeiWO423l44ZLiR8M rmkz/P61GGfw== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732252" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732252" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:44 -0700 IronPort-SDR: +nqqdDmKMwsApsEu8U0E3xfyZ2jB+Ep64vlBhekRalS8yW2T8MZUMwFMXSTf0AwqU1LIwkx+pp bWDmvDsejrOw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349312" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:42 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , stable@dpdk.org, Jesse Brandeburg Date: Thu, 3 Sep 2020 04:48:51 +0000 Message-Id: <20200903044856.61961-11-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 10/15] net/i40e/base: fix missing function header arguments X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Some arguments in function headers were forgotten, and found by automated testing. Fix them by adding the argument descriptions. Fixes: 0d9d27bb8684 ("i40e/base: prepare local LLDP MIB in TLV") Cc: stable@dpdk.org Signed-off-by: Jesse Brandeburg Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_dcb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_dcb.c b/drivers/net/i40e/base/i40e_dcb.c index a07c61e67..a5f6dcfe4 100644 --- a/drivers/net/i40e/base/i40e_dcb.c +++ b/drivers/net/i40e/base/i40e_dcb.c @@ -975,6 +975,7 @@ i40e_get_fw_lldp_status(struct i40e_hw *hw, return ret; } + /** * i40e_add_ieee_ets_tlv - Prepare ETS TLV in IEEE format * @tlv: Fill the ETS config data in IEEE format @@ -1267,7 +1268,8 @@ enum i40e_status_code i40e_set_dcb_config(struct i40e_hw *hw) /** * i40e_dcb_config_to_lldp - Convert Dcbconfig to MIB format - * @hw: pointer to the hw struct + * @lldpmib: pointer to mib to be output + * @miblen: pointer to u16 for length of lldpmib * @dcbcfg: store for LLDPDU data * * send DCB configuration to FW From patchwork Thu Sep 3 04:48:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76348 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B3A2AA04D7; Thu, 3 Sep 2020 06:57:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 831231C19B; Thu, 3 Sep 2020 06:55:49 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id B43AA1C191 for ; Thu, 3 Sep 2020 06:55:46 +0200 (CEST) IronPort-SDR: k6flSAKh0JHOzZUWrgGoDKnntoJFcyndu6xPGc6Fgmz7AvFpWlwnjs1r2ZDznzpPZUdSR1w97Y qogssH+SjzeA== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732256" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732256" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:46 -0700 IronPort-SDR: ETydwWG/Mr3Z6esJJPN+1Y/yJQFOyq28u7TRP9HxexP6K5CjYOGKm52mWFOvqYR2UNPl4fsLyr FxUaSirpVjyw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349320" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:44 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Przemyslaw Ciesielski Date: Thu, 3 Sep 2020 04:48:52 +0000 Message-Id: <20200903044856.61961-12-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 11/15] net/i40e/base: add support for Minimum Rollback Revision X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" add support for Minimum Rollback Revision. Signed-off-by: Przemyslaw Ciesielski Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_adminq_cmd.h | 18 +++++++++++++++ drivers/net/i40e/base/i40e_common.c | 29 +++++++++++++++++++++++++ drivers/net/i40e/base/i40e_prototype.h | 4 ++++ 3 files changed, 51 insertions(+) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 9ef01f371..4db8cdd8c 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -241,6 +241,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, i40e_aqc_opc_nvm_update_in_process = 0x0706, + i40e_aqc_opc_rollback_revision_update = 0x0707, i40e_aqc_opc_oem_post_update = 0x0720, i40e_aqc_opc_thermal_sensor = 0x0721, @@ -2419,6 +2420,23 @@ struct i40e_aqc_nvm_config_data_immediate_field { I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); +/* Minimal Rollback Revision Update (direct 0x0707) */ +struct i40e_aqc_rollback_revision_update { + u8 optin_mode; /* bool */ +#define I40E_AQ_RREV_OPTIN_MODE 0x01 + u8 module_selected; +#define I40E_AQ_RREV_MODULE_PCIE_ANALOG 0 +#define I40E_AQ_RREV_MODULE_PHY_ANALOG 1 +#define I40E_AQ_RREV_MODULE_OPTION_ROM 2 +#define I40E_AQ_RREV_MODULE_EMP_IMAGE 3 +#define I40E_AQ_RREV_MODULE_PE_IMAGE 4 + u8 reserved1[2]; + u32 min_rrev; + u8 reserved2[8]; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_rollback_revision_update); + /* OEM Post Update (indirect 0x0720) * no command data struct used */ diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 6c6fb4de4..15f4e91a4 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -3717,6 +3717,35 @@ i40e_aq_nvm_update_in_process(struct i40e_hw *hw, return status; } +/** + * i40e_aq_min_rollback_rev_update - triggers an ow after update + * @hw: pointer to the hw struct + * @mode: opt-in mode, 1b for single module update, 0b for bulk update + * @module: module to be updated. Ignored if mode is 0b + * @min_rrev: value of the new minimal version. Ignored if mode is 0b + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_rollback_revision_update *cmd = + (struct i40e_aqc_rollback_revision_update *)&desc.params.raw; + enum i40e_status_code status; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_rollback_revision_update); + cmd->optin_mode = mode; + cmd->module_selected = module; + cmd->min_rrev = min_rrev; + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + /** * i40e_aq_oem_post_update - triggers an OEM specific flow after update * @hw: pointer to the hw struct diff --git a/drivers/net/i40e/base/i40e_prototype.h b/drivers/net/i40e/base/i40e_prototype.h index 9a89f3002..124222e47 100644 --- a/drivers/net/i40e/base/i40e_prototype.h +++ b/drivers/net/i40e/base/i40e_prototype.h @@ -240,6 +240,10 @@ enum i40e_status_code i40e_aq_write_nvm_config(struct i40e_hw *hw, u8 cmd_flags, void *data, u16 buf_size, u16 element_count, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code +i40e_aq_min_rollback_rev_update(struct i40e_hw *hw, u8 mode, u8 module, + u32 min_rrev, + struct i40e_asq_cmd_details *cmd_details); enum i40e_status_code i40e_aq_oem_post_update(struct i40e_hw *hw, void *buff, u16 buff_size, struct i40e_asq_cmd_details *cmd_details); From patchwork Thu Sep 3 04:48:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76349 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B0BEA04D7; Thu, 3 Sep 2020 06:57:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AF84C1C1A4; Thu, 3 Sep 2020 06:55:51 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 0CA441C11E; Thu, 3 Sep 2020 06:55:48 +0200 (CEST) IronPort-SDR: p9fOnwbF/hvoH0csE9DbD9gKeP4sUSfhdtNilL5XLew9hvSrwwVNxUDJeyZ2iNJm2iiKCQ7cz/ 0BrexIzAaKqQ== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732258" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732258" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:48 -0700 IronPort-SDR: IU8idYP7UtVpKbgknRnoSwMsqOekpK8LPqgJgEn4lbt1DDujyuwzLPabIVueNvxYB6DiujMJbT rbjIIEBvhE7Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349329" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:46 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , stable@dpdk.org, Przemyslaw Patynowski Date: Thu, 3 Sep 2020 04:48:53 +0000 Message-Id: <20200903044856.61961-13-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 12/15] net/i40e/base: fix Rx only mode for unicast promisc on VLAN X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Set promiscuous mode to rx traffic only if VSI has VLANs configured. Rename misleading PROMISC_TX bit to proper name. Added I40E_AQC_SET_VSI_PROMISC_RX_ONLY during VSI unicast promiscuous mode configuration with port VLAN. Aligned unicast promiscuous with VLAN to the one without VLAN. Previously other VFs could listen to unicast tx traffic of other VFs. Fixes: 8db9e2a1b232 ("i40e: base driver") Cc: stable@dpdk.org Signed-off-by: Przemyslaw Patynowski Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_adminq_cmd.h | 2 +- drivers/net/i40e/base/i40e_common.c | 36 +++++++++++++++++++------ 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/drivers/net/i40e/base/i40e_adminq_cmd.h b/drivers/net/i40e/base/i40e_adminq_cmd.h index 4db8cdd8c..d6402a691 100644 --- a/drivers/net/i40e/base/i40e_adminq_cmd.h +++ b/drivers/net/i40e/base/i40e_adminq_cmd.h @@ -1222,7 +1222,7 @@ struct i40e_aqc_set_vsi_promiscuous_modes { #define I40E_AQC_SET_VSI_PROMISC_BROADCAST 0x04 #define I40E_AQC_SET_VSI_DEFAULT 0x08 #define I40E_AQC_SET_VSI_PROMISC_VLAN 0x10 -#define I40E_AQC_SET_VSI_PROMISC_TX 0x8000 +#define I40E_AQC_SET_VSI_PROMISC_RX_ONLY 0x8000 __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 15f4e91a4..cd8b27e40 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -2270,6 +2270,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags, return status; } +/** + * i40e_hw_ver_ge + * @hw: pointer to the hw struct + * @maj: api major value + * @min: api minor value + * + * Assert whether current HW api version is greater/equal than provided. + **/ +static bool i40e_hw_ver_ge(struct i40e_hw *hw, u16 maj, u16 min) +{ + if (hw->aq.api_maj_ver > maj || + (hw->aq.api_maj_ver == maj && hw->aq.api_min_ver >= min)) + return true; + return false; +} + /** * i40e_aq_add_vsi * @hw: pointer to the hw struct @@ -2395,18 +2411,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw, if (set) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; - if (rx_only_promisc && - (((hw->aq.api_maj_ver == 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1))) - flags |= I40E_AQC_SET_VSI_PROMISC_TX; + if (rx_only_promisc && i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); - if (((hw->aq.api_maj_ver >= 1) && (hw->aq.api_min_ver >= 5)) || - (hw->aq.api_maj_ver > 1)) - cmd->valid_flags |= CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_TX); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); @@ -2538,11 +2552,17 @@ enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_set_vsi_promiscuous_modes); - if (enable) + if (enable) { flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + if (i40e_hw_ver_ge(hw, 1, 5)) + flags |= I40E_AQC_SET_VSI_PROMISC_RX_ONLY; + } cmd->promiscuous_flags = CPU_TO_LE16(flags); cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + if (i40e_hw_ver_ge(hw, 1, 5)) + cmd->valid_flags |= + CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_RX_ONLY); cmd->seid = CPU_TO_LE16(seid); cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); From patchwork Thu Sep 3 04:48:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76350 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C5EF2A04D7; Thu, 3 Sep 2020 06:57:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 98C9E1C1AA; Thu, 3 Sep 2020 06:55:52 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id F08081C11E for ; Thu, 3 Sep 2020 06:55:50 +0200 (CEST) IronPort-SDR: HRRIHLlawGcR4iWAaQ8YzzhDSXCTW5DXcU8zP/u9VfTO8w8pLs/XaZjaCx+cUeFPuTR8BSY4v1 7CyDltdVozzw== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732260" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732260" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:50 -0700 IronPort-SDR: ijuF7U5fEwb4PQ/HIE2LdXQ45lskf3VEWgNVvn2FAfpsVAbc40F82hO6U3C2tZYD7a0VzCaqdC tGpJ/UGKP+OA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349337" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:48 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , Dawid Lukwinski Date: Thu, 3 Sep 2020 04:48:54 +0000 Message-Id: <20200903044856.61961-14-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 13/15] net/i40e/base: add EEE LPI status check for X722 adapters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add reading LPI (low power idle) status for supported X722 devices. If adapter's PHY supports EEE in current mode (device ID + link speed), LPI status is read from PHY Clause 45 PCS status register. Signed-off-by: Dawid Lukwinski Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_common.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index cd8b27e40..073634278 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -7098,15 +7098,23 @@ enum i40e_status_code i40e_get_phy_lpi_status(struct i40e_hw *hw, struct i40e_hw_port_stats *stat) { enum i40e_status_code ret = I40E_SUCCESS; + bool eee_mrvl_phy; + bool eee_bcm_phy; u32 val; stat->rx_lpi_status = 0; stat->tx_lpi_status = 0; - if ((hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || - hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && - (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || - hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB)) { + eee_bcm_phy = + (hw->device_id == I40E_DEV_ID_10G_BASE_T_BC || + hw->device_id == I40E_DEV_ID_5G_BASE_T_BC) && + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_2_5GB || + hw->phy.link_info.link_speed == I40E_LINK_SPEED_5GB); + eee_mrvl_phy = + hw->device_id == I40E_DEV_ID_1G_BASE_T_X722; + + if (eee_bcm_phy || eee_mrvl_phy) { + // read Clause 45 PCS Status 1 register ret = i40e_aq_get_phy_register(hw, I40E_AQ_PHY_REG_ACCESS_EXTERNAL, I40E_BCM_PHY_PCS_STATUS1_PAGE, From patchwork Thu Sep 3 04:48:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76351 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 047C1A04D7; Thu, 3 Sep 2020 06:57:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88AED1C1B4; Thu, 3 Sep 2020 06:55:55 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 5B8231C1AF; Thu, 3 Sep 2020 06:55:53 +0200 (CEST) IronPort-SDR: AkdN16sBs3s1tpZhh29uDNvxpiOF1CDdOsnCMVoE2hqRAkdvaZmCsqARUmE8mB0BRfIcQ5arpM Ut8zIIXHXC8g== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732264" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732264" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:53 -0700 IronPort-SDR: 5oF/ycc3IfSuyrKXEC2hauPfkkjasV8Yiv4tWZrWkF2oGh5b3dc+W1PwIX68OdKdv0XJEyE+gy 1RcMjIN9fNfw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349342" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:50 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun , stable@dpdk.org, Galazka Krzysztof Date: Thu, 3 Sep 2020 04:48:55 +0000 Message-Id: <20200903044856.61961-15-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v3 14/15] net/i40e/base: fix PHY config param when enabling EEE X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The i40e_enable_eee function did not copy phy_type_ext field from current PHY configuration retrieved with Get PHY Abilities AQ. It caused a misconfiguration of the PHY on devices supporting 2.5 and 5G speeds and prevented establishing link when only those speeds were selected for advertisement. Fixes: c61bcb0fe1b0 ("net/i40e/base: support Energy Efficient Ethernet") Cc: stable@dpdk.org Signed-off-by: Galazka Krzysztof Signed-off-by: Guinan Sun --- drivers/net/i40e/base/i40e_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c index 073634278..e62d63c68 100644 --- a/drivers/net/i40e/base/i40e_common.c +++ b/drivers/net/i40e/base/i40e_common.c @@ -6449,6 +6449,7 @@ enum i40e_status_code i40e_enable_eee(struct i40e_hw *hw, bool enable) /* Cache current configuration */ config.phy_type = abilities.phy_type; + config.phy_type_ext = abilities.phy_type_ext; config.link_speed = abilities.link_speed; config.abilities = abilities.abilities | I40E_AQ_PHY_ENABLE_ATOMIC_LINK; From patchwork Thu Sep 3 04:48:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76352 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 362D7A04D7; Thu, 3 Sep 2020 06:57:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 782761C1B9; Thu, 3 Sep 2020 06:55:56 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 15D021C1AE for ; Thu, 3 Sep 2020 06:55:54 +0200 (CEST) IronPort-SDR: CQgyuxqUhddz8ovXIqHOzcXKPYO22jfBfjoF9UjNIvhoTY9AluuW9ShB8cfjEknZneYXUfkNOD Q4bexPoyOntA== X-IronPort-AV: E=McAfee;i="6000,8403,9732"; a="221732271" X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="221732271" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Sep 2020 21:55:54 -0700 IronPort-SDR: xZ22poe7bqfOAQ9ucg4jk0vpq0ehHwLPbN1x8VAVD3QBYFTw+0r7KFWSpx4jnlTxyDa6YnuzBC wsHSlMKW+LNw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,385,1592895600"; d="scan'208";a="315349350" Received: from dpdk.sh.intel.com ([10.239.255.12]) by orsmga002.jf.intel.com with ESMTP; 02 Sep 2020 21:55:53 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Jeff Guo , Guinan Sun Date: Thu, 3 Sep 2020 04:48:56 +0000 Message-Id: <20200903044856.61961-16-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200903044856.61961-1-guinanx.sun@intel.com> References: <20200727053451.22214-1-guinanx.sun@intel.com> <20200903044856.61961-1-guinanx.sun@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 15/15] net/i40e/base: update version X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Update base code version in readme. Signed-off-by: Guinan Sun Acked-by: Jeff Guo --- drivers/net/i40e/base/README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/README b/drivers/net/i40e/base/README index 6baca4360..6af299311 100644 --- a/drivers/net/i40e/base/README +++ b/drivers/net/i40e/base/README @@ -6,7 +6,7 @@ IntelĀ® I40E driver ================== This directory contains source code of FreeBSD i40e driver of version -cid-i40e.2020.03.04.tar.gz released by the team which develops +cid-i40e.2020.08.27.tar.gz released by the team which develops basic drivers for any i40e NIC. The directory of base/ contains the original source package. This driver is valid for the product(s) listed below