patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH v2 5/8] net/i40e/base: fix possible uninitialized variable
       [not found] ` <20200727053451.22214-1-guinanx.sun@intel.com>
@ 2020-07-27  5:34   ` Guinan Sun
  2020-07-27  6:45     ` Jeff Guo
       [not found]   ` <20200903044856.61961-1-guinanx.sun@intel.com>
  1 sibling, 1 reply; 6+ messages in thread
From: Guinan Sun @ 2020-07-27  5:34 UTC (permalink / raw)
  To: dev; +Cc: Beilei Xing, Jeff Guo, Guinan Sun, stable, Adam Ludkiewicz

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 <adam.ludkiewicz@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
V2:
* Modify commit message.
---
 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;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-stable] [PATCH v2 5/8] net/i40e/base: fix possible uninitialized variable
  2020-07-27  5:34   ` [dpdk-stable] [PATCH v2 5/8] net/i40e/base: fix possible uninitialized variable Guinan Sun
@ 2020-07-27  6:45     ` Jeff Guo
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Guo @ 2020-07-27  6:45 UTC (permalink / raw)
  To: Guinan Sun, dev; +Cc: Beilei Xing, stable, Adam Ludkiewicz

Acked-by: Jeff Guo<jia.guo@intel.com>

On 7/27/2020 1:34 PM, Guinan Sun wrote:
> 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 <adam.ludkiewicz@intel.com>
> Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
> ---
> V2:
> * Modify commit message.
> ---
>   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;

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH v3 05/15] net/i40e/base: fix possible uninitialized variable
       [not found]   ` <20200903044856.61961-1-guinanx.sun@intel.com>
@ 2020-09-03  4:48     ` " Guinan Sun
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 10/15] net/i40e/base: fix missing function header arguments Guinan Sun
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Guinan Sun @ 2020-09-03  4:48 UTC (permalink / raw)
  To: dev; +Cc: Beilei Xing, Jeff Guo, Guinan Sun, stable, Adam Ludkiewicz

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 <adam.ludkiewicz@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
Acked-by: Jeff Guo <jia.guo@intel.com>
---
 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;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH v3 10/15] net/i40e/base: fix missing function header arguments
       [not found]   ` <20200903044856.61961-1-guinanx.sun@intel.com>
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 05/15] " Guinan Sun
@ 2020-09-03  4:48     ` Guinan Sun
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 12/15] net/i40e/base: fix Rx only mode for unicast promisc on VLAN Guinan Sun
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 14/15] net/i40e/base: fix PHY config param when enabling EEE Guinan Sun
  3 siblings, 0 replies; 6+ messages in thread
From: Guinan Sun @ 2020-09-03  4:48 UTC (permalink / raw)
  To: dev; +Cc: Beilei Xing, Jeff Guo, Guinan Sun, stable, Jesse Brandeburg

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 <jesse.brandeburg@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 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
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH v3 12/15] net/i40e/base: fix Rx only mode for unicast promisc on VLAN
       [not found]   ` <20200903044856.61961-1-guinanx.sun@intel.com>
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 05/15] " Guinan Sun
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 10/15] net/i40e/base: fix missing function header arguments Guinan Sun
@ 2020-09-03  4:48     ` Guinan Sun
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 14/15] net/i40e/base: fix PHY config param when enabling EEE Guinan Sun
  3 siblings, 0 replies; 6+ messages in thread
From: Guinan Sun @ 2020-09-03  4:48 UTC (permalink / raw)
  To: dev; +Cc: Beilei Xing, Jeff Guo, Guinan Sun, stable, Przemyslaw Patynowski

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 <przemyslawx.patynowski@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 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);
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-stable] [PATCH v3 14/15] net/i40e/base: fix PHY config param when enabling EEE
       [not found]   ` <20200903044856.61961-1-guinanx.sun@intel.com>
                       ` (2 preceding siblings ...)
  2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 12/15] net/i40e/base: fix Rx only mode for unicast promisc on VLAN Guinan Sun
@ 2020-09-03  4:48     ` Guinan Sun
  3 siblings, 0 replies; 6+ messages in thread
From: Guinan Sun @ 2020-09-03  4:48 UTC (permalink / raw)
  To: dev; +Cc: Beilei Xing, Jeff Guo, Guinan Sun, stable, Galazka Krzysztof

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 <krzysztof.galazka@intel.com>
Signed-off-by: Guinan Sun <guinanx.sun@intel.com>
---
 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;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20200721074000.30449-1-guinanx.sun@intel.com>
     [not found] ` <20200727053451.22214-1-guinanx.sun@intel.com>
2020-07-27  5:34   ` [dpdk-stable] [PATCH v2 5/8] net/i40e/base: fix possible uninitialized variable Guinan Sun
2020-07-27  6:45     ` Jeff Guo
     [not found]   ` <20200903044856.61961-1-guinanx.sun@intel.com>
2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 05/15] " Guinan Sun
2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 10/15] net/i40e/base: fix missing function header arguments Guinan Sun
2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 12/15] net/i40e/base: fix Rx only mode for unicast promisc on VLAN Guinan Sun
2020-09-03  4:48     ` [dpdk-stable] [PATCH v3 14/15] net/i40e/base: fix PHY config param when enabling EEE Guinan Sun

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox