From patchwork Sat Sep 12 03:00: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: 77535 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 92450A04C3; Sat, 12 Sep 2020 05:19:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 41A6E1C1BB; Sat, 12 Sep 2020 05:19:34 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id CA235DE0 for ; Sat, 12 Sep 2020 05:19:31 +0200 (CEST) IronPort-SDR: 685edZCd24A+kIdxXbHhComvvl8hCwsiY+CYefyDy4ooG8vR+UQXLy7pghkYnUkp4enJa4MrSV GRDVBPYoplSg== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="158924681" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="158924681" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 20:19:28 -0700 IronPort-SDR: Nfy23o0TuDNBQYISmIXTfRTVBkNQIOtC3EQvm7LkzDevQgRSydlcwBXSMrQW2yWYB3voRulA48 Ioauny9kLxmg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="318465376" Received: from dpdk57.sh.intel.com (HELO localhost.localdomain) ([10.239.255.57]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2020 20:19:26 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Beilei Xing , Guinan Sun , Jacek Naczyk Date: Sat, 12 Sep 2020 03:00:33 +0000 Message-Id: <20200912030039.55273-2-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> <20200912030039.55273-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v2 1/7] 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 for: -NVM FW Lockdown Feature for legacy devices -Security Version Opt-In 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 12 03:00: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: 77536 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 032F0A04C3; Sat, 12 Sep 2020 05:19:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B334B1C1D7; Sat, 12 Sep 2020 05:19:37 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id A1E41DE0; Sat, 12 Sep 2020 05:19:32 +0200 (CEST) IronPort-SDR: DOZVK9HqdE8YcLKxpXUJaWEfr2gfVR2MA9rXoB2xf16gC1TfLYk20g6VB6WbImjxKmRB6/0Ejf sPQ8+NIKZsYA== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="158924684" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="158924684" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 20:19:31 -0700 IronPort-SDR: ohIlD6Chym1A+93HzM/i1bLvbP4+EKivm+aYorH+iZjbPuMzNLa3oA2Mn5GF6HoRA1OD26TcJz ASYBxMypZ1YA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="318465380" Received: from dpdk57.sh.intel.com (HELO localhost.localdomain) ([10.239.255.57]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2020 20:19:29 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Beilei Xing , Guinan Sun , stable@dpdk.org, Jesse Brandeburg Date: Sat, 12 Sep 2020 03:00:34 +0000 Message-Id: <20200912030039.55273-3-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> <20200912030039.55273-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v2 2/7] 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 12 03:00: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: 77538 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 1F154A04C3; Sat, 12 Sep 2020 05:20:02 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4DEFF1C1F5; Sat, 12 Sep 2020 05:19:40 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 6AA60DE0 for ; Sat, 12 Sep 2020 05:19:33 +0200 (CEST) IronPort-SDR: A8TVX2TcWGXfrjSzDF7FDqbARS/83ulCRUzWaOVIlOhc2XifU7F3xxo/dRrKKnfjwuPr+HRp5j sZB7SL44uBgg== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="158924688" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="158924688" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 20:19:33 -0700 IronPort-SDR: Sau4zcAeYcEcEBVJR+8+gE3UHMFkqGvQ+q+a4oUoa+E7XhDZx9AmrXlmqtm4lTY/SQKMqMamzh bQFcn14i7RZw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="318465385" Received: from dpdk57.sh.intel.com (HELO localhost.localdomain) ([10.239.255.57]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2020 20:19:31 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Beilei Xing , Guinan Sun , Przemyslaw Ciesielski Date: Sat, 12 Sep 2020 03:00:35 +0000 Message-Id: <20200912030039.55273-4-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> <20200912030039.55273-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v2 3/7] 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..65831ea7a 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_OPTION_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 12 03:00: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: 77539 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 55845A04C3; Sat, 12 Sep 2020 05:20:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 03C6D1C209; Sat, 12 Sep 2020 05:19:42 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 00F221C1D2; Sat, 12 Sep 2020 05:19:35 +0200 (CEST) IronPort-SDR: mkgkWjUaG3jkbLdZxn8gFH266yx3BeAipIQZzthXBRV4W63E8R0WsjcgyOiLkxYKBzegimhOgm 9DgTHcg0vSVA== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="158924690" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="158924690" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 20:19:35 -0700 IronPort-SDR: zIMWTCeU/zVmfduWewmD+saLLY4kDU41NH0u8O1fQg+C3QiA5WYq0sKFarsFP6aC7I+RzwSu1V tUGtUkQ4+Rfg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="318465391" Received: from dpdk57.sh.intel.com (HELO localhost.localdomain) ([10.239.255.57]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2020 20:19:33 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Beilei Xing , Guinan Sun , stable@dpdk.org, Przemyslaw Patynowski Date: Sat, 12 Sep 2020 03:00:36 +0000 Message-Id: <20200912030039.55273-5-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> <20200912030039.55273-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v2 4/7] 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 65831ea7a..2ca41db5d 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 12 03:00: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: 77540 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 6DE5DA04C3; Sat, 12 Sep 2020 05:20:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D37E91C1E3; Sat, 12 Sep 2020 05:19:49 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 73C011C1D2 for ; Sat, 12 Sep 2020 05:19:37 +0200 (CEST) IronPort-SDR: eq9HT+xLNR4dG/l6mCabCmnlXb44Xrjkcn3SzxPZoSu66l0wX8XWtrbfPirlbeuLZD5sXrNzxo wcW/4Rg/u6vw== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="158924691" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="158924691" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 20:19:37 -0700 IronPort-SDR: bsLLIz8mt4tvmzlO5CEqY/kyNBLnLu9zBxc8zWLAUcFSXY0cBe4YnPuXStVvH3QBAwFG7ESXGL KkP/blMhDoRg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="318465395" Received: from dpdk57.sh.intel.com (HELO localhost.localdomain) ([10.239.255.57]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2020 20:19:35 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Beilei Xing , Guinan Sun , Dawid Lukwinski Date: Sat, 12 Sep 2020 03:00:37 +0000 Message-Id: <20200912030039.55273-6-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> <20200912030039.55273-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v2 5/7] 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..3be944e84 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 12 03:00:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 77541 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 E7AC4A04C3; Sat, 12 Sep 2020 05:20:31 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 30EB21C214; Sat, 12 Sep 2020 05:19:51 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id C75CE1C1F2; Sat, 12 Sep 2020 05:19:39 +0200 (CEST) IronPort-SDR: gEQWVqLRVePNGmgbDoXsvWR8YnCvVNkhU0ufD3J/qqsZvVwfSIRIgdG48OQEUJ1D2+0qvUhbVv q2pXS4vPF9WA== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="158924693" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="158924693" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 20:19:39 -0700 IronPort-SDR: +ogTc872RmsM1rDLAxQJ4wvwdEsMSTZUJy2HGoSu6f+mbZXpZlwLeqIaJYzp74Dlzlb513AlMx yrrlTXXJfCHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="318465400" Received: from dpdk57.sh.intel.com (HELO localhost.localdomain) ([10.239.255.57]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2020 20:19:37 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Beilei Xing , Guinan Sun , stable@dpdk.org, Galazka Krzysztof Date: Sat, 12 Sep 2020 03:00:38 +0000 Message-Id: <20200912030039.55273-7-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> <20200912030039.55273-1-guinanx.sun@intel.com> Subject: [dpdk-dev] [PATCH v2 6/7] 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 3be944e84..8e3db0756 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 12 03:00:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Guinan Sun X-Patchwork-Id: 77542 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 F16E9A04C3; Sat, 12 Sep 2020 05:20:42 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 99FD81C229; Sat, 12 Sep 2020 05:19:52 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 7D2031C1FB for ; Sat, 12 Sep 2020 05:19:41 +0200 (CEST) IronPort-SDR: 1th+Y76UaQMxJZYzCj6VOAnayHYHNBldKrCoWUKBp++9MVm09h0v419OL6Ezhzs5XO+tunPMdi wgJs2SN7p17g== X-IronPort-AV: E=McAfee;i="6000,8403,9741"; a="158924695" X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="158924695" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 20:19:41 -0700 IronPort-SDR: CebIJbowyvIm0e4YV2BK/2MwcZjDNDCujtKO2gYYSKrm0M3JwCi7FswS32JwfCJi6N6f8FNG4y lZMtJBeskdXA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,418,1592895600"; d="scan'208";a="318465405" Received: from dpdk57.sh.intel.com (HELO localhost.localdomain) ([10.239.255.57]) by orsmga002.jf.intel.com with ESMTP; 11 Sep 2020 20:19:39 -0700 From: Guinan Sun To: dev@dpdk.org Cc: Jeff Guo , Beilei Xing , Guinan Sun Date: Sat, 12 Sep 2020 03:00:39 +0000 Message-Id: <20200912030039.55273-8-guinanx.sun@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200912030039.55273-1-guinanx.sun@intel.com> References: <20200905024938.14609-1-guinanx.sun@intel.com> <20200912030039.55273-1-guinanx.sun@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 7/7] 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