OSDN Git Service

vdpa/mlx5: Add RX MAC VLAN filter support
authorEli Cohen <elic@nvidia.com>
Mon, 11 Apr 2022 12:29:42 +0000 (15:29 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 1 Jun 2022 06:16:38 +0000 (02:16 -0400)
commitbaf2ad3f6a985354293e371b9ba12b162d639e29
tree3121f923174ffa484ad341fd50b4248e8bdf0ce0
parent7becdd13b640a6f91219ae3f201afa03ed67876b
vdpa/mlx5: Add RX MAC VLAN filter support

Support HW offloaded filtering of MAC/VLAN packets.
To allow that, we add a handler to handle VLAN configurations coming
through the control VQ. Two operations are supported.

1. Adding VLAN - in this case, an entry will be added to the RX flow
   table that will allow the combination of the MAC/VLAN to be
   forwarded to the TIR.
2. Removing VLAN - will remove the entry from the flow table,
   effectively blocking such packets from going through.

Currently the control VQ does not propagate changes to the MAC of the
VLAN device so we always use the MAC of the parent device.

Examples:
1. Create vlan device:
$ ip link add link ens1 name ens1.8 type vlan id 8

Signed-off-by: Eli Cohen <elic@nvidia.com>
Message-Id: <20220411122942.225717-4-elic@nvidia.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Jason Wang <jasowang@redhat.com>
drivers/vdpa/mlx5/net/mlx5_vnet.c