An IP header combined with GTP-U header should be regarded as
inner layer for RSS, otherwise it mess the field vector between
an IPv4 rule and IPv6 rule e.g:

testpmd> flow create 0 ingress patterh eth / ipv4 / udp / gtpu / \
gtpu_psc  / ipv4 / udp / end actions rss types ipv4-udp end key_len \
0 queues end / end
testpmd> flow create 0 ingress patterh eth / ipv4 / udp / gtpu / \
gtpu_psc  / ipv6 / udp / end actions rss types ipv6-udp end key_len \
0 queues end / end

Fixes: b7d34ccc47b5 ("net/ice/base: packet encapsulation for RSS")
Cc: sta...@dpdk.org

Signed-off-by: Qi Zhang <qi.z.zh...@intel.com>
Signed-off-by: Junfeng Guo <junfeng....@intel.com>
---
 drivers/net/ice/base/ice_flow.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c
index 6adcda844..180fe4466 100644
--- a/drivers/net/ice/base/ice_flow.c
+++ b/drivers/net/ice/base/ice_flow.c
@@ -3557,6 +3557,13 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, 
u64 hashed_flds,
        if (status)
                goto exit;
 
+       /* don't do RSS for GTPU outer */
+       if (segs_cnt == ICE_RSS_OUTER_HEADERS &&
+           (segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU)) {
+               printf("ignore gtpu\n");
+               return ICE_SUCCESS;
+       }
+
        /* Search for a flow profile that has matching headers, hash fields
         * and has the input VSI associated to it. If found, no further
         * operations required and exit.
@@ -3673,6 +3680,7 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 
hashed_flds,
        ice_acquire_lock(&hw->rss_locks);
        status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs,
                                      ICE_RSS_OUTER_HEADERS, symm);
+
        if (!status)
                status = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds,
                                              addl_hdrs, ICE_RSS_INNER_HEADERS,
@@ -3706,6 +3714,10 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, 
u64 hashed_flds,
        if (!segs)
                return ICE_ERR_NO_MEMORY;
 
+       if (segs_cnt == ICE_RSS_OUTER_HEADERS &&
+           segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU)
+               return ICE_SUCCESS;
+
        /* Construct the packet segment info from the hashed fields */
        status = ice_flow_set_rss_seg_info(&segs[segs_cnt - 1], hashed_flds,
                                           addl_hdrs);
-- 
2.13.6

Reply via email to