Messages in this thread | | | From | "Buvaneswaran, Sujai" <> | Subject | RE: [Intel-wired-lan] [PATCH iwl-next v6] ice: Add support for packet mirroring using hardware in switchdev mode | Date | Mon, 18 Dec 2023 12:21:30 +0000 |
| |
> -----Original Message----- > From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of > Andrii Staikov > Sent: Tuesday, December 12, 2023 6:21 PM > To: intel-wired-lan@lists.osuosl.org > Cc: netdev@vger.kernel.org; Szycik, Marcin <marcin.szycik@intel.com>; > Drewek, Wojciech <wojciech.drewek@intel.com>; linux- > kernel@vger.kernel.org; Staikov, Andrii <andrii.staikov@intel.com> > Subject: [Intel-wired-lan] [PATCH iwl-next v6] ice: Add support for packet > mirroring using hardware in switchdev mode > > Switchdev mode allows to add mirroring rules to mirror incoming and > outgoing packets to the interface's port representor. Previously, this was > available only using software functionality. Add possibility to offload this > functionality to the NIC hardware. > > Introduce ICE_MIRROR_PACKET filter action to the ice_sw_fwd_act_type > enum to identify the desired action and pass it to the hardware as well as the > VSI to mirror. > > Example of tc mirror command using hardware: > tc filter add dev ens1f0np0 ingress protocol ip prio 1 flower src_mac > b4:96:91:a5:c7:a7 skip_sw action mirred egress mirror dev eth1 > > ens1f0np0 - PF > b4:96:91:a5:c7:a7 - source MAC address > eth1 - PR of a VF to mirror to > > Co-developed-by: Marcin Szycik <marcin.szycik@intel.com> > Signed-off-by: Marcin Szycik <marcin.szycik@intel.com> > Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com> > Signed-off-by: Andrii Staikov <andrii.staikov@intel.com> > --- > v1 -> v2: no need for changes in ice_add_tc_flower_adv_fltr() > v2 -> v3: add another if branch for netif_is_ice(act->dev) || > ice_is_tunnel_supported(act->dev) for FLOW_ACTION_MIRRED action and > add direction rules for filters > v3 -> v4: move setting mirroring into dedicated function > ice_tc_setup_mirror_action() > v4 -> v5: Fix packets not mirroring from VF to VF by changing > ICE_ESWITCH_FLTR_INGRESS to ICE_ESWITCH_FLTR_EGRESS where needed > v5 -> v6: Additionally fix some tags > --- > drivers/net/ethernet/intel/ice/ice_switch.c | 25 +++++++++---- > drivers/net/ethernet/intel/ice/ice_tc_lib.c | 41 +++++++++++++++++++++ > drivers/net/ethernet/intel/ice/ice_type.h | 1 + > 3 files changed, 60 insertions(+), 7 deletions(-) > Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
| |