git: 610b81333f48 - stable/13 - qlnxe: Fix promiscuous and allmulti settings
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 24 Feb 2026 10:45:06 UTC
The branch stable/13 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=610b81333f4816b5906df780cb064526cd8ba1f0
commit 610b81333f4816b5906df780cb064526cd8ba1f0
Author: Keith Reynolds <keith.reynolds@hpe.com>
AuthorDate: 2024-05-28 05:57:44 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2026-02-24 10:15:35 +0000
qlnxe: Fix promiscuous and allmulti settings
PR: 278087
(cherry picked from commit e3ec564ecb9c2daa96a8db36052e50ea554fe598)
(cherry picked from commit e4f48fc20b56df8a03ab63fb867f49bfcc0e7eae)
---
sys/dev/qlnx/qlnxe/qlnx_os.c | 33 ++++++++++++++++++++++-----------
1 file changed, 22 insertions(+), 11 deletions(-)
diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c
index ba9731600b50..64909d39ff59 100644
--- a/sys/dev/qlnx/qlnxe/qlnx_os.c
+++ b/sys/dev/qlnx/qlnxe/qlnx_os.c
@@ -85,8 +85,8 @@ static void qlnx_init_ifnet(device_t dev, qlnx_host_t *ha);
static void qlnx_init(void *arg);
static void qlnx_init_locked(qlnx_host_t *ha);
static int qlnx_set_multi(qlnx_host_t *ha, uint32_t add_multi);
-static int qlnx_set_promisc(qlnx_host_t *ha);
-static int qlnx_set_allmulti(qlnx_host_t *ha);
+static int qlnx_set_promisc(qlnx_host_t *ha, int enabled);
+static int qlnx_set_allmulti(qlnx_host_t *ha, int enabled);
static int qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
static int qlnx_media_change(struct ifnet *ifp);
static void qlnx_media_status(struct ifnet *ifp, struct ifmediareq *ifmr);
@@ -2624,7 +2624,7 @@ qlnx_set_multi(qlnx_host_t *ha, uint32_t add_multi)
}
static int
-qlnx_set_promisc(qlnx_host_t *ha)
+qlnx_set_promisc(qlnx_host_t *ha, int enabled)
{
int rc = 0;
uint8_t filter;
@@ -2633,15 +2633,20 @@ qlnx_set_promisc(qlnx_host_t *ha)
return (0);
filter = ha->filter;
- filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
- filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
+ if (enabled) {
+ filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
+ filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
+ } else {
+ filter &= ~ECORE_ACCEPT_MCAST_UNMATCHED;
+ filter &= ~ECORE_ACCEPT_UCAST_UNMATCHED;
+ }
rc = qlnx_set_rx_accept_filter(ha, filter);
return (rc);
}
static int
-qlnx_set_allmulti(qlnx_host_t *ha)
+qlnx_set_allmulti(qlnx_host_t *ha, int enabled)
{
int rc = 0;
uint8_t filter;
@@ -2650,7 +2655,11 @@ qlnx_set_allmulti(qlnx_host_t *ha)
return (0);
filter = ha->filter;
- filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
+ if (enabled) {
+ filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
+ } else {
+ filter &= ~ECORE_ACCEPT_MCAST_UNMATCHED;
+ }
rc = qlnx_set_rx_accept_filter(ha, filter);
return (rc);
@@ -2714,10 +2723,10 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
if ((ifp->if_flags ^ ha->if_flags) &
IFF_PROMISC) {
- ret = qlnx_set_promisc(ha);
+ ret = qlnx_set_promisc(ha, ifp->if_flags & IFF_PROMISC);
} else if ((ifp->if_flags ^ ha->if_flags) &
IFF_ALLMULTI) {
- ret = qlnx_set_allmulti(ha);
+ ret = qlnx_set_allmulti(ha, ifp->if_flags & IFF_ALLMULTI);
}
} else {
ha->max_frame_size = ifp->if_mtu +
@@ -2727,9 +2736,9 @@ qlnx_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
} else {
if (ifp->if_drv_flags & IFF_DRV_RUNNING)
qlnx_stop(ha);
- ha->if_flags = ifp->if_flags;
}
+ ha->if_flags = ifp->if_flags;
QLNX_UNLOCK(ha);
break;
@@ -7196,9 +7205,11 @@ qlnx_set_rx_mode(qlnx_host_t *ha)
ECORE_ACCEPT_MCAST_MATCHED |
ECORE_ACCEPT_BCAST;
- if (qlnx_vf_device(ha) == 0) {
+ if (qlnx_vf_device(ha) == 0 || (ha->ifp->if_flags & IFF_PROMISC)) {
filter |= ECORE_ACCEPT_UCAST_UNMATCHED;
filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
+ } else if (ha->ifp->if_flags & IFF_ALLMULTI) {
+ filter |= ECORE_ACCEPT_MCAST_UNMATCHED;
}
ha->filter = filter;