@@ -138,10 +138,22 @@ ice_tc_fill_tunnel_outer(u32 flags, struct ice_tc_flower_fltr *fltr,
u32 tenant_id;
list[i].type = ice_proto_type_from_tunnel(fltr->tunnel_type);
- tenant_id = be32_to_cpu(fltr->tenant_id) << 8;
- list[i].h_u.tnl_hdr.vni = cpu_to_be32(tenant_id);
- memcpy(&list[i].m_u.tnl_hdr.vni, "\xff\xff\xff\x00", 4);
- i++;
+ switch (fltr->tunnel_type) {
+ case TNL_VXLAN:
+ case TNL_GENEVE:
+ tenant_id = be32_to_cpu(fltr->tenant_id) << 8;
+ list[i].h_u.tnl_hdr.vni = cpu_to_be32(tenant_id);
+ memcpy(&list[i].m_u.tnl_hdr.vni, "\xff\xff\xff\x00", 4);
+ i++;
+ break;
+ case TNL_GRETAP:
+ list[i].h_u.nvgre_hdr.tni_flow = fltr->tenant_id;
+ memcpy(&list[i].m_u.nvgre_hdr.tni_flow, "\xff\xff\xff\xff", 4);
+ i++;
+ break;
+ default:
+ break;
+ }
}
if (flags & (ICE_TC_FLWR_FIELD_ENC_SRC_IPV4 |
In ice driver nvgre header is stored in different structure than vxlan and geneve. Also the id can be 32 bit. Check tunnel type before adding encap key id matching to reflect these differences. Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com> --- This commit should be squashed with "ice: support for GRE in eswitch" drivers/net/ethernet/intel/ice/ice_tc_lib.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)