On 10/18/23 10:04, Johannes Nixdorf wrote:
Support setting the FDB limit through ip link. The arguments is:
  - fdb_max_learned: A 32-bit unsigned integer specifying the maximum
                     number of learned FDB entries, with 0 disabling
                     the limit.

Also support reading back the current number of learned FDB entries in
the bridge by this count. The returned value's name is:
  - fdb_n_learned: A 32-bit unsigned integer specifying the current number
                   of learned FDB entries.

Example:

  # ip -d -j -p link show br0
[ {
...
         "linkinfo": {
             "info_kind": "bridge",
             "info_data": {
...
                 "fdb_n_learned": 2,
                 "fdb_max_learned": 0,
...
             }
         },
...
     } ]
  # ip link set br0 type bridge fdb_max_learned 1024
  # ip -d -j -p link show br0
[ {
...
         "linkinfo": {
             "info_kind": "bridge",
             "info_data": {
...
                 "fdb_n_learned": 2,
                 "fdb_max_learned": 1024,
...
             }
         },
...
     } ]

Signed-off-by: Johannes Nixdorf <jnixdorf-...@avm.de>
---
The corresponding kernel changes are in net-next.git as commit
ddd1ad68826d ("net: bridge: Add netlink knobs for number / max learned
FDB entries").
---
Changes in v5:
  - Removed the RFC status again, as the kernel changes landed.
  - Link to v4: 
https://lore.kernel.org/r/20230919-fdb_limit-v4-1-b4d2dc4df...@avm.de

Changes in v4:
  - Removed _entries from the names. (from review)
  - Removed the UAPI change, to be synced from linux separately by the
    maintainer. (from review)
    For local testing e.g. `make CCOPTS="-O2 -pipe
    -I${path_to_dev_kernel_headers}"` works as a workaround.
  - Downgraded to an RFC until the kernel changes land.
  - Link to v3: 
https://lore.kernel.org/netdev/20230905-fdb_limit-v3-1-34bb12455...@avm.de/

Changes in v3:
  - Properly split the net-next and iproute2-next threads. (from review)
  - Changed to *_n_* instead of *_cur_*. (from review)
  - Use strcmp() instead of matches(). (from review)
  - Made names in code and documentation consistent. (from review)
  - Various documentation fixes. (from review)
  - Link to v2: 
https://lore.kernel.org/netdev/20230619071444.14625-1-jnixdorf-...@avm.de/

Changes in v2:
  - Sent out the first corresponding iproute2 patches.
  - Link to v1: 
https://lore.kernel.org/netdev/20230515085046.4457-1-jnixdorf-...@avm.de/
---
  ip/iplink_bridge.c    | 21 +++++++++++++++++++++
  man/man8/ip-link.8.in | 10 ++++++++++
  2 files changed, 31 insertions(+)


Acked-by: Nikolay Aleksandrov <ra...@blackwall.org>


Reply via email to