Skip to contentSkip to conversation

net/i40e: fix flow does not effect on uncustomed pctype

PATCH In review Murphy Yang 3 participants 8 messages Apr 16, 2021 – Apr 21, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/i40e: fix flow does not effect on uncustomed pctype

Uncustomed flow rule does not effect, the root cause is not write the configure in register.

Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
---
 drivers/net/i40e/i40e_fdir.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/net/i40e/i40e_fdir.c +9 -11
index da089baa4d..77375b059a 100644
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
@@ -1762,18 +1764,14 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,
 					filter->input.flow_ext.input_set);
-			if (ret == -1) {
-				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
-				return -EINVAL;
-			} else if (ret == -EINVAL) {
-				PMD_DRV_LOG(ERR, "Invalid pattern mask.");
-				return -EINVAL;
-			}
+			if (ret)
+				return ret;
+		}
 
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;
 				field_idx = layer_idx * I40E_MAX_FLXPLD_FIED + i;
Signature · 1 line
2.17.1
#1 lore raw

Hi,

Quoted 10 lines

-----Original Message-----
From: Yang, MurphyX <[email protected]>
Sent: Friday, April 16, 2021 10:20 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; Yang, MurphyX <[email protected]>
Subject: [PATCH] net/i40e: fix flow does not effect on uncustomed pctype

Quoted 2 lines

Uncustomed flow rule does not effect, the root cause is not write the configure in register.

Could you please detail the issue case? Is it related to DDP package?

Quoted 53 lines
Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
---
 drivers/net/i40e/i40e_fdir.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/net/i40e/i40e_fdir.c index renamed from drivers/net/i40e/i40e_fdir.c +0 -0

da089baa4d..77375b059a 100644

drivers/net/i40e/i40e_fdir.c +4 -2
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
 {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
drivers/net/i40e/i40e_fdir.c +5 -9
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
@@ -1762,18 +1764,14 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev
 *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,
 					filter->input.flow_ext.input_set);
-			if (ret == -1) {
-				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
-				return -EINVAL;
-			} else if (ret == -EINVAL) {
-				PMD_DRV_LOG(ERR, "Invalid pattern mask.");
-				return -EINVAL;
-			}
+			if (ret)
+				return ret;
+		}
 
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;

field_idx = layer_idx * I40E_MAX_FLXPLD_FIED
+ i;
--
2.17.1

#2 lore raw
In reply to Murphy Yang
Quoted 40 lines

-----Original Message-----
From: Yang, MurphyX <[email protected]>
Sent: Friday, April 16, 2021 10:20 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; Yang, MurphyX <[email protected]>
Subject: [PATCH] net/i40e: fix flow does not effect on uncustomed pctype

Uncustomed flow rule does not effect, the root cause is not write the configure in register.

Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
---
 drivers/net/i40e/i40e_fdir.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
drivers/net/i40e/i40e_fdir.c index renamed from drivers/net/i40e/i40e_fdir.c +0 -0

da089baa4d..77375b059a 100644

drivers/net/i40e/i40e_fdir.c +4 -2
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
 {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
drivers/net/i40e/i40e_fdir.c +0 -0
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))

drivers/net/i40e/i40e_fdir.c i40e_flow_add_del_fdir_filter(struct rte_eth_dev · line 1769

Quoted 7 lines
drivers/net/i40e/i40e_fdir.c +1 -1
@@ -1762,18 +1764,14 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev
 *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,

i40e_flow_set_fdir_inset should not be called here, but outside the if statement. Since all following configuration is for flexible FDIR.

drivers/net/i40e/i40e_fdir.c i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev, · line 1773

Quoted 7 lines
drivers/net/i40e/i40e_fdir.c +0 -6
 					filter->input.flow_ext.input_set);
-			if (ret == -1) {
-				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
-				return -EINVAL;
-			} else if (ret == -EINVAL) {
-				PMD_DRV_LOG(ERR, "Invalid pattern mask.");

Remove the log here, then you should add the log in i40e_flow_set_fdir_inset, Right?

Quoted 13 lines
drivers/net/i40e/i40e_fdir.c +4 -2
-				return -EINVAL;
-			}
+			if (ret)
+				return ret;
+		}
 
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;

field_idx = layer_idx * I40E_MAX_FLXPLD_FIED
+ i;
--
2.17.1

#3 lore raw

PATCH v2 1/1 net/i40e: fix FDIR issue for common PCTYPEs

In reply to Murphy Yang

Currently, FDIR doesn't work for all common PCTYPEs, the root cause is that input set is not configured.

Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")

---
v2:
- tune the code and modify commit message

 drivers/net/i40e/i40e_fdir.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_fdir.c +9 -4
index da089baa4d..6b81e09db5 100644
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
@@ -1762,18 +1764,21 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		/* configure the input set for common PCTYPEs*/
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,
 					filter->input.flow_ext.input_set);
 			if (ret == -1) {
 				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
+						    " first rule's input set.");
 				return -EINVAL;
 			} else if (ret == -EINVAL) {
 				PMD_DRV_LOG(ERR, "Invalid pattern mask.");
 				return -EINVAL;
 			}
+		}
 
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;
 				field_idx = layer_idx * I40E_MAX_FLXPLD_FIED + i;
Signature · 1 line
2.17.1
#4 lore raw

Re: [dpdk-dev] [PATCH v2] net/i40e: fix FDIR issue for common PCTYPEs

Quoted 45 lines

-----Original Message-----
From: Yang, MurphyX <[email protected]>
Sent: Wednesday, April 21, 2021 10:09 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; Yang, MurphyX <[email protected]>
Subject: [PATCH v2] net/i40e: fix FDIR issue for common PCTYPEs

Currently, FDIR doesn't work for all common PCTYPEs, the root cause is that input set is not configured.

Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")

---
v2:
- tune the code and modify commit message drivers/net/i40e/i40e_fdir.c | 13
+++++++++----

 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/net/i40e/i40e_fdir.c index renamed from drivers/net/i40e/i40e_fdir.c +0 -0

da089baa4d..6b81e09db5 100644

drivers/net/i40e/i40e_fdir.c +4 -2
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
 {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
drivers/net/i40e/i40e_fdir.c +0 -0
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
@@ -1762,18 +1764,21 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev
 *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 

drivers/net/i40e/i40e_fdir.c i40e_flow_add_del_fdir_filter(struct rte_eth_dev · line 1774

Quoted 10 lines
drivers/net/i40e/i40e_fdir.c +3 -2
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		/* configure the input set for common PCTYPEs*/
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,
 					filter->input.flow_ext.input_set);
 			if (ret == -1) {
 				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
+						    " first rule's input set.");

The log is duplicated with above.

Quoted 14 lines
drivers/net/i40e/i40e_fdir.c +2 -0
 				return -EINVAL;
 			} else if (ret == -EINVAL) {
 				PMD_DRV_LOG(ERR, "Invalid pattern mask.");
 				return -EINVAL;
 			}
+		}
 
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;

field_idx = layer_idx * I40E_MAX_FLXPLD_FIED
+ i;
--
2.17.1

#5 lore raw

PATCH v3 1/1 net/i40e: fix FDIR issue for common PCTYPEs

In reply to Murphy Yang

Currently, FDIR doesn't work for all common PCTYPEs, the root cause is that input set is not configured.

Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
---
 drivers/net/i40e/i40e_fdir.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/net/i40e/i40e_fdir.c +13 -12
index da089baa4d..ed1c60af99 100644
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t))) {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
@@ -1616,8 +1618,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg,
 						 I40E_INSET_MASK_NUM_REG);
-	if (num < 0)
+	if (num < 0) {
+		PMD_DRV_LOG(ERR, "Invalid pattern mask.");
 		return -EINVAL;
+	}
 
 	if (pf->support_multi_driver) {
 		for (i = 0; i < num; i++)
@@ -1762,18 +1766,15 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		/* configure the input set for common PCTYPEs*/
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,
 					filter->input.flow_ext.input_set);
-			if (ret == -1) {
-				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
-				return -EINVAL;
-			} else if (ret == -EINVAL) {
-				PMD_DRV_LOG(ERR, "Invalid pattern mask.");
-				return -EINVAL;
-			}
+			if (ret < 0)
+				return ret;
+		}
 
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;
 				field_idx = layer_idx * I40E_MAX_FLXPLD_FIED + i;
Signature · 1 line
2.17.1
Acked-by on v3 1/1
#6 lore raw

Re: [dpdk-dev] [PATCH v3] net/i40e: fix FDIR issue for common PCTYPEs

Quoted 77 lines

-----Original Message-----
From: Yang, MurphyX <[email protected]>
Sent: Wednesday, April 21, 2021 11:44 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; Yang, MurphyX <[email protected]>
Subject: [PATCH v3] net/i40e: fix FDIR issue for common PCTYPEs

Currently, FDIR doesn't work for all common PCTYPEs, the root cause is that input set is not configured.

Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow validate")
---
 drivers/net/i40e/i40e_fdir.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
drivers/net/i40e/i40e_fdir.c index renamed from drivers/net/i40e/i40e_fdir.c +0 -0

da089baa4d..ed1c60af99 100644

drivers/net/i40e/i40e_fdir.c +4 -2
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
 {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
drivers/net/i40e/i40e_fdir.c +3 -1
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
@@ -1616,8 +1618,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg,
 
 I40E_INSET_MASK_NUM_REG);
-	if (num < 0)
+	if (num < 0) {
+		PMD_DRV_LOG(ERR, "Invalid pattern mask.");
 		return -EINVAL;
+	}
 
 	if (pf->support_multi_driver) {
drivers/net/i40e/i40e_fdir.c +6 -9
 		for (i = 0; i < num; i++)
@@ -1762,18 +1766,15 @@ i40e_flow_add_del_fdir_filter(struct rte_eth_dev
 *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		/* configure the input set for common PCTYPEs*/
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,
 					filter->input.flow_ext.input_set);
-			if (ret == -1) {
-				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
-				return -EINVAL;
-			} else if (ret == -EINVAL) {
-				PMD_DRV_LOG(ERR, "Invalid pattern mask.");
-				return -EINVAL;
-			}
+			if (ret < 0)
+				return ret;
+		}
 
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;
Quoted 4 lines

field_idx = layer_idx * I40E_MAX_FLXPLD_FIED
+ i;
--
2.17.1

Applied
#7 lore raw

Re: [dpdk-dev] [PATCH v3] net/i40e: fix FDIR issue for common PCTYPEs

Quoted 90 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Xing, Beilei
Sent: Wednesday, April 21, 2021 1:11 PM
To: Yang, MurphyX <[email protected]>; [email protected]
Cc: Yang, Qiming <[email protected]>; Guo, Jia <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v3] net/i40e: fix FDIR issue for common PCTYPEs

Quoted 76 lines

-----Original Message-----
From: Yang, MurphyX <[email protected]>
Sent: Wednesday, April 21, 2021 11:44 AM
To: [email protected]
Cc: Yang, Qiming <[email protected]>; Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; Yang, SteveX <[email protected]>; Zhang, RobinX <[email protected]>; Yang, MurphyX <[email protected]>
Subject: [PATCH v3] net/i40e: fix FDIR issue for common PCTYPEs

Currently, FDIR doesn't work for all common PCTYPEs, the root cause is that input set is not configured.

Fixes 4a072ad43442 ("net/i40e: fix flow director config after flow

validate")

---
 drivers/net/i40e/i40e_fdir.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
(quoted diff) +0 -0

b/drivers/net/i40e/i40e_fdir.c index
da089baa4d..ed1c60af99 100644

drivers/net/i40e/i40e_fdir.c +5 -2
@@ -1607,8 +1607,10 @@ i40e_flow_set_fdir_inset(struct i40e_pf *pf,
 
 	/* Check if the configuration is conflicted */
 	if (pf->fdir.inset_flag[pctype] &&
-	    memcmp(&pf->fdir.input_set[pctype], &input_set, sizeof(uint64_t)))
-		return -1;
+	    memcmp(&pf->fdir.input_set[pctype], &input_set,
+sizeof(uint64_t)))
 {
+		PMD_DRV_LOG(ERR, "Conflict with the first rule's input set.");
+		return -EINVAL;
+	}
 
 	if (pf->fdir.inset_flag[pctype] &&
 	    !memcmp(&pf->fdir.input_set[pctype], &input_set,

sizeof(uint64_t))) @@ -1616,8 +1618,10 @@
i40e_flow_set_fdir_inset(struct i40e_pf *pf,

num = i40e_generate_inset_mask_reg(hw, input_set, mask_reg,

I40E_INSET_MASK_NUM_REG);

drivers/net/i40e/i40e_fdir.c +8 -10
-	if (num < 0)
+	if (num < 0) {
+		PMD_DRV_LOG(ERR, "Invalid pattern mask.");
 		return -EINVAL;
+	}
 
 	if (pf->support_multi_driver) {
 		for (i = 0; i < num; i++)
@@ -1762,18 +1766,15 @@ i40e_flow_add_del_fdir_filter(struct
 rte_eth_dev *dev,
 	i40e_fdir_filter_convert(filter, &check_filter);
 
 	if (add) {
-		if (filter->input.flow_ext.is_flex_flow) {
+		/* configure the input set for common PCTYPEs*/
+		if (!filter->input.flow_ext.customized_pctype) {
 			ret = i40e_flow_set_fdir_inset(pf, pctype,
 					filter->input.flow_ext.input_set);
-			if (ret == -1) {
-				PMD_DRV_LOG(ERR, "Conflict with the"
-					    " first rule's input set.");
-				return -EINVAL;
-			} else if (ret == -EINVAL) {
-				PMD_DRV_LOG(ERR, "Invalid pattern mask.");
-				return -EINVAL;
-			}
+			if (ret < 0)
+				return ret;
+		}
 
Quoted 9 lines
Quoted 7 lines
drivers/net/i40e/i40e_fdir.c +1 -0
+		if (filter->input.flow_ext.is_flex_flow) {
 			for (i = 0; i < filter->input.flow_ext.raw_id; i++) {
 				layer_idx = filter->input.flow_ext.layer_idx;

field_idx = layer_idx * I40E_MAX_FLXPLD_FIED
+ i;
--
2.17.1

Applied to dpdk-next-net-intel.

Thanks
Qi