net/ice: fix GTPU RSS
authorSimei Su <simei.su@intel.com>
Fri, 17 Jul 2020 03:27:36 +0000 (11:27 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Jul 2020 11:54:54 +0000 (13:54 +0200)
Because of incomplete protocol header fields, GTPU_INNER_IPV4_UDP
and GTPU_INNER_IPV4_TCP profile aren't included in inner ipv4 group.
This patch complements header fields for GTPU/GTPU_EH ipv4 rss config.

Besides, after configuring L4 port, GTPU and GTPU_EH packets don't do
hash for UDP/TCP/SCTP. This patch also enables L4 hash for GTPU and GTPU
extension packets.

Fixes: d117de460035 ("net/ice: fix GTPU/PPPoE packets with no hash value")

Signed-off-by: Simei Su <simei.su@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_ethdev.c

index 3534d18..7dd3fcd 100644 (file)
@@ -2524,13 +2524,25 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
 
        if (rss_hf & ETH_RSS_IPV4) {
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4,
-                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+                               ICE_FLOW_SEG_HDR_GTPU_IP |
+                               ICE_FLOW_SEG_HDR_IPV4 |
+                               ICE_FLOW_SEG_HDR_IPV_OTHER, 0);
                if (ret)
                        PMD_DRV_LOG(ERR, "%s GTPU_IPV4 rss flow fail %d",
                                    __func__, ret);
 
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4,
-                               ICE_FLOW_SEG_HDR_PPPOE, 0);
+                               ICE_FLOW_SEG_HDR_GTPU_EH |
+                               ICE_FLOW_SEG_HDR_IPV4 |
+                               ICE_FLOW_SEG_HDR_IPV_OTHER, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV4 rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV4,
+                               ICE_FLOW_SEG_HDR_PPPOE |
+                               ICE_FLOW_SEG_HDR_IPV4 |
+                               ICE_FLOW_SEG_HDR_IPV_OTHER, 0);
                if (ret)
                        PMD_DRV_LOG(ERR, "%s PPPoE_IPV4 rss flow fail %d",
                                    __func__, ret);
@@ -2538,19 +2550,43 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
 
        if (rss_hf & ETH_RSS_IPV6) {
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6,
-                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+                               ICE_FLOW_SEG_HDR_GTPU_IP |
+                               ICE_FLOW_SEG_HDR_IPV6 |
+                               ICE_FLOW_SEG_HDR_IPV_OTHER, 0);
                if (ret)
                        PMD_DRV_LOG(ERR, "%s GTPU_IPV6 rss flow fail %d",
                                    __func__, ret);
 
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6,
-                               ICE_FLOW_SEG_HDR_PPPOE, 0);
+                               ICE_FLOW_SEG_HDR_GTPU_EH |
+                               ICE_FLOW_SEG_HDR_IPV6 |
+                               ICE_FLOW_SEG_HDR_IPV_OTHER, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV6 rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_FLOW_HASH_IPV6,
+                               ICE_FLOW_SEG_HDR_PPPOE |
+                               ICE_FLOW_SEG_HDR_IPV6 |
+                               ICE_FLOW_SEG_HDR_IPV_OTHER, 0);
                if (ret)
                        PMD_DRV_LOG(ERR, "%s PPPoE_IPV6 rss flow fail %d",
                                    __func__, ret);
        }
 
        if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) {
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV4,
+                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_IPV4_UDP rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV4,
+                               ICE_FLOW_SEG_HDR_GTPU_EH, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV4_UDP rss flow fail %d",
+                                   __func__, ret);
+
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV4,
                                ICE_FLOW_SEG_HDR_PPPOE, 0);
                if (ret)
@@ -2559,6 +2595,18 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
        }
 
        if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) {
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV6,
+                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_IPV6_UDP rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV6,
+                               ICE_FLOW_SEG_HDR_GTPU_EH, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV6_UDP rss flow fail %d",
+                                   __func__, ret);
+
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_UDP_IPV6,
                                ICE_FLOW_SEG_HDR_PPPOE, 0);
                if (ret)
@@ -2567,6 +2615,18 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
        }
 
        if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) {
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV4,
+                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_IPV4_TCP rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV4,
+                               ICE_FLOW_SEG_HDR_GTPU_EH, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV4_TCP rss flow fail %d",
+                                   __func__, ret);
+
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV4,
                                ICE_FLOW_SEG_HDR_PPPOE, 0);
                if (ret)
@@ -2575,6 +2635,18 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
        }
 
        if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) {
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV6,
+                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_IPV6_TCP rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV6,
+                               ICE_FLOW_SEG_HDR_GTPU_EH, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV6_TCP rss flow fail %d",
+                                   __func__, ret);
+
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_TCP_IPV6,
                                ICE_FLOW_SEG_HDR_PPPOE, 0);
                if (ret)
@@ -2583,6 +2655,18 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
        }
 
        if (rss_hf & ETH_RSS_NONFRAG_IPV4_SCTP) {
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_SCTP_IPV4,
+                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_IPV4_SCTP rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_SCTP_IPV4,
+                               ICE_FLOW_SEG_HDR_GTPU_EH, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV4_SCTP rss flow fail %d",
+                                   __func__, ret);
+
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_SCTP_IPV4,
                                ICE_FLOW_SEG_HDR_PPPOE, 0);
                if (ret)
@@ -2591,6 +2675,18 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
        }
 
        if (rss_hf & ETH_RSS_NONFRAG_IPV6_SCTP) {
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_SCTP_IPV6,
+                               ICE_FLOW_SEG_HDR_GTPU_IP, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_IPV6_SCTP rss flow fail %d",
+                                   __func__, ret);
+
+               ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_SCTP_IPV6,
+                               ICE_FLOW_SEG_HDR_GTPU_EH, 0);
+               if (ret)
+                       PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV6_SCTP rss flow fail %d",
+                                   __func__, ret);
+
                ret = ice_add_rss_cfg(hw, vsi->idx, ICE_HASH_SCTP_IPV6,
                                ICE_FLOW_SEG_HDR_PPPOE, 0);
                if (ret)