Skip to content

Commit

Permalink
net/i40e: remove redundant judgment in flow parsing
Browse files Browse the repository at this point in the history
[ upstream commit e930f8622e05e410a475c6b57dd7edd73b2e1705 ]

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: 7d83c15 ("net/i40e: parse flow director filter")

Signed-off-by: Kaiwen Deng <kaiwenx.deng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
  • Loading branch information
kevin-intel authored and bluca committed Feb 27, 2024
1 parent fc8cfb6 commit 5995938
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/net/i40e/i40e_flow.c
Original file line number Diff line number Diff line change
Expand Up @@ -1708,8 +1708,7 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,

ether_type = rte_be_to_cpu_16(eth_spec->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,
Expand Down

0 comments on commit 5995938

Please sign in to comment.