OSDN Git Service

selftests: mlxsw: Add ingress RIF configuration test for 802.1D bridge
authorAmit Cohen <amcohen@nvidia.com>
Wed, 17 Aug 2022 15:28:25 +0000 (17:28 +0200)
committerJakub Kicinski <kuba@kernel.org>
Fri, 19 Aug 2022 03:50:39 +0000 (20:50 -0700)
commit2cd87cea78425e6b019e34e969dc008ce560acbf
treef8d9a273ff4369b0d3f3cccaf8041805e845e749
parenta64bb2b0862302ab63e102a9a63345e6443d1290
selftests: mlxsw: Add ingress RIF configuration test for 802.1D bridge

Before layer 2 forwarding, the device classifies an incoming packet to a
FID. After classification, the FID is known, but also all the attributes of
the FID, such as the router interface (RIF) via which a packet that needs
to be routed will ingress the router block.

For VLAN-unaware bridges (802.1D), the FID classification is done according
to {Port, VID}. When a RIF is added on top of a FID, all the existing
{Port, VID}->FID mappings should be updated by the software with the new
RIF. In addition, when a new mapping is added for FID which already has a
RIF, the correct RIF should be used for it.

Add a test to verify that packets can be routed after {Port, VID}->FID
classification, regardless of the order of the configuration.

 # ./ingress_rif_conf_1d.sh
 TEST: Add RIF for existing {port, VID}->FID mapping                 [ OK ]
 TEST: Add {port, VID}->FID mapping for FID with a RIF               [ OK ]

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/mlxsw/ingress_rif_conf_1d.sh [new file with mode: 0755]