net/ice/base: fix RSS removal for GTP-U
authorJunfeng Guo <junfeng.guo@intel.com>
Mon, 13 Jul 2020 11:05:40 +0000 (19:05 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jul 2020 16:21:21 +0000 (18:21 +0200)
Previous logic in removing RSS for GTPU was added in incorrect lines.
The adjustment in this patch will correct the code order so that RSS
for GTPU can be removed successfully.

We also delete the redundant print statement and cleanup the coding
style in this patch.

Fixes: bed9bb3139ef ("net/ice/base: fix GTP-U inner RSS IPv4 IPv6 co-exist")
Cc: stable@dpdk.org
Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
drivers/net/ice/base/ice_flow.c

index d1b8a05..9a17d95 100644 (file)
@@ -3559,10 +3559,8 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,
 
        /* 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");
+           segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU)
                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
@@ -3714,16 +3712,16 @@ 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);
        if (status)
                goto out;
 
+       if (segs_cnt == ICE_RSS_OUTER_HEADERS &&
+           segs[segs_cnt - 1].hdrs & ICE_FLOW_SEG_HDR_GTPU)
+               return ICE_SUCCESS;
+
        prof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt,
                                        vsi_handle,
                                        ICE_FLOW_FIND_PROF_CHK_FLDS);