ice: fix choosing UDP header type
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tue, 16 Nov 2021 10:24:26 +0000 (11:24 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 7 Dec 2021 21:21:01 +0000 (13:21 -0800)
commit0e32ff024035b693a3304b3ffe30fba58e2ab48c
treebcda7bfda8dc3ecafcca087730ecf3e940675464
parent28dc1b86f8ea9fd6f4c9e0b363db73ecabf84e22
ice: fix choosing UDP header type

In tunnels packet there can be two UDP headers:
- outer which for hw should be mark as ICE_UDP_OF
- inner which for hw should be mark as ICE_UDP_ILOS or as ICE_TCP_IL if
  inner header is of TCP type

In none tunnels packet header can be:
- UDP, which for hw should be mark as ICE_UDP_ILOS
- TCP, which for hw should be mark as ICE_TCP_IL

Change incorrect ICE_UDP_OF for none tunnel packets to ICE_UDP_ILOS.
ICE_UDP_OF is incorrect for none tunnel packets and setting it leads to
error from hw while adding this kind of recipe.

In summary, for tunnel outer port type should always be set to
ICE_UDP_OF, for none tunnel outer and tunnel inner it should always be
set to ICE_UDP_ILOS.

Fixes: 9e300987d4a8 ("ice: VXLAN and Geneve TC support")
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_tc_lib.c