[PATCH dpdk v4] net/tap: add software MAC address filtering
Stephen Hemminger
stephen at networkplumber.org
Mon Mar 23 19:52:53 CET 2026
On Mon, 23 Mar 2026 09:42:42 +0100
Robin Jarry <rjarry at redhat.com> wrote:
> Linux TAP devices deliver all packets to userspace regardless of the
> PROMISC/ALLMULTI flags on the interface. When promiscuous mode is
> disabled, drop received packets whose destination MAC does not match
> any configured unicast or multicast address.
>
> The receive path checks the destination MAC against the device's
> unicast address table (managed by the ethdev layer), the multicast
> address list (stored by the driver since the ethdev layer does not keep
> a copy), and accepts broadcast unconditionally. Promiscuous and
> all-multicast modes bypass the respective checks.
>
> To support multiple unicast addresses via rte_eth_dev_mac_addr_add(),
> allocate mac_addrs with rte_zmalloc (TAP_MAX_MAC_ADDRS=16) instead of
> pointing into dev_private, and advertise the new limit in dev_infos_get.
>
> Add a test to ensure it works as expected.
>
> Signed-off-by: Robin Jarry <rjarry at redhat.com>
> ---
Good to see test but:
- test should the TEST_ASSERT macros to keep things smaller.
- tests must test return value of functions during setup and normal teardown.
(i.e promiscious_disable, all mullticast_disable)
- there are helpers to inject packet already in the tap test.
would that work?
More information about the dev
mailing list