Skip to content

net/hsr: Use list_head+rcu, better frame dispatch, etc.

Arvid Brodin netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10net/hsr: Better variable names and update of contact info.net/hsr/hsr_device.c net/hsr/hsr_device.h net/hsr/hsr_framereg.c +5 more+304 -3050 replies
2/10net/hsr: Switch from dev_add_pack() to netdev_rx_handler_register()net/hsr/Makefile net/hsr/hsr_device.c net/hsr/hsr_main.c +3 more+283 -2470 replies
3/10net/hsr: Move to per-hsr device prune timer.net/hsr/hsr_device.c net/hsr/hsr_framereg.c net/hsr/hsr_framereg.h +2 more+15 -270 replies
4/10net/hsr: Operstate handling cleanup.net/hsr/hsr_device.c net/hsr/hsr_device.h net/hsr/hsr_main.c+30 -220 replies
5/10net/hsr: Move slave init to hsr_slave.c.net/hsr/hsr_device.c net/hsr/hsr_framereg.c net/hsr/hsr_main.c +3 more+205 -1640 replies
6/10net/hsr: Use list_head (and rcu) instead of array for slave devices.net/hsr/hsr_device.c net/hsr/hsr_framereg.c net/hsr/hsr_framereg.h +6 more+438 -4050 replies
7/10net/hsr: Implemented .ndo_fix_features (better device features handling).net/hsr/hsr_device.c net/hsr/hsr_slave.c+49 -80 replies
8/10net/hsr: Added SET_NETDEV_DEVTYPE and features |= NETIF_F_NETNS_LOCAL to dev_setup.net/hsr/hsr_device.c+11 -30 replies
9/10net/hsr: Better frame dispatchnet/hsr/Makefile net/hsr/hsr_device.c net/hsr/hsr_forward.c +8 more+656 -5860 replies
10/10net/hsr: Fix NULL pointer dereference on incomplete hsr_newlink() params.net/hsr/hsr_netlink.c+6 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 00/10] net/hsr: Use list_head+rcu, better frame dispatch, etc.

This patch series is meant to improve the HSR code in several ways:

* Better code readability.
* In general, make the code structure more like the net/bridge code (HSR operates similarly to a bridge, but uses the HSR-specific frame headers to break up rings, instead of the STP protocol).
* Better handling of HSR ports' net_device features.
* Use list_head and the _rcu list traversing routines instead of array of slave devices.
* Make it easy to support HSR Interlink devices (for future Redbox/Quadbox support).
* Somewhat better throughput on non-HAVE_EFFICIENT_UNALIGNED_ACCESS archs, due to lesser copying of skb data.

The code has been tested in a ring together with other HSR nodes running unchanged code, on both avr32 and x86_64. There should only be one minor change in behaviour from a user perspective:

* Anyone using the Netlink HSR_C_GET_NODE_LIST message to dump the internal node database will notice that the database now also contains the self node.

All patches pass 'checkpatch.pl --ignore CAMELCASE --max-line-length=83 --strict' with only CHECKs, each of which have been deliberately left in place.

The final code passes sparse checks with no output.

Arvid Brodin (10):
net/hsr: Better variable names and update of contact info. net/hsr: Switch from dev_add_pack() to netdev_rx_handler_register() net/hsr: Move to per-hsr device prune timer.
net/hsr: Operstate handling cleanup.
net/hsr: Move slave init to hsr_slave.c.
net/hsr: Use list_head (and rcu) instead of array for slave devices. net/hsr: Implemented .ndo_fix_features (better device features
handling).
net/hsr: Added SET_NETDEV_DEVTYPE and features |= NETIF_F_NETNS_LOCAL
to dev_setup.
net/hsr: Better frame dispatch
net/hsr: Fix NULL pointer dereference on incomplete hsr_newlink()
params.

 net/hsr/Makefile       |   3 +-
 net/hsr/hsr_device.c   | 580 +++++++++++++++++++++----------------------------
 net/hsr/hsr_device.h   |  12 +-
 net/hsr/hsr_forward.c  | 368 +++++++++++++++++++++++++++++++
 net/hsr/hsr_forward.h  |  20 ++
 net/hsr/hsr_framereg.c | 481 ++++++++++++++++++++--------------------
 net/hsr/hsr_framereg.h |  45 ++--
 net/hsr/hsr_main.c     | 425 ++++--------------------------------
 net/hsr/hsr_main.h     |  61 ++++--
 net/hsr/hsr_netlink.c  | 102 +++++----
 net/hsr/hsr_netlink.h  |  11 +-
 net/hsr/hsr_slave.c    | 196 +++++++++++++++++
 net/hsr/hsr_slave.h    |  38 ++++
 13 files changed, 1285 insertions(+), 1057 deletions(-)
 create mode 100644 net/hsr/hsr_forward.c
 create mode 100644 net/hsr/hsr_forward.h
 create mode 100644 net/hsr/hsr_slave.c
 create mode 100644 net/hsr/hsr_slave.h
Signature · 6 lines
1.8.3.2

-- 
Arvid Brodin | Consultant (Linux)
ALTEN | Knarrarnäsgatan 7 | SE-164 40 Kista | Sweden
[email protected] | www.alten.se/en/