diff mbox series

[v3,4/6] net/ice: refactor input set conf

Message ID 20210302025407.1197434-5-zhirun.yan@intel.com (mailing list archive)
State Accepted
Delegated to: Qi Zhang
Headers show
Series Refactor FDIR pattern parser | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Zhirun Yan March 2, 2021, 2:54 a.m. UTC
For tunnel or non-tunnel packet, the input set is in outer_input_set
and use seg_tun[0]. seg_tun[1] is only used for tunnel inner fields.
This patch make align with input_set inner/outer with seg_tun[] and
simplify it.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
---
 drivers/net/ice/ice_fdir_filter.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index 6bee2b1167..9cc0e6e0e7 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -1013,7 +1013,7 @@  ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow,
 		return -ENOMEM;
 	}
 
-	/* use seg_tun[1] to record tunnel inner part or non-tunnel */
+	/* use seg_tun[1] to record tunnel inner part */
 	for (k = 0; k <= ICE_FD_HW_SEG_TUN; k++) {
 		seg = &seg_tun[k];
 		input_set = (k == ICE_FD_HW_SEG_TUN) ? inner_input_set : outer_input_set;
@@ -1036,13 +1036,9 @@  ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow,
 	}
 
 	is_tunnel = ice_fdir_is_tunnel_profile(ttype);
-	if (!is_tunnel) {
-		ret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi,
-					   seg_tun + 1, flow, false);
-	} else {
-		ret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi,
-					   seg_tun, flow, true);
-	}
+
+	ret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi,
+				   seg_tun, flow, is_tunnel);
 
 	if (!ret) {
 		return ret;