[v2] net/i40e: fix failing to create FDIR flow

Message ID 20200513025450.66909-1-shougangx.wang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: xiaolong ye
Headers
Series [v2] net/i40e: fix failing to create FDIR flow |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Shougang Wang May 13, 2020, 2:54 a.m. UTC
  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>
---

v2 change:
- Change code alignment format
---
 drivers/net/i40e/i40e_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Xiaolong Ye May 13, 2020, 5:17 a.m. UTC | #1
On 05/13, Shougang Wang wrote:
>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>
>---
>
>v2 change:
>- Change code alignment format
>---
> drivers/net/i40e/i40e_flow.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
>index 65f877866..8ce21f7b6 100644
>--- a/drivers/net/i40e/i40e_flow.c
>+++ b/drivers/net/i40e/i40e_flow.c
>@@ -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,
>-- 
>2.17.1
>

Applied to dpdk-next-net-intel, Thanks.
  

Patch

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index 65f877866..8ce21f7b6 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -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,