public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Robin Jarry <rjarry@redhat.com>
Cc: dev@dpdk.org
Subject: Re: [PATCH dpdk v3] net/tap: add software MAC address filtering
Date: Sat, 21 Mar 2026 10:06:24 -0700	[thread overview]
Message-ID: <20260321100624.601e64e1@phoenix.local> (raw)
In-Reply-To: <20260321144840.863746-2-rjarry@redhat.com>

On Sat, 21 Mar 2026 15:48:40 +0100
Robin Jarry <rjarry@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.
> 
> Dropped packets are reported via per-queue xstats
> (rx_q<N>_mac_filter_drops).
> 
> Signed-off-by: Robin Jarry <rjarry@redhat.com>

Not sure the xstat for mac_filter_drops is needed, since it is what
other devices do as normal operation.

AI review found:

Two issues worth addressing in this patch.
The rte_realloc call in tap_set_mc_addr_list assigns directly back to
pmd->mc_addrs. When realloc fails it returns NULL but leaves the
original allocation intact, so the old pointer is lost and the memory
leaks. Use a temporary variable for the realloc result.

The ops table sets .xstats_reset = tap_stats_reset, but that function
only zeroes the base counters. The new mac_drops xstat is never reset.
Either extend the existing reset or add a dedicated xstats reset
function.

  reply	other threads:[~2026-03-21 17:06 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-19 22:10 [PATCH dpdk] net/tap: add software MAC address filtering Robin Jarry
2026-03-19 22:43 ` Stephen Hemminger
2026-03-20  8:26   ` Robin Jarry
2026-03-20 10:10 ` Morten Brørup
2026-03-20 16:45 ` [PATCH dpdk v2] " Robin Jarry
2026-03-21  2:58   ` Stephen Hemminger
2026-03-21  5:48     ` Morten Brørup
2026-03-21 14:48 ` [PATCH dpdk v3] " Robin Jarry
2026-03-21 17:06   ` Stephen Hemminger [this message]
2026-03-21 23:20   ` Stephen Hemminger
2026-03-23  8:42 ` [PATCH dpdk v4] " Robin Jarry
2026-03-23 18:52   ` Stephen Hemminger
2026-03-24 19:09 ` [PATCH dpdk v5] " Robin Jarry
2026-03-25 16:40   ` Stephen Hemminger
2026-03-26  9:15     ` Robin Jarry

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260321100624.601e64e1@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=rjarry@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox