[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f5823dfb-4ba7-f32c-d8a3-9b8b7cdb7c5d@blackwall.org>
Date: Tue, 31 Oct 2023 16:29:58 +0200
From: Nikolay Aleksandrov <razor@...ckwall.org>
To: Ido Schimmel <idosch@...dia.com>, netdev@...r.kernel.org
Cc: dsahern@...il.com, stephen@...workplumber.org, mlxsw@...dia.com
Subject: Re: [PATCH iproute2-next] bridge: mdb: Add get support
On 10/30/23 17:46, Ido Schimmel wrote:
> Implement MDB get functionality, allowing user space to query a single
> MDB entry from the kernel instead of dumping all the entries. Example
> usage:
>
> # bridge mdb add dev br0 port swp1 grp 239.1.1.1 vid 10
> # bridge mdb add dev br0 port swp2 grp 239.1.1.1 vid 10
> # bridge mdb add dev br0 port swp2 grp 239.1.1.5 vid 10
> # bridge mdb get dev br0 grp 239.1.1.1 vid 10
> dev br0 port swp1 grp 239.1.1.1 temp vid 10
> dev br0 port swp2 grp 239.1.1.1 temp vid 10
> # bridge -j -p mdb get dev br0 grp 239.1.1.1 vid 10
> [ {
> "index": 10,
> "dev": "br0",
> "port": "swp1",
> "grp": "239.1.1.1",
> "state": "temp",
> "flags": [ ],
> "vid": 10
> },{
> "index": 10,
> "dev": "br0",
> "port": "swp2",
> "grp": "239.1.1.1",
> "state": "temp",
> "flags": [ ],
> "vid": 10
> } ]
> # bridge mdb get dev br0 grp 239.1.1.1 vid 20
> Error: bridge: MDB entry not found.
> # bridge mdb get dev br0 grp 239.1.1.2 vid 10
> Error: bridge: MDB entry not found.
>
> Signed-off-by: Ido Schimmel <idosch@...dia.com>
> ---
> bridge/mdb.c | 99 ++++++++++++++++++++++++++++++++++++++++++++++-
> man/man8/bridge.8 | 35 +++++++++++++++++
> 2 files changed, 133 insertions(+), 1 deletion(-)
>
The patch looks good. One side question below.
Acked-by: Nikolay Aleksandrov <razor@...ckwall.org>
[snip]
> @@ -865,6 +960,8 @@ int do_mdb(int argc, char **argv)
> matches(*argv, "lst") == 0 ||
> matches(*argv, "list") == 0)
> return mdb_show(argc-1, argv+1);
> + if (matches(*argv, "get") == 0)
> + return mdb_get(argc-1, argv+1);
I can't recall if it was agreed to add only strcmp even if the rest uses
matches()?
Powered by blists - more mailing lists