Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2024 14:29:01 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 408c909dc64f - main - ifnet: Remove if_getamcount()
Message-ID:  <202409041429.484ET1KY066050@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=408c909dc64f77d2696d6fec77a2e0b00255cf96

commit 408c909dc64f77d2696d6fec77a2e0b00255cf96
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2024-09-04 13:07:11 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2024-09-04 14:28:28 +0000

    ifnet: Remove if_getamcount()
    
    All uses of this function were incorrect.  if_amcount is a reference
    count which tracks the number of times the network stack internally set
    IFF_ALLMULTI.  (if_pcount is the corresponding counter for IFF_PROMISC.)
    
    Remove if_getamcount() and fix up callers to get the number of assigned
    multicast addresses instead, since that's what they actually want.
    
    Sponsored by:   Klara, Inc.
    Reviewed by:    zlei, glebius
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D46523
---
 sys/dev/bxe/bxe.c            | 2 +-
 sys/dev/liquidio/lio_ioctl.c | 2 +-
 sys/net/if.c                 | 6 ------
 sys/net/if_var.h             | 1 -
 4 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/sys/dev/bxe/bxe.c b/sys/dev/bxe/bxe.c
index 26a87354e5b1..3e7120a42a90 100644
--- a/sys/dev/bxe/bxe.c
+++ b/sys/dev/bxe/bxe.c
@@ -12174,7 +12174,7 @@ bxe_set_rx_mode(struct bxe_softc *sc)
     if (if_getflags(ifp) & IFF_PROMISC) {
         rx_mode = BXE_RX_MODE_PROMISC;
     } else if ((if_getflags(ifp) & IFF_ALLMULTI) ||
-               ((if_getamcount(ifp) > BXE_MAX_MULTICAST) &&
+               (if_llmaddr_count(ifp) > BXE_MAX_MULTICAST &&
                 CHIP_IS_E1(sc))) {
         rx_mode = BXE_RX_MODE_ALLMULTI;
     } else {
diff --git a/sys/dev/liquidio/lio_ioctl.c b/sys/dev/liquidio/lio_ioctl.c
index 10c88b209051..b2fd54f59580 100644
--- a/sys/dev/liquidio/lio_ioctl.c
+++ b/sys/dev/liquidio/lio_ioctl.c
@@ -481,7 +481,7 @@ lio_get_new_flags(if_t ifp)
 		 * Accept all multicast addresses if there are more than we
 		 * can handle
 		 */
-		if (if_getamcount(ifp) > LIO_MAX_MULTICAST_ADDR)
+		if (if_llmaddr_count(ifp) > LIO_MAX_MULTICAST_ADDR)
 			f |= LIO_IFFLAG_ALLMULTI;
 	}
 	if (if_getflags(ifp) & IFF_BROADCAST)
diff --git a/sys/net/if.c b/sys/net/if.c
index c71643a41bc5..4458d710d826 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -4780,12 +4780,6 @@ if_getifaddr(const if_t ifp)
 	return (ifp->if_addr);
 }
 
-int
-if_getamcount(const if_t ifp)
-{
-	return (ifp->if_amcount);
-}
-
 int
 if_setsendqready(if_t ifp)
 {
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index e493f8c7951e..cd074e4a8f4e 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -675,7 +675,6 @@ u_int if_lladdr_count(if_t);
 u_int if_llmaddr_count(if_t);
 bool if_maddr_empty(if_t);
 
-int if_getamcount(const if_t ifp);
 struct ifaddr * if_getifaddr(const if_t ifp);
 typedef u_int if_addr_cb_t(void *, struct ifaddr *, u_int);
 u_int if_foreach_addr_type(if_t ifp, int type, if_addr_cb_t cb, void *cb_arg);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409041429.484ET1KY066050>