]> git.baikalelectronics.ru Git - kernel.git/commit
ice: support for GRE in eswitch
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tue, 12 Oct 2021 18:31:06 +0000 (11:31 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Thu, 28 Oct 2021 18:00:20 +0000 (11:00 -0700)
commit29f052c928a198f0f5545de079ebbc61efde97a5
tree813ef825fe4ca86e818673573b00ef7a1be67ade
parentc84cfc84ddfa5eca5e3b1f35b203f19effb09145
ice: support for GRE in eswitch

Mostly reuse code from Geneve and VXLAN in TC parsing code. Add new GRE
header to match on correct fields. Create new dummy packets with GRE
fields.

Instead of checking if any encap values are presented in TC flower,
check if device is tunnel type or redirect is to tunnel device. This
will allow adding all combination of rules. For example filters only
with inner fields.

Return error in case device isn't tunnel but encap values are presented.

gre example:
- create tunnel device
ip l add $NVGRE_DEV type gretap remote $NVGRE_REM_IP local $VF1_IP \
dev $PF
- add tc filter (in switchdev mode)
tc filter add dev $NVGRE_DEV protocol ip parent ffff: flower dst_ip \
$NVGRE1_IP action mirred egress redirect dev $VF1_PR

Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_flex_pipe.c
drivers/net/ethernet/intel/ice/ice_flex_type.h
drivers/net/ethernet/intel/ice/ice_protocol_type.h
drivers/net/ethernet/intel/ice/ice_switch.c
drivers/net/ethernet/intel/ice/ice_tc_lib.c