[Bridge] [RFC PATCH net-next 0/5] Add layer 2 miss indication and filtering

2023-05-09 Thread Ido Schimmel via Bridge
tl;dr = This patchset adds a single bit to the skb to indicate that a packet encountered a layer 2 miss in the bridge and extends flower to match on this metadata. This is required for non-DF (Designated Forwarder) filtering in EVPN multi-homing which prevents decapsulated BUM packets from bei

[Bridge] [RFC PATCH net-next 1/5] skbuff: bridge: Add layer 2 miss indication

2023-05-09 Thread Ido Schimmel via Bridge
Allow the bridge driver to mark packets that did not match a layer 2 entry during forwarding by adding a 'l2_miss' bit to the skb. Clear the bit whenever a packet enters the bridge (received from a bridge port or transmitted via the bridge) and set it if the packet did not match an FDB/MDB entry.

[Bridge] [RFC PATCH net-next 3/5] flow_offload: Reject matching on layer 2 miss

2023-05-09 Thread Ido Schimmel via Bridge
Adjust drivers that support the 'FLOW_DISSECTOR_KEY_META' key to reject filters that try to match on the newly added layer 2 miss option. Add an extack message to clearly communicate the failure reason to user space. Example: # tc filter add dev swp1 egress pref 1 proto all flower skip_sw l2_mis

[Bridge] [RFC PATCH net-next 2/5] net/sched: flower: Allow matching on layer 2 miss

2023-05-09 Thread Ido Schimmel via Bridge
Add the 'TCA_FLOWER_L2_MISS' netlink attribute that allows user space to match on packets that encountered a layer 2 miss. The miss indication is set as metadata in the skb by the bridge driver upon FDB/MDB lookup miss. Signed-off-by: Ido Schimmel --- include/net/flow_dissector.h | 2 ++ includ

[Bridge] [RFC PATCH net-next 5/5] selftests: forwarding: Add layer 2 miss test cases

2023-05-09 Thread Ido Schimmel via Bridge
Add test cases to verify that the bridge driver correctly marks layer 2 misses only when it should and that the flower classifier can match on this metadata. Example output: # ./tc_flower_l2_miss.sh TEST: L2 miss - Unicast [ OK ] TEST: L2 miss - Mult

[Bridge] [RFC PATCH net-next 4/5] mlxsw: spectrum_flower: Add ability to match on layer 2 miss

2023-05-09 Thread Ido Schimmel via Bridge
Add the 'dmac_type' key element to supported key blocks and make use of it to match on layer 2 miss. This is a two bits key in hardware with the following values: 00b - Known multicast. 01b - Broadcast. 10b - Known unicast. 11b - Unknown unicast or unregistered multicast. When 'l2_miss' is set we