Netdev List
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: Ben Greear <greearb@candelatech.com>
Cc: John-Paul Powers <john-paul.powers@candelatech.com>,
	netdev <netdev@vger.kernel.org>
Subject: Re: Using VRF to limit 'ip monitor' and 'iw event' messages
Date: Mon, 18 May 2026 20:59:29 -0600	[thread overview]
Message-ID: <ccbe47f5-5895-4db4-a472-1288a55a2b50@kernel.org> (raw)
In-Reply-To: <e89dd0e7-3eaf-6385-7cfa-5f0079fabc96@candelatech.com>

On 5/18/26 3:51 PM, Ben Greear wrote:
> Hello David,
> 
> We are interested in filtering out iw and ip netlink events for
> processes bound
> to VRFs.

are you trying to filter out the events kernel side or in `ip monitor`?


> 
> For instance, Chromium starts spewing errors when we try to run it on a
> system with many
> network interfaces, we guess because it is being confused by all of the
> other network devices
> going up and down.
> 
> I think the crux of the problem is to know if a netlink listener socket
> is bound
> to a VRF or not, and also to know if the generator of the message is
> bound to
> a particular VRF.

so you are running `ip vrf exec` on ip monitor? ie., how is the netlink
socket getting bound to a device?

VRF is only a Layer 3 construct, and a netlink socket is not AF_INET or
AF_INET6.

> 
> Do you have any suggestions for how we might go about this?  We'll be
> happy to post
> the resulting patches for consideration to be included upstream.

You could add try a filter in `ip monitor` that looks at the device
index and only emit a message if "sk_bound_dev_if == N" where N is 0 for
default VRF or the VRF device ifindex. From there, you would have to
parse the message, identify the dump type, find the netdevice attribute
and then figure out if it is a VRF device or a port of a VRF device.
Going to be complicated.

Kernel side, netlink layer has no knowledge of the attributes, so I
don't see how a filter could work at that layer.

This reminds of the kind of filtering (ie., fine details) that Jamal
wanted to do for tc. Kind of hard to do given the various layers.

  reply	other threads:[~2026-05-19  2:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 21:51 Using VRF to limit 'ip monitor' and 'iw event' messages Ben Greear
2026-05-19  2:59 ` David Ahern [this message]
2026-05-19 14:04   ` Ben Greear
2026-05-20  0:15     ` David Ahern
2026-05-20 21:47       ` Ben Greear

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=ccbe47f5-5895-4db4-a472-1288a55a2b50@kernel.org \
    --to=dsahern@kernel.org \
    --cc=greearb@candelatech.com \
    --cc=john-paul.powers@candelatech.com \
    --cc=netdev@vger.kernel.org \
    /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