[PATCH iwl-next v4 0/6] ice: LLDP support for VFs

Larysa Zaremba
2025-02-14T09:08:52Z

Allow to:
* receive LLDP packets on a VF in legacy mode
* receive LLDP packets on a VF in switchdev mode
* transmit LLDP from a VF in switchdev mode

Many VSIs can receive LLDP packets, but only one VSI
per port can transmit LLDP, therefore LLDP TX from VF
requires adding an egress drop rule to the PF, this is
implemented in these series too.

There are no patches that explicitly address LLDP RX in
switchdev mode, because it just works after adding support
in legacy mode.

Usage

To receive LLDP packets on VF in legacy mode:
On host:
ip link set dev <pf_ifname> vf <n> trust on
On VM:
service lldpd restart

To receive LLDP packets on VF in switchdev mode (host config):
tc qdisc add dev <pf_ifname> clsact
tc filter add dev <pf_ifname> protocol lldp ingress \\
flower skip_sw action mirred egress mirror dev <repr_ifname>

To transmit LLDP packets from VF (host config):
tc qdisc add dev <pf_ifname> clsact
tc qdisc add dev <repr_ifname> clsact
tc filter add dev <pf_ifname> egress protocol lldp \\
flower skip_sw action drop
tc filter add dev <repr_ifname> ingress protocol lldp \\
flower skip_sw action mirred egress redirect dev <pf_ifname>

For all abovementioned functionalities to work, private flag
fw-lldp-agent must be off.

v3->v4:
* add "Return: " to the touched kernel-doc
* reunite return type and declaration for ice_add_cls_flower()
and ice_del_cls_flower()

v2->v3:
* fix sparse warning caused by part of .sw_act members being initialized
inside the curly braces and others being initialized directly
* reorder members inside the rinfo initializer according to struct
definition in ice_drop_vf_tx_lldp(), while fixing the warning above

v1->v2:
* get rid of sysfs control
* require switchdev for VF LLDP Tx
* in legacy mode, for VF LLDP Rx rely on configured MAC addresses

Larysa Zaremba (4):
ice: do not add LLDP-specific filter if not necessary
ice: remove headers argument from ice_tc_count_lkups
ice: support egress drop rules on PF
ice: enable LLDP TX for VFs through tc

Mateusz Pacuszka (2):
ice: fix check for existing switch rule
ice: receive LLDP on trusted VFs

drivers/net/ethernet/intel/ice/ice.h | 1 +
drivers/net/ethernet/intel/ice/ice_common.c | 14 +-
drivers/net/ethernet/intel/ice/ice_common.h | 3 +-
drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 2 +-
drivers/net/ethernet/intel/ice/ice_eswitch.c | 6 +
drivers/net/ethernet/intel/ice/ice_ethtool.c | 2 +-
drivers/net/ethernet/intel/ice/ice_lib.c | 71 ++++-
drivers/net/ethernet/intel/ice/ice_lib.h | 3 +-
drivers/net/ethernet/intel/ice/ice_main.c | 63 ++++-
drivers/net/ethernet/intel/ice/ice_repr.c | 10 +-
drivers/net/ethernet/intel/ice/ice_sriov.c | 4 +
drivers/net/ethernet/intel/ice/ice_switch.c | 4 +-
drivers/net/ethernet/intel/ice/ice_tc_lib.c | 258 +++++++++++++++---
drivers/net/ethernet/intel/ice/ice_tc_lib.h | 11 +-
drivers/net/ethernet/intel/ice/ice_txrx.c | 17 +-
drivers/net/ethernet/intel/ice/ice_vf_lib.c | 26 ++
drivers/net/ethernet/intel/ice/ice_vf_lib.h | 12 +
drivers/net/ethernet/intel/ice/ice_virtchnl.c | 53 +++-
18 files changed, 480 insertions(+), 80 deletions(-)

--
2.43.0