Thread (14 messages) 14 messages, 3 authors, 2025-06-09

Re: [PATCH iproute2-next 3/4] lib: bridge: Add a module for bridge-related helpers

From: Petr Machata <petrm@nvidia.com>
Date: 2025-06-09 11:52:53

Nikolay Aleksandrov [off-list ref] writes:
On 6/6/25 18:04, Petr Machata wrote:
quoted
`ip stats' displays a range of bridge_slave-related statistics, but not
the VLAN stats. `bridge vlan' actually has code to show these. Extract the
code to libutil so that it can be reused between the bridge and ip stats
tools.
Rename them reasonably so as not to litter the global namespace.
Signed-off-by: Petr Machata <petrm@nvidia.com>
---
  bridge/vlan.c    | 50 +++++-------------------------------------------
  include/bridge.h | 11 +++++++++++
  lib/Makefile     |  3 ++-
  lib/bridge.c     | 47 +++++++++++++++++++++++++++++++++++++++++++++
  4 files changed, 65 insertions(+), 46 deletions(-)
  create mode 100644 include/bridge.h
  create mode 100644 lib/bridge.c
lol, Ido didn't we just have a discussion in another thread about adding
a bridge lib? :-)

https://www.spinics.net/lists/netdev/msg1096403.html

I'm not strictly against adding a lib, I think this approach might
actually save us from the tools going out of sync and we can avoid
repeating to people they have to update both places when they forget.
Fun. I really think reuse is better in this case. Or, you know, by and
large. But particularly having both bridge and ip stats give the data
with the same structure is valuable. But y'all's call.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help