FreeBSD Bugzilla – Attachment 249622 Details for
Bug 278087
qlnxe: promiscuous and allmulti modes not handled properly [PATCH]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch that fixes the bugs
qlnxe.promisc.patch (text/plain), 3.07 KB, created by
Keith Reynolds
on 2024-04-01 05:44:03 UTC
(
hide
)
Description:
patch that fixes the bugs
Filename:
MIME Type:
Creator:
Keith Reynolds
Created:
2024-04-01 05:44:03 UTC
Size:
3.07 KB
patch
obsolete
>diff --git a/sys/dev/qlnx/qlnxe/qlnx_os.c b/sys/dev/qlnx/qlnxe/qlnx_os.c >index d098694ba19a..b6f1a88d5026 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); >@@ -2630,7 +2630,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; >@@ -2639,15 +2639,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; >@@ -2656,7 +2661,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); >@@ -2720,10 +2729,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 + >@@ -2733,9 +2742,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; > >@@ -7191,9 +7200,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; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 278087
: 249622