Skip to content

mlxsw: Add support for offloading IPv4 multicast routes

Jiri Pirko netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest12 patches 2 repliesIn review
  2. v212 patches 21 repliesSuperseded
  3. v112 patches 10 repliesSuperseded

Changes in v3 from the cover letter

- Move the ipmr_rule_default function definition to be inside the already existing CONFIG_IP_MROUTE_MULTIPLE_TABLES ifdef block (patch 6)
- Remove double =0 initialization in spectrum_mr.c (patch 7)
- Fix route4 allocation size (patch 7)

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12fib: notifier: Add VIF add and delete event typesinclude/net/fib_notifier.h+2 -00 replies
2/12ipmr: Add reference count to MFC entriesinclude/linux/mroute.h net/ipv4/ipmr.c+26 -30 replies
3/12ipmr: Add FIB notification access functionsinclude/linux/mroute.h include/net/netns/ipv4.h net/ipv4/ipmr.c+153 -20 replies
4/12ipmr: Send FIB notifications on MFC and VIF entriesnet/ipv4/ipmr.c+53 -00 replies
5/12net: ipmr: Add MFC offload indicationinclude/linux/mroute.h net/ipv4/ipmr.c+5 -00 replies
6/12net: mroute: Check if rule is a default ruleinclude/linux/mroute.h net/ipv4/ipmr.c+19 -01 reply
7/12mlxsw: spectrum: Add the multicast routing offloading logicdrivers/net/ethernet/mellanox/mlxsw/Makefile drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c +1 more+1150 -10 replies
8/12mlxsw: spectrum: Add the multicast routing hardware logicdrivers/net/ethernet/mellanox/mlxsw/Makefile drivers/net/ethernet/mellanox/mlxsw/spectrum.h drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c +1 more+873 -10 replies
9/12mlxsw: spectrum: router: Squash the default route table to maindrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+2 -20 replies
10/12mlxsw: spectrum_router: Add multicast routes notification handling functionalitydrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+185 -20 replies
11/12mlxsw: spectrum: Notify multicast router on RIF MTU changesdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+11 -00 replies
12/12mlxsw: spectrum: router: Don't ignore IPMR notificationsdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+2 -10 replies

Reviews trailers per patch

All 12 patches have a Reviewed-by or Acked-by.

PatchIdo SchimmelNikolay Aleksandrov
1/12R-b R-b
2/12R-b R-b
3/12R-b R-b
4/12R-b R-b
5/12R-b R-b
6/12R-b R-b
7/12R-b
8/12R-b
9/12R-b
10/12R-b
11/12R-b
12/12R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [patch net-next v3 00/12] mlxsw: Add support for offloading IPv4 multicast routes

From: Jiri Pirko <[email protected]>

Yotam says:

This patch-set introduces offloading of the kernel IPv4 multicast router logic in the Spectrum driver.

The first patch makes the Spectrum driver ignore FIB notifications that are not of address family IPv4 or IPv6. This is needed in order to prevent crashes while the next patches introduce the RTNL_FAMILY_IPMR FIB notifications.

Patches 2-5 update ipmr to use the FIB notification chain for both MFC and VIF notifications, and patches 8-12 update the Spectrum driver to register to these notifications and offload the routes.

Similarly to IPv4 and IPv6, any failure will trigger the abort mechanism which is updated in this patch-set to eject multicast route tables too.

At this stage, the following limitations apply:
- A multicast MFC route will be offloaded by the driver if all the output interfaces are Spectrum router interfaces (RIFs). In any other case (which includes pimreg device, tunnel devices and management ports) the route will be trapped to the CPU and the packets will be forwarded by software.
- ipmr proxy routes are not supported and will trigger the abort mechanism.
- The MFC TTL values are currently treated as boolean: if the value is different than 255, the traffic is forwarded to the interface and if the value is 255 it is not forwarded. Dropping packets based on their TTL isn't currently supported.

To allow users to have visibility on which of the routes are offloaded and which are not, patch 6 introduces a per-route offload indication similar to IPv4 and IPv6 routes which is sent to the user via the RTNetlink interface.

The Spectrum driver multicast router offloading support, which is introduced in patches 8 and 9, is divided into two parts:
- The hardware logic which abstracts the Spectrum hardware and provides a simple API for the upper levels.
- The offloading logic which gets the MFC and VIF notifications from the kernel and updates the hardware using the hardware logic part.

Finally, the last patch makes the Spectrum router logic not ignore the multicast FIB notifications and call the corresponding functions in the multicast router offloading logic.

---
v2->v3:
- Move the ipmr_rule_default function definition to be inside the already existing CONFIG_IP_MROUTE_MULTIPLE_TABLES ifdef block (patch 6)
- Remove double =0 initialization in spectrum_mr.c (patch 7)
- Fix route4 allocation size (patch 7)
v1->v2:
- Add comments for struct fields in mroute.h
- Take the mrt_lock while dumping VIFs in the fib_notifier dump callback
- Update the MFC lastuse field too

Yotam Gigi (12):
fib: notifier: Add VIF add and delete event types
ipmr: Add reference count to MFC entries
ipmr: Add FIB notification access functions
ipmr: Send FIB notifications on MFC and VIF entries
net: ipmr: Add MFC offload indication
net: mroute: Check if rule is a default rule
mlxsw: spectrum: Add the multicast routing offloading logic
mlxsw: spectrum: Add the multicast routing hardware logic
mlxsw: spectrum: router: Squash the default route table to main
mlxsw: spectrum_router: Add multicast routes notification handling
functionality
mlxsw: spectrum: Notify multicast router on RIF MTU changes
mlxsw: spectrum: router: Don't ignore IPMR notifications

 drivers/net/ethernet/mellanox/mlxsw/Makefile       |    3 +-
 drivers/net/ethernet/mellanox/mlxsw/spectrum.h     |    2 +
 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c  | 1014 ++++++++++++++++++++
 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h  |  133 +++
 .../net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c |  828 ++++++++++++++++
 .../net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.h |   43 +
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  205 +++-
 include/linux/mroute.h                             |   45 +
 include/net/fib_notifier.h                         |    2 +
 include/net/netns/ipv4.h                           |    3 +
 net/ipv4/ipmr.c                                    |  213 +++-
 11 files changed, 2480 insertions(+), 11 deletions(-)
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.h
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.c
 create mode 100644 drivers/net/ethernet/mellanox/mlxsw/spectrum_mr_tcam.h
Signature · 1 line
2.9.5