linux-stable/drivers/net/ethernet/microchip
Tobias Waldekranz 472111920f net: bridge: switchdev: allow the TX data plane forwarding to be offloaded
Allow switchdevs to forward frames from the CPU in accordance with the
bridge configuration in the same way as is done between bridge
ports. This means that the bridge will only send a single skb towards
one of the ports under the switchdev's control, and expects the driver
to deliver the packet to all eligible ports in its domain.

Primarily this improves the performance of multicast flows with
multiple subscribers, as it allows the hardware to perform the frame
replication.

The basic flow between the driver and the bridge is as follows:

- When joining a bridge port, the switchdev driver calls
  switchdev_bridge_port_offload() with tx_fwd_offload = true.

- The bridge sends offloadable skbs to one of the ports under the
  switchdev's control using skb->offload_fwd_mark = true.

- The switchdev driver checks the skb->offload_fwd_mark field and lets
  its FDB lookup select the destination port mask for this packet.

v1->v2:
- convert br_input_skb_cb::fwd_hwdoms to a plain unsigned long
- introduce a static key "br_switchdev_fwd_offload_used" to minimize the
  impact of the newly introduced feature on all the setups which don't
  have hardware that can make use of it
- introduce a check for nbp->flags & BR_FWD_OFFLOAD to optimize cache
  line access
- reorder nbp_switchdev_frame_mark_accel() and br_handle_vlan() in
  __br_forward()
- do not strip VLAN on egress if forwarding offload on VLAN-aware bridge
  is being used
- propagate errors from .ndo_dfwd_add_station() if not EOPNOTSUPP

v2->v3:
- replace the solution based on .ndo_dfwd_add_station with a solution
  based on switchdev_bridge_port_offload
- rename BR_FWD_OFFLOAD to BR_TX_FWD_OFFLOAD
v3->v4: rebase
v4->v5:
- make sure the static key is decremented on bridge port unoffload
- more function and variable renaming and comments for them:
  br_switchdev_fwd_offload_used to br_switchdev_tx_fwd_offload
  br_switchdev_accels_skb to br_switchdev_frame_uses_tx_fwd_offload
  nbp_switchdev_frame_mark_tx_fwd to nbp_switchdev_frame_mark_tx_fwd_to_hwdom
  nbp_switchdev_frame_mark_accel to nbp_switchdev_frame_mark_tx_fwd_offload
  fwd_accel to tx_fwd_offload

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-07-23 16:32:37 +01:00
..
sparx5 net: bridge: switchdev: allow the TX data plane forwarding to be offloaded 2021-07-23 16:32:37 +01:00
enc28j60.c netdev: pass the stuck queue to the timeout handler 2019-12-12 21:38:57 -08:00
enc28j60_hw.h
encx24j600-regmap.c drivers/net/ethernet: clean up mis-targeted comments 2020-09-25 16:29:00 -07:00
encx24j600.c net: encx24j600: fix kernel-doc syntax in file headers 2021-05-20 15:25:38 -07:00
encx24j600_hw.h net: encx24j600: fix kernel-doc syntax in file headers 2021-05-20 15:25:38 -07:00
Kconfig net: sparx5: add the basic sparx5 driver 2021-06-24 11:28:12 -07:00
lan743x_ethtool.c lan743x: remove redundant intializations of pointers adapter and phydev 2021-03-29 10:56:41 -07:00
lan743x_ethtool.h
lan743x_main.c of: net: pass the dst buffer to of_get_mac_address() 2021-04-13 14:35:02 -07:00
lan743x_main.h lan743x: boost performance on cpu archs w/o dma cache snooping 2021-02-16 15:08:48 -08:00
lan743x_ptp.c lan743x: Added fixed link and RGMII support 2020-06-01 11:51:17 -07:00
lan743x_ptp.h
Makefile net: sparx5: add the basic sparx5 driver 2021-06-24 11:28:12 -07:00