net/i40e: fix conflict with multi-driver
PATCH 1/1 net/i40e: fix conflict with multi-driver
From: Beilei Xing <[email protected]>
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.
--- drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/net/i40e/i40e_ethdev.c +17 -0
@@ -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; }
Signature · 1 line
2.26.2
Hi, beilei
Quoted 8 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Thursday, November 19, 2020 2:16 PM
To: [email protected]
Cc: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; [email protected]
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"?
Quoted 9 lines
From: Beilei Xing <[email protected]>
PMD configures the global register
I40E_GLINT_CTLduring 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?
Quoted 42 lines
Signed-off-by Beilei Xing <[email protected]>--- drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/net/i40e/i40e_ethdev.c +15
-1@@ -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
PATCH v2 1/1 net/i40e: fix global register recovery
In reply to [email protected]From: Beilei Xing <[email protected]>
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.
---
v2 change:
- refine commit log
drivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/net/i40e/i40e_ethdev.c +17 -0
@@ -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; }
Signature · 1 line
2.26.2
Re: [dpdk-dev] [PATCH v2] net/i40e: fix global register recovery
Quoted 64 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Friday, November 20, 2020 4:50 PM
To: [email protected]
Cc: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; [email protected]
Subject: [PATCH v2] net/i40e: fix global register recoveryFrom: Beilei Xing <[email protected]>
PMD configures the global register
I40E_GLINT_CTLduring 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")Signed-off-by Beilei Xing <[email protected]>---
v2 change:
- refine commit logdrivers/net/i40e/i40e_ethdev.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)drivers/net/i40e/i40e_ethdev.c +15
-1@@ -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
Zhang, Qi Z
AppliedRe: [dpdk-dev] [PATCH v2] net/i40e: fix global register recovery
Quoted 19 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Guo, Jia
Sent: Tuesday, November 24, 2020 1:56 PM
To: Xing, Beilei <[email protected]>; [email protected]
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH v2] net/i40e: fix global register recoveryAcked-by Jeff Guo <[email protected]>Quoted 8 lines
-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Friday, November 20, 2020 4:50 PM
To: [email protected]
Cc: Guo, Jia <[email protected]>; Xing, Beilei <[email protected]>; [email protected]
Subject: [PATCH v2] net/i40e: fix global register recovery
Quoted 15 lines
Quoted 6 lines
From: Beilei Xing <[email protected]>
PMD configures the global register
I40E_GLINT_CTLduring 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 dropissue.
Quoted 8 lines
This patch fixes this issue.
Fixes be6c228d4da3 ("i40e: support Rx interrupt")Fixes 4ab831449a1c ("net/i40e: fix interrupt conflict withmulti-driver")
Cc: [email protected]Signed-off-by Beilei Xing <[email protected]>
Applied to dpdk-next-net-intel.
Thanks
Qi