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