net/iavf: support default RSS for IP fragment
authorWenjun Wu <wenjun1.wu@intel.com>
Mon, 12 Jul 2021 08:27:30 +0000 (16:27 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Fri, 16 Jul 2021 08:11:30 +0000 (10:11 +0200)
This patch adds default RSS support for IPv4 and IPv6 fragment packet.

Signed-off-by: Wenjun Wu <wenjun1.wu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/iavf/iavf_hash.c

index 03dae5d..2b03dad 100644 (file)
@@ -623,6 +623,38 @@ iavf_rss_hash_set(struct iavf_adapter *ad, uint64_t rss_hf, bool add)
                iavf_add_del_rss_cfg(ad, &rss_cfg, add);
        }
 
+       if (rss_hf & ETH_RSS_FRAG_IPV4) {
+               struct virtchnl_proto_hdrs hdr = {
+                       .tunnel_level = TUNNEL_LEVEL_OUTER,
+                       .count = 3,
+                       .proto_hdr = {
+                               proto_hdr_eth,
+                               proto_hdr_ipv4,
+                               {
+                                       VIRTCHNL_PROTO_HDR_IPV4_FRAG,
+                                       FIELD_SELECTOR(VIRTCHNL_PROTO_HDR_IPV4_FRAG_PKID),
+                                       {BUFF_NOUSED},
+                               },
+                       },
+               };
+               rss_cfg.proto_hdrs = hdr;
+               iavf_add_del_rss_cfg(ad, &rss_cfg, add);
+       }
+
+       if (rss_hf & ETH_RSS_FRAG_IPV6) {
+               struct virtchnl_proto_hdrs hdr = {
+                       .tunnel_level = TUNNEL_LEVEL_OUTER,
+                       .count = 3,
+                       .proto_hdr = {
+                               proto_hdr_eth,
+                               proto_hdr_ipv6,
+                               proto_hdr_ipv6_frag,
+                       },
+               };
+               rss_cfg.proto_hdrs = hdr;
+               iavf_add_del_rss_cfg(ad, &rss_cfg, add);
+       }
+
        vf->rss_hf = rss_hf & IAVF_RSS_HF_ALL;
        return 0;
 }