Skip to content

Commit

Permalink
ifnet: Remove if_getamcount()
Browse files Browse the repository at this point in the history
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

(cherry picked from commit 408c909)
(cherry picked from commit b513c31)
  • Loading branch information
markjdb authored and gmshake committed Oct 10, 2024
1 parent 3e46d65 commit 66ce3c8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sys/dev/bxe/bxe.c
Original file line number Diff line number Diff line change
Expand Up @@ -12197,7 +12197,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 {
Expand Down
2 changes: 1 addition & 1 deletion sys/dev/liquidio/lio_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ lio_get_new_flags(struct ifnet *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)
Expand Down
6 changes: 0 additions & 6 deletions sys/net/if.c
Original file line number Diff line number Diff line change
Expand Up @@ -4387,12 +4387,6 @@ if_getifaddr(if_t ifp)
return ((struct ifnet *)ifp)->if_addr;
}

int
if_getamcount(if_t ifp)
{
return ((struct ifnet *)ifp)->if_amcount;
}

int
if_setsendqready(if_t ifp)
{
Expand Down
1 change: 0 additions & 1 deletion sys/net/if_var.h
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,6 @@ u_int if_foreach_llmaddr(if_t, iflladdr_cb_t, void *);
u_int if_lladdr_count(if_t);
u_int if_llmaddr_count(if_t);

int if_getamcount(if_t ifp);
struct ifaddr * if_getifaddr(if_t ifp);

/* Functions */
Expand Down

0 comments on commit 66ce3c8

Please sign in to comment.