patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver
@ 2020-11-19  6:16 beilei.xing
  2020-11-19  6:24 ` Guo, Jia
  2020-11-20  8:49 ` [dpdk-stable] [PATCH v2] net/i40e: fix global register recovery beilei.xing
  0 siblings, 2 replies; 7+ messages in thread
From: beilei.xing @ 2020-11-19  6:16 UTC (permalink / raw)
  To: dev; +Cc: jia.guo, Beilei Xing, stable

From: Beilei Xing <beilei.xing@intel.com>

PMD configures the global register I40E_GLINT_CTL during
device initialization to work around the Rx write back
issue. But when a device is bound from DPDK to kernel,
the global register is not recovered to the original
state, it will cause kernel driver performance drop issue.
This patch fixes this issue.

Fixes: be6c228d4da3 ("i40e: support Rx interrupt")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index f54769c29d..2cb18ecc03 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -763,6 +763,21 @@ static inline void i40e_config_automask(struct i40e_pf *pf)
 	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);
 }
 
+static inline void i40e_clear_automask(struct i40e_pf *pf)
+{
+	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+	uint32_t val;
+
+	val = I40E_READ_REG(hw, I40E_GLINT_CTL);
+	val &= ~(I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK |
+		 I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK);
+
+	if (!pf->support_multi_driver)
+		val &= ~I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK;
+
+	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);
+}
+
 #define I40E_FLOW_CONTROL_ETHERTYPE  0x8808
 
 /*
@@ -2741,6 +2756,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
 	/* Remove all Traffic Manager configuration */
 	i40e_tm_conf_uninit(dev);
 
+	i40e_clear_automask(pf);
+
 	hw->adapter_closed = 1;
 	return ret;
 }
-- 
2.26.2


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

* Re: [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver
  2020-11-19  6:16 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver beilei.xing
@ 2020-11-19  6:24 ` Guo, Jia
  2020-11-20  8:49 ` [dpdk-stable] [PATCH v2] net/i40e: fix global register recovery beilei.xing
  1 sibling, 0 replies; 7+ messages in thread
From: Guo, Jia @ 2020-11-19  6:24 UTC (permalink / raw)
  To: Xing, Beilei, dev; +Cc: stable

Hi, beilei

> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Thursday, November 19, 2020 2:16 PM
> To: dev@dpdk.org
> Cc: Guo, Jia <jia.guo@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> stable@dpdk.org
> Subject: [PATCH] net/i40e: fix conflict with multi-driver
> 

Seems that this patch both handle multi-driver and none multi-driver.
I am not sure if it need to rename to a better name, you choice.
" net/i40e: fix global register recovery"?

> From: Beilei Xing <beilei.xing@intel.com>
> 
> PMD configures the global register I40E_GLINT_CTL during device
> initialization to work around the Rx write back issue. But when a device is
> bound from DPDK to kernel, the global register is not recovered to the
> original state, it will cause kernel driver performance drop issue.
> This patch fixes this issue.
> 
> Fixes: be6c228d4da3 ("i40e: support Rx interrupt")

If the issue is root cause that the miss-pair automask configure and automask clear, 
do you think it will be better to add one more fixes tag  as below? 
Fixes: 4ab831449a1c ("net/i40e: fix interrupt conflict with multi-driver ")

> Cc: stable@dpdk.org
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
>  drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index f54769c29d..2cb18ecc03 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -763,6 +763,21 @@ static inline void i40e_config_automask(struct
> i40e_pf *pf)
>  	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);  }
> 
> +static inline void i40e_clear_automask(struct i40e_pf *pf) {
> +	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
> +	uint32_t val;
> +
> +	val = I40E_READ_REG(hw, I40E_GLINT_CTL);
> +	val &= ~(I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK |
> +		 I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK);
> +
> +	if (!pf->support_multi_driver)
> +		val &= ~I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK;
> +
> +	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val); }
> +
>  #define I40E_FLOW_CONTROL_ETHERTYPE  0x8808
> 
>  /*
> @@ -2741,6 +2756,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
>  	/* Remove all Traffic Manager configuration */
>  	i40e_tm_conf_uninit(dev);
> 
> +	i40e_clear_automask(pf);
> +
>  	hw->adapter_closed = 1;
>  	return ret;
>  }
> --
> 2.26.2


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

* [dpdk-stable] [PATCH v2] net/i40e: fix global register recovery
  2020-11-19  6:16 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver beilei.xing
  2020-11-19  6:24 ` Guo, Jia
@ 2020-11-20  8:49 ` beilei.xing
  2020-11-24  5:56   ` Guo, Jia
  1 sibling, 1 reply; 7+ messages in thread
From: beilei.xing @ 2020-11-20  8:49 UTC (permalink / raw)
  To: dev; +Cc: jia.guo, Beilei Xing, stable

From: Beilei Xing <beilei.xing@intel.com>

PMD configures the global register I40E_GLINT_CTL during
device initialization to work around the Rx write back
issue. But when a device is bound from DPDK to kernel,
the global register is not recovered to the original
state, it will cause kernel driver performance drop issue.
This patch fixes this issue.

Fixes: be6c228d4da3 ("i40e: support Rx interrupt")
Fixes: 4ab831449a1c ("net/i40e: fix interrupt conflict with multi-driver")
Cc: stable@dpdk.org

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
---

v2 change:
 - refine commit log

 drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index f54769c29d..2cb18ecc03 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -763,6 +763,21 @@ static inline void i40e_config_automask(struct i40e_pf *pf)
 	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);
 }
 
+static inline void i40e_clear_automask(struct i40e_pf *pf)
+{
+	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
+	uint32_t val;
+
+	val = I40E_READ_REG(hw, I40E_GLINT_CTL);
+	val &= ~(I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK |
+		 I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK);
+
+	if (!pf->support_multi_driver)
+		val &= ~I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK;
+
+	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);
+}
+
 #define I40E_FLOW_CONTROL_ETHERTYPE  0x8808
 
 /*
@@ -2741,6 +2756,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
 	/* Remove all Traffic Manager configuration */
 	i40e_tm_conf_uninit(dev);
 
+	i40e_clear_automask(pf);
+
 	hw->adapter_closed = 1;
 	return ret;
 }
-- 
2.26.2


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

* Re: [dpdk-stable] [PATCH v2] net/i40e: fix global register recovery
  2020-11-20  8:49 ` [dpdk-stable] [PATCH v2] net/i40e: fix global register recovery beilei.xing
@ 2020-11-24  5:56   ` Guo, Jia
  2020-12-11  2:23     ` Zhang, Qi Z
  0 siblings, 1 reply; 7+ messages in thread
From: Guo, Jia @ 2020-11-24  5:56 UTC (permalink / raw)
  To: Xing, Beilei, dev; +Cc: stable

Acked-by: Jeff Guo <jia.guo@intel.com>

> -----Original Message-----
> From: Xing, Beilei <beilei.xing@intel.com>
> Sent: Friday, November 20, 2020 4:50 PM
> To: dev@dpdk.org
> Cc: Guo, Jia <jia.guo@intel.com>; Xing, Beilei <beilei.xing@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v2] net/i40e: fix global register recovery
> 
> From: Beilei Xing <beilei.xing@intel.com>
> 
> PMD configures the global register I40E_GLINT_CTL during device
> initialization to work around the Rx write back issue. But when a device is
> bound from DPDK to kernel, the global register is not recovered to the
> original state, it will cause kernel driver performance drop issue.
> This patch fixes this issue.
> 
> Fixes: be6c228d4da3 ("i40e: support Rx interrupt")
> Fixes: 4ab831449a1c ("net/i40e: fix interrupt conflict with multi-driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Beilei Xing <beilei.xing@intel.com>
> ---
> 
> v2 change:
>  - refine commit log
> 
>  drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
> index f54769c29d..2cb18ecc03 100644
> --- a/drivers/net/i40e/i40e_ethdev.c
> +++ b/drivers/net/i40e/i40e_ethdev.c
> @@ -763,6 +763,21 @@ static inline void i40e_config_automask(struct
> i40e_pf *pf)
>  	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val);  }
> 
> +static inline void i40e_clear_automask(struct i40e_pf *pf) {
> +	struct i40e_hw *hw = I40E_PF_TO_HW(pf);
> +	uint32_t val;
> +
> +	val = I40E_READ_REG(hw, I40E_GLINT_CTL);
> +	val &= ~(I40E_GLINT_CTL_DIS_AUTOMASK_PF0_MASK |
> +		 I40E_GLINT_CTL_DIS_AUTOMASK_VF0_MASK);
> +
> +	if (!pf->support_multi_driver)
> +		val &= ~I40E_GLINT_CTL_DIS_AUTOMASK_N_MASK;
> +
> +	I40E_WRITE_REG(hw, I40E_GLINT_CTL, val); }
> +
>  #define I40E_FLOW_CONTROL_ETHERTYPE  0x8808
> 
>  /*
> @@ -2741,6 +2756,8 @@ i40e_dev_close(struct rte_eth_dev *dev)
>  	/* Remove all Traffic Manager configuration */
>  	i40e_tm_conf_uninit(dev);
> 
> +	i40e_clear_automask(pf);
> +
>  	hw->adapter_closed = 1;
>  	return ret;
>  }
> --
> 2.26.2


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

* Re: [dpdk-stable] [PATCH v2] net/i40e: fix global register recovery
  2020-11-24  5:56   ` Guo, Jia
@ 2020-12-11  2:23     ` Zhang, Qi Z
  0 siblings, 0 replies; 7+ messages in thread
From: Zhang, Qi Z @ 2020-12-11  2:23 UTC (permalink / raw)
  To: Guo, Jia, Xing, Beilei, dev; +Cc: stable



> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Guo, Jia
> Sent: Tuesday, November 24, 2020 1:56 PM
> To: Xing, Beilei <beilei.xing@intel.com>; dev@dpdk.org
> Cc: stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix global register recovery
> 
> Acked-by: Jeff Guo <jia.guo@intel.com>
> 
> > -----Original Message-----
> > From: Xing, Beilei <beilei.xing@intel.com>
> > Sent: Friday, November 20, 2020 4:50 PM
> > To: dev@dpdk.org
> > Cc: Guo, Jia <jia.guo@intel.com>; Xing, Beilei
> > <beilei.xing@intel.com>; stable@dpdk.org
> > Subject: [PATCH v2] net/i40e: fix global register recovery
> >
> > From: Beilei Xing <beilei.xing@intel.com>
> >
> > PMD configures the global register I40E_GLINT_CTL during device
> > initialization to work around the Rx write back issue. But when a
> > device is bound from DPDK to kernel, the global register is not
> > recovered to the original state, it will cause kernel driver performance drop
> issue.
> > This patch fixes this issue.
> >
> > Fixes: be6c228d4da3 ("i40e: support Rx interrupt")
> > Fixes: 4ab831449a1c ("net/i40e: fix interrupt conflict with
> > multi-driver")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Beilei Xing <beilei.xing@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi

^ 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
  0 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] net/i40e: fix conflict with multi-driver
@ 2019-09-20 10:57 alvinx.zhang
  2019-09-25  9:16 ` Xing, Beilei
  0 siblings, 1 reply; 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

end of thread, other threads:[~2020-12-11  2:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19  6:16 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver beilei.xing
2020-11-19  6:24 ` Guo, Jia
2020-11-20  8:49 ` [dpdk-stable] [PATCH v2] net/i40e: fix global register recovery beilei.xing
2020-11-24  5:56   ` Guo, Jia
2020-12-11  2:23     ` Zhang, Qi Z
  -- strict thread matches above, loose matches on Subject: below --
2019-09-20 10:57 [dpdk-stable] [PATCH] net/i40e: fix conflict with multi-driver alvinx.zhang
2019-09-25  9:16 ` Xing, Beilei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).