[PATCH grout] infra: fix promisc mode drop because of MAC table overflow
Andrei Rybchenko
rybchenko.andrei at gmail.com
Thu Sep 10 14:39:56 CEST 2026
When MAC table overflow happens, promiscuous mode is automatically
enabled and disalbed back when all MACs fit in the table. However,
it should not happen if the promiscuous mode is enabled by user.
Fixes: 9cb3af940f84 ("port: simplify secondary mac management")
Signed-off-by: Andrei Rybchenko <rybchenko.andrei at gmail.com>
---
modules/infra/control/port.c | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/modules/infra/control/port.c b/modules/infra/control/port.c
index d335f3af..2bb6f802 100644
--- a/modules/infra/control/port.c
+++ b/modules/infra/control/port.c
@@ -702,12 +702,17 @@ static int port_mac_add(struct iface *iface, struct iface_mac *m) {
ret = 0;
if ((iface->state & GR_IFACE_S_PROMISC_FIXED) == 0) {
- ret = rte_eth_promiscuous_enable(port->port_id);
- if (ret == 0) {
- LOG(INFO, "%s: enabled promisc", iface->name);
+ if (iface->user_promisc) {
+ LOG(INFO, "%s: already enabled promisc", iface->name);
iface->state |= GR_IFACE_S_PROMISC_FIXED;
} else {
- LOG(INFO, "%s: %s", iface->name, rte_strerror(-ret));
+ ret = rte_eth_promiscuous_enable(port->port_id);
+ if (ret == 0) {
+ LOG(INFO, "%s: enabled promisc", iface->name);
+ iface->state |= GR_IFACE_S_PROMISC_FIXED;
+ } else {
+ LOG(INFO, "%s: %s", iface->name, rte_strerror(-ret));
+ }
}
}
}
@@ -744,15 +749,20 @@ static int port_mac_del(struct iface *iface, struct iface_mac *m) {
}
if (disable_promisc) {
- ret = rte_eth_promiscuous_disable(port->port_id);
- if (ret < 0 && ret != -ENOTSUP) {
- LOG(NOTICE,
- "%s: promisc disable: %s",
- iface->name,
- rte_strerror(-ret));
- } else {
- LOG(INFO, "%s: disabled promisc", iface->name);
+ if (iface->user_promisc) {
+ LOG(INFO, "%s: keep promisc enabled", iface->name);
iface->state &= ~GR_IFACE_S_PROMISC_FIXED;
+ } else {
+ ret = rte_eth_promiscuous_disable(port->port_id);
+ if (ret < 0 && ret != -ENOTSUP) {
+ LOG(NOTICE,
+ "%s: promisc disable: %s",
+ iface->name,
+ rte_strerror(-ret));
+ } else {
+ LOG(INFO, "%s: disabled promisc", iface->name);
+ iface->state &= ~GR_IFACE_S_PROMISC_FIXED;
+ }
}
}
}
--
2.47.3
More information about the grout
mailing list