patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver
@ 2019-09-20 10:57 alvinx.zhang
  2019-09-25  9:16 ` Xing, Beilei
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: alvinx.zhang @ 2019-09-20 10:57 UTC (permalink / raw)
  To: qi.z.zhang, beilei.xing; +Cc: dev, Alvin Zhang, stable

From: Alvin Zhang <alvinx.zhang@intel.com>

If support-multi-driver option been set, we suppose the DPDK will
not modify the value of global register GLQF_FD_MSK. Current
situation is if we create a new flow with 'flow creat ...' command,
the register value may be changed.

Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
---
 drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index e902a35..8c54394 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2349,6 +2349,33 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 	if (num < 0)
 		return -EINVAL;
 
+	if (pf->support_multi_driver) {
+		for (i = 0; i < num; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) !=
+					mask_reg[i]) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported.");
+				return -1;
+			}
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) != 0) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported.");
+				return -1;
+			}
+
+	} else {
+		for (i = 0; i < num; i++)
+			i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
+				mask_reg[i]);
+		/*clear unused mask registers of the pctype */
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			i40e_check_write_reg(hw,
+					I40E_GLQF_FD_MSK(i, pctype), 0);
+	}
+
 	inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set);
 
 	i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
@@ -2357,13 +2384,6 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 			     (uint32_t)((inset_reg >>
 					 I40E_32_BIT_WIDTH) & UINT32_MAX));
 
-	for (i = 0; i < num; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
-				     mask_reg[i]);
-
-	/*clear unused mask registers of the pctype */
-	for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0);
 	I40E_WRITE_FLUSH(hw);
 
 	pf->fdir.input_set[pctype] = input_set;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver
  2019-09-20 10:57 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver alvinx.zhang
@ 2019-09-25  9:16 ` Xing, Beilei
  2019-09-26 10:57 ` [dpdk-stable] [PATCH v2] net/i40e: fix exception " alvinx.zhang
  2019-10-08 10:41 ` [dpdk-stable] [PATCH v3] " alvinx.zhang
  2 siblings, 0 replies; 7+ messages in thread
From: Xing, Beilei @ 2019-09-25  9:16 UTC (permalink / raw)
  To: Zhang, AlvinX, Zhang, Qi Z; +Cc: dev, stable


> -----Original Message-----
> From: Zhang, AlvinX
> Sent: Friday, September 20, 2019 6:57 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; Xing, Beilei <beilei.xing@intel.com>
> Cc: dev@dpdk.org; Zhang, AlvinX <alvinx.zhang@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] net/i40e: fix conflict with multi-driver
> 
> From: Alvin Zhang <alvinx.zhang@intel.com>
> 
> If support-multi-driver option been set, we suppose the DPDK will not modify
> the value of global register GLQF_FD_MSK. Current situation is if we create a
> new flow with 'flow creat ...' command, the register value may be changed.

Thanks for the fix, the patch looks OK for me, but the commit log should be amended.
How about 
"If support-multi-driver is enabled, the global registers should not be configured.
But with the correct code base, if creating a flow with rte_flow API, the global
register GLQF_FD_MSK may be changed." ?

Beilei

> 
> Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
> ---
>  drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++-------
>  1 file changed, 27 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
> index e902a35..8c54394 100644
> --- a/drivers/net/i40e/i40e_flow.c
> +++ b/drivers/net/i40e/i40e_flow.c
> @@ -2349,6 +2349,33 @@ static int i40e_flow_destroy_tunnel_filter(struct
> i40e_pf *pf,
>  	if (num < 0)
>  		return -EINVAL;
> 
> +	if (pf->support_multi_driver) {
> +		for (i = 0; i < num; i++)
> +			if (i40e_read_rx_ctl(hw,
> +					I40E_GLQF_FD_MSK(i, pctype)) !=
> +					mask_reg[i]) {
> +				PMD_DRV_LOG(ERR, "Input set setting is not"
> +						" supported.");
> +				return -1;
> +			}
> +		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
> +			if (i40e_read_rx_ctl(hw,
> +					I40E_GLQF_FD_MSK(i, pctype)) != 0) {
> +				PMD_DRV_LOG(ERR, "Input set setting is not"
> +						" supported.");
> +				return -1;
> +			}
> +
> +	} else {
> +		for (i = 0; i < num; i++)
> +			i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
> +				mask_reg[i]);
> +		/*clear unused mask registers of the pctype */
> +		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
> +			i40e_check_write_reg(hw,
> +					I40E_GLQF_FD_MSK(i, pctype), 0);
> +	}
> +
>  	inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set);
> 
>  	i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0), @@
> -2357,13 +2384,6 @@ static int i40e_flow_destroy_tunnel_filter(struct
> i40e_pf *pf,
>  			     (uint32_t)((inset_reg >>
>  					 I40E_32_BIT_WIDTH) & UINT32_MAX));
> 
> -	for (i = 0; i < num; i++)
> -		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
> -				     mask_reg[i]);
> -
> -	/*clear unused mask registers of the pctype */
> -	for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
> -		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0);
>  	I40E_WRITE_FLUSH(hw);
> 
>  	pf->fdir.input_set[pctype] = input_set;
> --
> 1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v2] net/i40e: fix exception with multi-driver
  2019-09-20 10:57 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver alvinx.zhang
  2019-09-25  9:16 ` Xing, Beilei
@ 2019-09-26 10:57 ` " alvinx.zhang
  2019-09-30 10:07   ` [dpdk-stable] [dpdk-dev] " Ye Xiaolong
  2019-10-08 10:41 ` [dpdk-stable] [PATCH v3] " alvinx.zhang
  2 siblings, 1 reply; 7+ messages in thread
From: alvinx.zhang @ 2019-09-26 10:57 UTC (permalink / raw)
  To: qi.z.zhang, beilei.xing; +Cc: dev, Alvin Zhang, stable

From: Alvin Zhang <alvinx.zhang@intel.com>

If support-multi-driver is enabled, the global registers should not
be configured. But with the correct code base, if creating a flow
with rte_flow API, the global register GLQF_FD_MSK may be changed.

Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
--

v2: modify codes according to the comments.
---
 drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++-------
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index e902a35..9dd7b13 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2349,6 +2349,33 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 	if (num < 0)
 		return -EINVAL;
 
+	if (pf->support_multi_driver) {
+		for (i = 0; i < num; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) !=
+					mask_reg[i]) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported.");
+				return -EPERM;
+			}
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) != 0) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported.");
+				return -EPERM;
+			}
+
+	} else {
+		for (i = 0; i < num; i++)
+			i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
+				mask_reg[i]);
+		/*clear unused mask registers of the pctype */
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			i40e_check_write_reg(hw,
+					I40E_GLQF_FD_MSK(i, pctype), 0);
+	}
+
 	inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set);
 
 	i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
@@ -2357,13 +2384,6 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 			     (uint32_t)((inset_reg >>
 					 I40E_32_BIT_WIDTH) & UINT32_MAX));
 
-	for (i = 0; i < num; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
-				     mask_reg[i]);
-
-	/*clear unused mask registers of the pctype */
-	for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0);
 	I40E_WRITE_FLUSH(hw);
 
 	pf->fdir.input_set[pctype] = input_set;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] net/i40e: fix exception with multi-driver
  2019-09-26 10:57 ` [dpdk-stable] [PATCH v2] net/i40e: fix exception " alvinx.zhang
@ 2019-09-30 10:07   ` " Ye Xiaolong
  0 siblings, 0 replies; 7+ messages in thread
From: Ye Xiaolong @ 2019-09-30 10:07 UTC (permalink / raw)
  To: alvinx.zhang; +Cc: qi.z.zhang, beilei.xing, dev, stable

On 09/26, alvinx.zhang@intel.com wrote:
>From: Alvin Zhang <alvinx.zhang@intel.com>
>
>If support-multi-driver is enabled, the global registers should not
>be configured. But with the correct code base, if creating a flow

correct -> current

>with rte_flow API, the global register GLQF_FD_MSK may be changed.
>
>Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
>Cc: stable@dpdk.org
>
>Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
>--
>
>v2: modify codes according to the comments.
>---
> drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++-------
> 1 file changed, 27 insertions(+), 7 deletions(-)
>
>diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
>index e902a35..9dd7b13 100644
>--- a/drivers/net/i40e/i40e_flow.c
>+++ b/drivers/net/i40e/i40e_flow.c
>@@ -2349,6 +2349,33 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
> 	if (num < 0)
> 		return -EINVAL;
> 
>+	if (pf->support_multi_driver) {
>+		for (i = 0; i < num; i++)
>+			if (i40e_read_rx_ctl(hw,
>+					I40E_GLQF_FD_MSK(i, pctype)) !=
>+					mask_reg[i]) {
>+				PMD_DRV_LOG(ERR, "Input set setting is not"
>+						" supported.");

Could you mention multi-driver in the err log? otherwise this info is misleading.

>+				return -EPERM;
>+			}
>+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
>+			if (i40e_read_rx_ctl(hw,
>+					I40E_GLQF_FD_MSK(i, pctype)) != 0) {
>+				PMD_DRV_LOG(ERR, "Input set setting is not"
>+						" supported.");

Ditto.

Thanks,
Xiaolong

>+				return -EPERM;
>+			}
>+
>+	} else {
>+		for (i = 0; i < num; i++)
>+			i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
>+				mask_reg[i]);
>+		/*clear unused mask registers of the pctype */
>+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
>+			i40e_check_write_reg(hw,
>+					I40E_GLQF_FD_MSK(i, pctype), 0);
>+	}
>+
> 	inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set);
> 
> 	i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
>@@ -2357,13 +2384,6 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
> 			     (uint32_t)((inset_reg >>
> 					 I40E_32_BIT_WIDTH) & UINT32_MAX));
> 
>-	for (i = 0; i < num; i++)
>-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
>-				     mask_reg[i]);
>-
>-	/*clear unused mask registers of the pctype */
>-	for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
>-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0);
> 	I40E_WRITE_FLUSH(hw);
> 
> 	pf->fdir.input_set[pctype] = input_set;
>-- 
>1.8.3.1
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v3] net/i40e: fix exception with multi-driver
  2019-09-20 10:57 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver alvinx.zhang
  2019-09-25  9:16 ` Xing, Beilei
  2019-09-26 10:57 ` [dpdk-stable] [PATCH v2] net/i40e: fix exception " alvinx.zhang
@ 2019-10-08 10:41 ` " alvinx.zhang
  2019-10-08 10:52   ` alvinx.zhang
  2019-10-24  6:27   ` [dpdk-stable] [dpdk-dev] " Ye Xiaolong
  2 siblings, 2 replies; 7+ messages in thread
From: alvinx.zhang @ 2019-10-08 10:41 UTC (permalink / raw)
  To: qi.z.zhang, beilei.xing; +Cc: dev, Alvin Zhang, stable

From: Alvin Zhang <alvinx.zhang@intel.com>

If support-multi-driver is enabled, the global registers should not
be configured. But with the current code base, if creating a flow
with rte_flow API, the global register GLQF_FD_MSK may be changed.

Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
Cc: stable@dpdk.org

Signed-off-by: root <alvinx.zhang@intel.com>
--

v3: modify codes according to the comments.
v2: modify codes according to the comments.
---
 drivers/net/i40e/i40e_flow.c | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index e902a35..f9c3183 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2349,6 +2349,37 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 	if (num < 0)
 		return -EINVAL;
 
+	if (pf->support_multi_driver) {
+		for (i = 0; i < num; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) !=
+					mask_reg[i]) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported with"
+						" `support-multi-driver`"
+						" enabled!");
+				return -EPERM;
+			}
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) != 0) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported with"
+						" `support-multi-driver`"
+						" enabled!");
+				return -EPERM;
+			}
+
+	} else {
+		for (i = 0; i < num; i++)
+			i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
+				mask_reg[i]);
+		/*clear unused mask registers of the pctype */
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			i40e_check_write_reg(hw,
+					I40E_GLQF_FD_MSK(i, pctype), 0);
+	}
+
 	inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set);
 
 	i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
@@ -2357,13 +2388,6 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 			     (uint32_t)((inset_reg >>
 					 I40E_32_BIT_WIDTH) & UINT32_MAX));
 
-	for (i = 0; i < num; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
-				     mask_reg[i]);
-
-	/*clear unused mask registers of the pctype */
-	for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0);
 	I40E_WRITE_FLUSH(hw);
 
 	pf->fdir.input_set[pctype] = input_set;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-stable] [PATCH v3] net/i40e: fix exception with multi-driver
  2019-10-08 10:41 ` [dpdk-stable] [PATCH v3] " alvinx.zhang
@ 2019-10-08 10:52   ` alvinx.zhang
  2019-10-24  6:27   ` [dpdk-stable] [dpdk-dev] " Ye Xiaolong
  1 sibling, 0 replies; 7+ messages in thread
From: alvinx.zhang @ 2019-10-08 10:52 UTC (permalink / raw)
  To: qi.z.zhang, beilei.xing; +Cc: dev, Alvin Zhang, stable

From: Alvin Zhang <alvinx.zhang@intel.com>

If support-multi-driver is enabled, the global registers should not
be configured. But with the current code base, if creating a flow
with rte_flow API, the global register GLQF_FD_MSK may be changed.

Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
Cc: stable@dpdk.org

Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
--

v3: modify codes according to the comments.
v2: modify codes according to the comments.
---
 drivers/net/i40e/i40e_flow.c | 38 +++++++++++++++++++++++++++++++-------
 1 file changed, 31 insertions(+), 7 deletions(-)

diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
index e902a35..f9c3183 100644
--- a/drivers/net/i40e/i40e_flow.c
+++ b/drivers/net/i40e/i40e_flow.c
@@ -2349,6 +2349,37 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 	if (num < 0)
 		return -EINVAL;
 
+	if (pf->support_multi_driver) {
+		for (i = 0; i < num; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) !=
+					mask_reg[i]) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported with"
+						" `support-multi-driver`"
+						" enabled!");
+				return -EPERM;
+			}
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			if (i40e_read_rx_ctl(hw,
+					I40E_GLQF_FD_MSK(i, pctype)) != 0) {
+				PMD_DRV_LOG(ERR, "Input set setting is not"
+						" supported with"
+						" `support-multi-driver`"
+						" enabled!");
+				return -EPERM;
+			}
+
+	} else {
+		for (i = 0; i < num; i++)
+			i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
+				mask_reg[i]);
+		/*clear unused mask registers of the pctype */
+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
+			i40e_check_write_reg(hw,
+					I40E_GLQF_FD_MSK(i, pctype), 0);
+	}
+
 	inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set);
 
 	i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
@@ -2357,13 +2388,6 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
 			     (uint32_t)((inset_reg >>
 					 I40E_32_BIT_WIDTH) & UINT32_MAX));
 
-	for (i = 0; i < num; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
-				     mask_reg[i]);
-
-	/*clear unused mask registers of the pctype */
-	for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0);
 	I40E_WRITE_FLUSH(hw);
 
 	pf->fdir.input_set[pctype] = input_set;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-stable] [dpdk-dev] [PATCH v3] net/i40e: fix exception with multi-driver
  2019-10-08 10:41 ` [dpdk-stable] [PATCH v3] " alvinx.zhang
  2019-10-08 10:52   ` alvinx.zhang
@ 2019-10-24  6:27   ` " Ye Xiaolong
  1 sibling, 0 replies; 7+ messages in thread
From: Ye Xiaolong @ 2019-10-24  6:27 UTC (permalink / raw)
  To: alvinx.zhang; +Cc: qi.z.zhang, beilei.xing, dev, stable

On 10/08, alvinx.zhang@intel.com wrote:
>From: Alvin Zhang <alvinx.zhang@intel.com>
>
>If support-multi-driver is enabled, the global registers should not
>be configured. But with the current code base, if creating a flow
>with rte_flow API, the global register GLQF_FD_MSK may be changed.
>
>Fixes: cfdfca493cae ("net/i40e: fix multiple driver support")
>Cc: stable@dpdk.org
>
>Signed-off-by: root <alvinx.zhang@intel.com>

The signature should be Alvin Zhang <alvinx.zhang@intel.com>, fixed it while
merging.

>--
>
>v3: modify codes according to the comments.
>v2: modify codes according to the comments.

Better to be specific about the changes you made for each version.

>---
> drivers/net/i40e/i40e_flow.c | 38 +++++++++++++++++++++++++++++++-------
> 1 file changed, 31 insertions(+), 7 deletions(-)
>
>diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c
>index e902a35..f9c3183 100644
>--- a/drivers/net/i40e/i40e_flow.c
>+++ b/drivers/net/i40e/i40e_flow.c
>@@ -2349,6 +2349,37 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
> 	if (num < 0)
> 		return -EINVAL;
> 
>+	if (pf->support_multi_driver) {
>+		for (i = 0; i < num; i++)
>+			if (i40e_read_rx_ctl(hw,
>+					I40E_GLQF_FD_MSK(i, pctype)) !=
>+					mask_reg[i]) {
>+				PMD_DRV_LOG(ERR, "Input set setting is not"
>+						" supported with"
>+						" `support-multi-driver`"
>+						" enabled!");
>+				return -EPERM;
>+			}
>+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
>+			if (i40e_read_rx_ctl(hw,
>+					I40E_GLQF_FD_MSK(i, pctype)) != 0) {
>+				PMD_DRV_LOG(ERR, "Input set setting is not"
>+						" supported with"
>+						" `support-multi-driver`"
>+						" enabled!");
>+				return -EPERM;
>+			}
>+
>+	} else {
>+		for (i = 0; i < num; i++)
>+			i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
>+				mask_reg[i]);
>+		/*clear unused mask registers of the pctype */
>+		for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
>+			i40e_check_write_reg(hw,
>+					I40E_GLQF_FD_MSK(i, pctype), 0);
>+	}
>+
> 	inset_reg |= i40e_translate_input_set_reg(hw->mac.type, input_set);
> 
> 	i40e_check_write_reg(hw, I40E_PRTQF_FD_INSET(pctype, 0),
>@@ -2357,13 +2388,6 @@ static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,
> 			     (uint32_t)((inset_reg >>
> 					 I40E_32_BIT_WIDTH) & UINT32_MAX));
> 
>-	for (i = 0; i < num; i++)
>-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype),
>-				     mask_reg[i]);
>-
>-	/*clear unused mask registers of the pctype */
>-	for (i = num; i < I40E_INSET_MASK_NUM_REG; i++)
>-		i40e_check_write_reg(hw, I40E_GLQF_FD_MSK(i, pctype), 0);
> 	I40E_WRITE_FLUSH(hw);
> 
> 	pf->fdir.input_set[pctype] = input_set;
>-- 
>1.8.3.1
>

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-20 10:57 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver alvinx.zhang
2019-09-25  9:16 ` Xing, Beilei
2019-09-26 10:57 ` [dpdk-stable] [PATCH v2] net/i40e: fix exception " alvinx.zhang
2019-09-30 10:07   ` [dpdk-stable] [dpdk-dev] " Ye Xiaolong
2019-10-08 10:41 ` [dpdk-stable] [PATCH v3] " alvinx.zhang
2019-10-08 10:52   ` alvinx.zhang
2019-10-24  6:27   ` [dpdk-stable] [dpdk-dev] " Ye Xiaolong

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox