Skip to contentSkip to conversation

net/i40e: remove redundant judgment in fdir parse

PATCH Applied Kaiwen Deng 2 participants 2 messages Nov 24, 2023 – Dec 14, 2023 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/i40e: remove redundant judgment in fdir parse

if (eth_spec && eth_mask &&

	       next_type == RTE_FLOW_ITEM_TYPE_END) {
            ...
            if (next_type == RTE_FLOW_ITEM_TYPE_VLAN || ...) {
            ...
            }

...
}

Clearly, that condition in the inner "if" is always "false".

This commit will remove the redundant judgment.

Fixes 7d83c152a207 ("net/i40e: parse flow director filter")
---
 drivers/net/i40e/i40e_flow.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/i40e/i40e_flow.c +1 -2
index 877e49151e..92165c8422 100644
@@ -1708,8 +1708,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
 
 				ether_type = rte_be_to_cpu_16(eth_spec->hdr.ether_type);
 
-				if (next_type == RTE_FLOW_ITEM_TYPE_VLAN ||
-				    ether_type == RTE_ETHER_TYPE_IPV4 ||
+				if (ether_type == RTE_ETHER_TYPE_IPV4 ||
 				    ether_type == RTE_ETHER_TYPE_IPV6 ||
 				    ether_type == i40e_get_outer_vlan(dev)) {
 					rte_flow_error_set(error, EINVAL,
Signature · 1 line
2.34.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 21 lines

-----Original Message-----
From: Kaiwen Deng <[email protected]>
Sent: Friday, November 24, 2023 3:01 PM
To: [email protected]
Cc: [email protected]; Yang, Qiming <[email protected]>; Zhou, YidingX <[email protected]>; Deng, KaiwenX <[email protected]>; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Wu, Jingjing <[email protected]>
Subject: [PATCH] net/i40e: remove redundant judgment in fdir parse

if (eth_spec && eth_mask &&

	       next_type == RTE_FLOW_ITEM_TYPE_END) {
            ...
            if (next_type == RTE_FLOW_ITEM_TYPE_VLAN || ...) {
            ...
            }

...
}

Quoted 8 lines

Clearly, that condition in the inner "if" is always "false".

This commit will remove the redundant judgment.

Fixes 7d83c152a207 ("net/i40e: parse flow director filter")

Applied to dpdk-next-net-intel.

Thanks
Qi