net/i40e: fix flow director MAC rule creation
authorShougang Wang <shougangx.wang@intel.com>
Wed, 13 May 2020 02:54:50 +0000 (02:54 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 18 May 2020 18:35:56 +0000 (20:35 +0200)
This patch fixes the issue that the flow which both source MAC mask
and destination MAC mask are all zeros can not be created.

Fixes: ea0c22fd8227 ("net/i40e: enable MAC address as flow director input set")

Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
Tested-by: Hailin Xu <hailinx.xu@intel.com>
Reviewed-by: Jeff Guo <jia.guo@intel.com>
drivers/net/i40e/i40e_flow.c

index 65f8778..8ce21f7 100644 (file)
@@ -2643,7 +2643,8 @@ i40e_flow_parse_fdir_pattern(struct rte_eth_dev *dev,
                                        filter->input.flow.l2_flow.src =
                                                eth_spec->src;
                                        input_set |= (I40E_INSET_DMAC | I40E_INSET_SMAC);
-                               } else {
+                               } else if (!rte_is_zero_ether_addr(&eth_mask->src) ||
+                                          !rte_is_zero_ether_addr(&eth_mask->dst)) {
                                        rte_flow_error_set(error, EINVAL,
                                                      RTE_FLOW_ERROR_TYPE_ITEM,
                                                      item,