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
This commit is contained in:
Mark Johnston 2024-09-04 13:07:11 +00:00
parent 41ece3c036
commit 408c909dc6
4 changed files with 2 additions and 9 deletions

View File

@ -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 {

View File

@ -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)

View File

@ -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)
{

View File

@ -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);