All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: "Linus Lüssing" <linus.luessing@c0d3.blue>
Cc: bridge@lists.linux-foundation.org
Subject: Re: [Bridge] Getting + maintaining a consistent MDB view in userspace?
Date: Mon, 7 Aug 2023 18:20:51 -0700	[thread overview]
Message-ID: <20230807182051.47d4d613@hermes.local> (raw)
In-Reply-To: <ZNGMVUNsZWWUd7so@sellars>

On Tue, 8 Aug 2023 02:29:09 +0200
Linus Lüssing <linus.luessing@c0d3.blue> wrote:

> Hi,
> 
> Is there a recommended way to get and monitor the MDB state from
> userspace, without potential synchronization races?
> 
> I can use "bridge monitor mdb" to get changes or "bridge mdb show"
> to get the current state (as well as use the underlying netlink
> calls from my own application without the "bridge" command).
> 
> But if I were first calling "bridge mdb show" and then "bridge
> monitor mdb" then there is a brief moment where I might miss some
> changes. Or if I were doing it the other way around then a change
> might wrongly override a valid entry? Or the full dump might not
> be as up to date as the change event I got before?
> 
> Ideally I'd be looking for a variant of "bridge monitor mdb" which
> first dumps the whole, consistent mdb state and after that
> provides updates in the correct order.
> 
> Regards, Linus

Same issue as dumping routing table which routing daemons deal with.
Most applications end up with two netlink sockets, one for monitor
and one for dumping.

You really can't do it from the bridge utility, need to build your
own tools.

  reply	other threads:[~2023-08-08  1:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  0:29 [Bridge] Getting + maintaining a consistent MDB view in userspace? Linus Lüssing
2023-08-08  1:20 ` Stephen Hemminger [this message]
2023-08-09 22:56   ` Linus Lüssing
2023-08-10  2:07     ` Linus Lüssing

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=20230807182051.47d4d613@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=bridge@lists.linux-foundation.org \
    --cc=linus.luessing@c0d3.blue \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.