[dpdk-stable] patch 'net/i40e/base: fix Rx only for unicast promisc on VLAN' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:43:09 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 4b0dfbac70b79c215c89ced4bc66565b4f2d565c Mon Sep 17 00:00:00 2001
From: Guinan Sun <guinanx.sun at intel.com>
Date: Sat, 12 Sep 2020 03:00:36 +0000
Subject: [PATCH] net/i40e/base: fix Rx only for unicast promisc on VLAN

[ upstream commit 2972fc3f4000108cf48b49389851278abb35425a ]

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")

Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski at intel.com>
Signed-off-by: Guinan Sun <guinanx.sun at intel.com>
Acked-by: Qi Zhang <qi.z.zhang at 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 cd7f24cf14..48f93313bd 100644
--- a/drivers/net/i40e/base/i40e_adminq_cmd.h
+++ b/drivers/net/i40e/base/i40e_adminq_cmd.h
@@ -1215,7 +1215,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 2172ea12fc..f179306e2e 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -2222,6 +2222,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
@@ -2347,18 +2363,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);
@@ -2490,11 +2504,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.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:12.724760888 +0000
+++ 0030-net-i40e-base-fix-Rx-only-for-unicast-promisc-on-VLA.patch	2020-10-28 10:35:11.468829494 +0000
@@ -1,8 +1,10 @@
-From 2972fc3f4000108cf48b49389851278abb35425a Mon Sep 17 00:00:00 2001
+From 4b0dfbac70b79c215c89ced4bc66565b4f2d565c Mon Sep 17 00:00:00 2001
 From: Guinan Sun <guinanx.sun at intel.com>
 Date: Sat, 12 Sep 2020 03:00:36 +0000
 Subject: [PATCH] net/i40e/base: fix Rx only for unicast promisc on VLAN
 
+[ upstream commit 2972fc3f4000108cf48b49389851278abb35425a ]
+
 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
@@ -11,7 +13,6 @@
 Previously other VFs could listen to unicast tx traffic of other VFs.
 
 Fixes: 8db9e2a1b232 ("i40e: base driver")
-Cc: stable at dpdk.org
 
 Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski at intel.com>
 Signed-off-by: Guinan Sun <guinanx.sun at intel.com>
@@ -22,10 +23,10 @@
  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 65831ea7ab..2ca41db5d3 100644
+index cd7f24cf14..48f93313bd 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 {
+@@ -1215,7 +1215,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
@@ -35,10 +36,10 @@
  #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 15f4e91a40..cd8b27e407 100644
+index 2172ea12fc..f179306e2e 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,
+@@ -2222,6 +2222,22 @@ enum i40e_status_code i40e_aq_set_phy_debug(struct i40e_hw *hw, u8 cmd_flags,
  	return status;
  }
  
@@ -61,7 +62,7 @@
  /**
   * 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,
+@@ -2347,18 +2363,16 @@ enum i40e_status_code i40e_aq_set_vsi_unicast_promiscuous(struct i40e_hw *hw,
  
  	if (set) {
  		flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST;
@@ -85,7 +86,7 @@
  
  	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,
+@@ -2490,11 +2504,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);
  


More information about the stable mailing list