From nobody Fri Jun 07 05:49:47 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VwVdl4NzQz5MKv5; Fri, 07 Jun 2024 05:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VwVdl2sw4z4gdW; Fri, 7 Jun 2024 05:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717739387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hf5h2pBVBM/reZetoE0CFOBfekhpQVEB5LEfKXA8x3w=; b=gcEe9hb5PNIZmXpuW5r+4u3Mz9FnC2/J8tSFQ0WSNB+gf89IMOCrAclybVSkSbMXvKazYB kFnwLzONtAFPEf7uSywmw/XKpKNa76LCETOpBLS1dXYda2a/4zWgR91VyC/eKkNnFYBxd4 OM7PjoXO0gbX/PZt9QYnBGE3HddUmsss+2tbo5W7IaflThBj162Hq9zPinGzad/NnO2Zkf W00O486gqabPrEpW5BsHb0caGd97wVpVWP1nZyfTJbtptjWS+jqhxaXgISS9XWBP8A2Wuc ESmZJHAc+ybGzIoTRCoW00/r6hL5jHYCaxogxJEq67H/hpck8FCKhazKG2Dw6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717739387; a=rsa-sha256; cv=none; b=t3X5EMQLBmovXZYah8P0x3IHOTAVgAMUh/Hf1eRqoWsnltGjoZOKLSBnbPbcLcNbrkqfrU WG0zy5X94cg2MM/9FrMdJZVLfpmZLYW2/e/pD90o5nG+OA3KfBP+bEbg5I5SvrcD44Z0Pf gczxptI2KU883CraDDJjI1+Y98LlusQKFFd0i0UqKLW0DHYoXcAo7qqqlSoKw1xLffUikK +zUF6H3dzsjfW4bp+/7byNnGhQTOQeUJPMdk8xh5tXWDuEOgU1Uq+Mv+8mDIbE4ygzjXcs H7Onvb9VzQVWUSh6I6WmCvhR7hCJBzOntEWNirQLs6SooAKKu5e0+3V27293gg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717739387; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Hf5h2pBVBM/reZetoE0CFOBfekhpQVEB5LEfKXA8x3w=; b=QNI6AsSZUi7vsacWYHhmK1UT5DIfA6aztv3eE/0lK67dSk4y6jNdNW3ZHHGR5ch7XnbaWx csTFZvfI084SlL0dDzbw7zx5Y6qAqlakLk5u/qX8aqdZL9MpTfRh/Crtldu9OOVZ/RGS7t Wtlz5WRnxUoD5rdbjbHWVxCk3XNunMVkU//fTuG/tVQqAapRiJFNEE6nKp2lwNf4v5DoPc BEjpSYCin4PWe5kM3IDh47snOC0uNiwrM6e5IqX7Pk5XVgEGYvzXvjXVAdFQZvGnp9yePL +CHK3TDhkzVeF/uB+Fp53RjSuktoQNbzgzR1YxFFgJp8v7yw9mlNdRuXSu9lsw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VwVdl2V8Lz1HLP; Fri, 7 Jun 2024 05:49:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4575nlUM058999; Fri, 7 Jun 2024 05:49:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4575nlFB058996; Fri, 7 Jun 2024 05:49:47 GMT (envelope-from git) Date: Fri, 7 Jun 2024 05:49:47 GMT Message-Id: <202406070549.4575nlFB058996@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kevin Bowling Subject: git: e4f48fc20b56 - stable/14 - qlnxe: Fix promiscuous and allmulti settings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kbowling X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: e4f48fc20b56df8a03ab63fb867f49bfcc0e7eae Auto-Submitted: auto-generated The branch stable/14 has been updated by kbowling: URL: https://cgit.FreeBSD.org/src/commit/?id=e4f48fc20b56df8a03ab63fb867f49bfcc0e7eae commit e4f48fc20b56df8a03ab63fb867f49bfcc0e7eae Author: Keith Reynolds AuthorDate: 2024-05-28 05:57:44 +0000 Commit: Kevin Bowling CommitDate: 2024-06-07 05:48:48 +0000 qlnxe: Fix promiscuous and allmulti settings PR: 278087 (cherry picked from commit e3ec564ecb9c2daa96a8db36052e50ea554fe598) --- 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 0ef3c93580b6..de64aaef1b4c 100644 --- a/sys/dev/qlnx/qlnxe/qlnx_os.c +++ b/sys/dev/qlnx/qlnxe/qlnx_os.c @@ -90,8 +90,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(if_t ifp, u_long cmd, caddr_t data); static int qlnx_media_change(if_t ifp); static void qlnx_media_status(if_t ifp, struct ifmediareq *ifmr); @@ -2595,7 +2595,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; @@ -2604,15 +2604,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; @@ -2621,7 +2626,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); @@ -2689,10 +2698,10 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) { if ((if_getflags(ifp) ^ ha->if_flags) & IFF_PROMISC) { - ret = qlnx_set_promisc(ha); + ret = qlnx_set_promisc(ha, ifp->if_flags & IFF_PROMISC); } else if ((if_getflags(ifp) ^ 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 = if_getmtu(ifp) + @@ -2702,9 +2711,9 @@ qlnx_ioctl(if_t ifp, u_long cmd, caddr_t data) } else { if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) qlnx_stop(ha); - ha->if_flags = if_getflags(ifp); } + ha->if_flags = if_getflags(ifp); QLNX_UNLOCK(ha); break; @@ -7075,9 +7084,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;