From patchwork Sat Sep 5 02:49:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76592 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 9A212A04C5; Sat, 5 Sep 2020 04:59:50 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7FA0E1C0C2; Sat, 5 Sep 2020 04:59:43 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 7A2862BF1 for ; Sat, 5 Sep 2020 04:59:41 +0200 (CEST) IronPort-SDR: PhFO5PgH5/QsuQIMj++YdGjxBDw3J7f1nVGVDknq8pGcT5C8xhN2wxVzhOCE4t2FzkWcgWw3tv LA4DASblOGyg== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886673" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886673" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:40 -0700 IronPort-SDR: O+rahJElqx3VklGixHPc4Tug6ikXqieOeklJAqr5FkKEgSYG3O2Mp+EqQqtIlq2s/MwlFAcz0z RulyvxkdVMsA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052691" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:38 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , Przemyslaw Patynowski Date: Sat, 5 Sep 2020 02:49:30 +0000 Message-Id: <20200905024938.14609-2-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 1/9] 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 Sat Sep 5 02:49:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76593 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 CEB1BA04C5; Sat, 5 Sep 2020 04:59:59 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C52161C0CE; Sat, 5 Sep 2020 04:59:44 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 5FEA71C0BF for ; Sat, 5 Sep 2020 04:59:43 +0200 (CEST) IronPort-SDR: 4uFZ34uiP5AkIYw/t53vhkMAGK6PdtZ+YvIr/FU13C+eJFYJxlgVlZ5Y2m2HvRp22wv5Il2cgU ilF53mQJcxVA== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886674" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886674" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:43 -0700 IronPort-SDR: bR2T/DyoD0z5DuDupBSTT1cuulCir166qaN4hdChdI3geHDX63JIsRqoMikFTozb6HOBLVYk/L yz+GmTKiNfAA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052704" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:41 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , Jacek Naczyk Date: Sat, 5 Sep 2020 02:49:31 +0000 Message-Id: <20200905024938.14609-3-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 2/9] net/i40e/base: update FW API 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 FW increment API version. Signed-off-by: Jacek Naczyk Signed-off-by: Guinan Sun --- 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 0766e69a8..9ef01f371 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 0x000B +#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 Sat Sep 5 02:49:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76594 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 5C8B9A04C5; Sat, 5 Sep 2020 05:00:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 19CE31C0D5; Sat, 5 Sep 2020 04:59:47 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 6A9D01C0D1 for ; Sat, 5 Sep 2020 04:59:45 +0200 (CEST) IronPort-SDR: lIqn/UFA1xF6cmnFYIBZzODWaHRlTBOA56upCgMBP9UcsKi7kZGfHnI1+TlUCjjPJ8LByW01Oc 1lJbGtd6DgAA== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886675" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886675" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:45 -0700 IronPort-SDR: 0X87ostCIUE0wxQr7K7YM3QNr9TV3FyDz9/UdPvTLev1ua71oO3JpRavjud2UTlc7QQkQd3yqv qMAbhdb69QBg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052712" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:43 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , Jesse Brandeburg Date: Sat, 5 Sep 2020 02:49:32 +0000 Message-Id: <20200905024938.14609-4-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 3/9] 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 Sat Sep 5 02:49:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76595 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 40AB3A04C5; Sat, 5 Sep 2020 05:00:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 64BC31C10A; Sat, 5 Sep 2020 04:59:50 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id D95BC1C0DA; Sat, 5 Sep 2020 04:59:47 +0200 (CEST) IronPort-SDR: LaD4RBNOM3Fg1/JAbiDClTGVwVyG5J5xVD+wYpgaIdetgo5SCGEiTT898L/Cz7H7QQjqR/SX1+ Uf/BzJEhE4Ww== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886689" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886689" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:47 -0700 IronPort-SDR: z7yjn/NWNm0/dH4RFmg0KZW4YXGVjc2JOlrgHkO1k1Vmzq9hwUj9XCoUEWy/Uoa9im+3a75d0M /YCfAPo9ybiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052723" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:45 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , stable@dpdk.org, Jesse Brandeburg Date: Sat, 5 Sep 2020 02:49:33 +0000 Message-Id: <20200905024938.14609-5-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 4/9] 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" 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/i40e/base/i40e_dcb.c b/drivers/net/i40e/base/i40e_dcb.c index a07c61e67..388af3d64 100644 --- a/drivers/net/i40e/base/i40e_dcb.c +++ b/drivers/net/i40e/base/i40e_dcb.c @@ -1267,7 +1267,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 Sat Sep 5 02:49:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76596 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 C9EF5A04C5; Sat, 5 Sep 2020 05:00:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1B9E01C11C; Sat, 5 Sep 2020 04:59:52 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id E74521C0DC for ; Sat, 5 Sep 2020 04:59:49 +0200 (CEST) IronPort-SDR: eKr3mex5wnS7zR7wZBV9SA/ETUprncGQYJxn0C3zunszV0n43MPtqGhidMydbyvOwN/Z/LsGAI msyTF1fXHiew== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886692" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886692" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:49 -0700 IronPort-SDR: QcGMXfWzZPvRD8u4fufvCMKjppAibumUVEmZT8xeefLUMPYmLlzf5KmLIHQY7hEiFzpo7gMBdA /onD05cy8JxQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052728" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:47 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , Przemyslaw Ciesielski Date: Sat, 5 Sep 2020 02:49:34 +0000 Message-Id: <20200905024938.14609-6-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 5/9] 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 Sat Sep 5 02:49:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76597 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 DA19CA04C5; Sat, 5 Sep 2020 05:00:39 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 79C391C124; Sat, 5 Sep 2020 04:59:54 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 38A411C11E; Sat, 5 Sep 2020 04:59:52 +0200 (CEST) IronPort-SDR: bzQVIOeCHKXDT86lzSaRlNdzomrMK1GYpXPILIaE5Es42fURiYcxusKwNfhYP6PklYknIEVCpZ 6HlOHRSbCpog== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886693" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886693" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:51 -0700 IronPort-SDR: vn1oF8llWCtsakmDXauZM2WO81nt4XmWje07FOixGSCOSDMkCmo23Oh9oeq12o6BP70h0dyyh+ SUzeAEvfVLkg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052732" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:49 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , stable@dpdk.org, Przemyslaw Patynowski Date: Sat, 5 Sep 2020 02:49:35 +0000 Message-Id: <20200905024938.14609-7-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 6/9] net/i40e/base: fix Rx only 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 Sat Sep 5 02:49:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76598 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 CDAADA04C5; Sat, 5 Sep 2020 05:00:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BFD681C129; Sat, 5 Sep 2020 04:59:56 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 3BE901C0CD for ; Sat, 5 Sep 2020 04:59:54 +0200 (CEST) IronPort-SDR: OdLNMaqjhjDtsSZ8vF8x0N8wUdKQZT2vUUcajcFUS/QeRV+s5O0ut9HJBVeuGMkRdD2lRd5KTp qQHSdyj11ZcA== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886698" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886698" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:53 -0700 IronPort-SDR: zv0ndZnJcsn20Gjwd+xqGRLp1dIvKG+wVd+uJMBAdBCKO6MMPKgwIiUipwo070oWzw2Spo8ozj /JltNY6Nw/uw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052739" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:52 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , Dawid Lukwinski Date: Sat, 5 Sep 2020 02:49:36 +0000 Message-Id: <20200905024938.14609-8-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 7/9] 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 Sat Sep 5 02:49:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76599 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 01BDAA04C5; Sat, 5 Sep 2020 05:00:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 08A991C131; Sat, 5 Sep 2020 04:59:58 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id AC9561C116; Sat, 5 Sep 2020 04:59:56 +0200 (CEST) IronPort-SDR: OT+/Ih8PnDBT8IlaFL3K5aptUbzWa6zCuOv/KIF2FW2jRomtd0UxRaMiHrFoRCuNY6ke5l6TGt kSQZARKmuXdQ== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886700" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886700" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:56 -0700 IronPort-SDR: oyvulo+kNmtXRxMaSB0uKbICfJGMCUCTeD3K0PLY8h/YdT9GNYHg1RbgrXSi1WgDyBceA3cc2E Z+fyP+tyisAA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052747" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:54 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun , stable@dpdk.org, Galazka Krzysztof Date: Sat, 5 Sep 2020 02:49:37 +0000 Message-Id: <20200905024938.14609-9-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH 8/9] 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 Sat Sep 5 02:49:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 76600 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 4914BA04C5; Sat, 5 Sep 2020 05:01:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6E7891C137; Sat, 5 Sep 2020 05:00:00 +0200 (CEST) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id A5D9A1C134 for ; Sat, 5 Sep 2020 04:59:58 +0200 (CEST) IronPort-SDR: UssJvBryhULw59UQGsu1g1cKsh+XVFtHjYZBThY3Cu5RWiZ99/wV1tnenTYFDARpPJL1DUYopX joAuZL4QE5WA== X-IronPort-AV: E=McAfee;i="6000,8403,9734"; a="137886702" X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="137886702" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Sep 2020 19:59:58 -0700 IronPort-SDR: JMmI2bu5YpsWsHePFSaBehUi4NkO9eKNz5eop5DzUEMxrSReP7gbisPZDJMDiVx77wCfQgQwJa heKIA0au7dUg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,392,1592895600"; d="scan'208";a="406052755" Received: from unknown (HELO localhost.localdomain) ([10.239.255.52]) by fmsmga001.fm.intel.com with ESMTP; 04 Sep 2020 19:59:56 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Beilei Xing , Qi Zhang , Qiming Yang , Guinan Sun Date: Sat, 5 Sep 2020 02:49:38 +0000 Message-Id: <20200905024938.14609-10-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200905024938.14609-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 9/9] 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 --- 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 58174d472..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.07.16.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