Blame SOURCES/0001-net-mlx4-fix-broadcast-Rx.patch

c7ffa4
From 643958cf910f9d2b6a22307a331834a93722884d Mon Sep 17 00:00:00 2001
c7ffa4
From: Moti Haimovsky <motih@mellanox.com>
c7ffa4
Date: Sun, 28 Jan 2018 11:43:37 +0200
c7ffa4
Subject: [PATCH] net/mlx4: fix broadcast Rx
c7ffa4
c7ffa4
This patch fixes the issue of mlx4 not receiving broadcast packets
c7ffa4
when configured to work promiscuous or allmulticast modes.
c7ffa4
c7ffa4
Fixes: eacaac7bae36 ("net/mlx4: restore promisc and allmulti support")
c7ffa4
Cc: stable@dpdk.org
c7ffa4
c7ffa4
Signed-off-by: Moti Haimovsky <motih@mellanox.com>
c7ffa4
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
c7ffa4
---
c7ffa4
 drivers/net/mlx4/mlx4_flow.c | 16 ++++++++--------
c7ffa4
 1 file changed, 8 insertions(+), 8 deletions(-)
c7ffa4
c7ffa4
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
c7ffa4
index fb84060db..2c6710505 100644
c7ffa4
--- a/drivers/net/mlx4/mlx4_flow.c
c7ffa4
+++ b/drivers/net/mlx4/mlx4_flow.c
c7ffa4
@@ -1223,9 +1223,12 @@ mlx4_flow_internal_next_vlan(struct priv *priv, uint16_t vlan)
c7ffa4
  *
c7ffa4
  * Various flow rules are created depending on the mode the device is in:
c7ffa4
  *
c7ffa4
- * 1. Promiscuous: port MAC + catch-all (VLAN filtering is ignored).
c7ffa4
- * 2. All multicast: port MAC/VLAN + catch-all multicast.
c7ffa4
- * 3. Otherwise: port MAC/VLAN + broadcast MAC/VLAN.
c7ffa4
+ * 1. Promiscuous:
c7ffa4
+ *       port MAC + broadcast + catch-all (VLAN filtering is ignored).
c7ffa4
+ * 2. All multicast:
c7ffa4
+ *       port MAC/VLAN + broadcast + catch-all multicast.
c7ffa4
+ * 3. Otherwise:
c7ffa4
+ *       port MAC/VLAN + broadcast MAC/VLAN.
c7ffa4
  *
c7ffa4
  * About MAC flow rules:
c7ffa4
  *
c7ffa4
@@ -1305,9 +1308,6 @@ mlx4_flow_internal(struct priv *priv, struct rte_flow_error *error)
c7ffa4
 		!priv->dev->data->promiscuous ?
c7ffa4
 		&vlan_spec.tci :
c7ffa4
 		NULL;
c7ffa4
-	int broadcast =
c7ffa4
-		!priv->dev->data->promiscuous &&
c7ffa4
-		!priv->dev->data->all_multicast;
c7ffa4
 	uint16_t vlan = 0;
c7ffa4
 	struct rte_flow *flow;
c7ffa4
 	unsigned int i;
c7ffa4
@@ -1341,7 +1341,7 @@ mlx4_flow_internal(struct priv *priv, struct rte_flow_error *error)
c7ffa4
 			rule_vlan = NULL;
c7ffa4
 		}
c7ffa4
 	}
c7ffa4
-	for (i = 0; i != RTE_DIM(priv->mac) + broadcast; ++i) {
c7ffa4
+	for (i = 0; i != RTE_DIM(priv->mac) + 1; ++i) {
c7ffa4
 		const struct ether_addr *mac;
c7ffa4
 
c7ffa4
 		/* Broadcasts are handled by an extra iteration. */
c7ffa4
@@ -1405,7 +1405,7 @@ mlx4_flow_internal(struct priv *priv, struct rte_flow_error *error)
c7ffa4
 			goto next_vlan;
c7ffa4
 	}
c7ffa4
 	/* Take care of promiscuous and all multicast flow rules. */
c7ffa4
-	if (!broadcast) {
c7ffa4
+	if (priv->dev->data->promiscuous || priv->dev->data->all_multicast) {
c7ffa4
 		for (flow = LIST_FIRST(&priv->flows);
c7ffa4
 		     flow && flow->internal;
c7ffa4
 		     flow = LIST_NEXT(flow, next)) {
c7ffa4
-- 
c7ffa4
2.17.0
c7ffa4