net/i40e: fix conflict with multi-driver
PATCH 1/1 net/i40e: fix conflict with multi-driver
From: Alvin Zhang <[email protected]>
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.
--- drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-)
drivers/net/i40e/i40e_flow.c +27 -7
@@ -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;
Signature · 1 line
1.8.3.1
Quoted 9 lines
-----Original Message-----
From: Zhang, AlvinX
Sent: Friday, September 20, 2019 6:57 PM
To: Zhang, Qi Z <[email protected]>; Xing, Beilei <[email protected]>
Cc: [email protected]; Zhang, AlvinX <[email protected]>; [email protected]
Subject: [PATCH] net/i40e: fix conflict with multi-driver
Quoted 5 lines
From: Alvin Zhang <[email protected]>
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
Quoted 65 lines
Fixes cfdfca493cae ("net/i40e: fix multiple driver support")Signed-off-by Alvin Zhang <[email protected]>--- drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-)drivers/net/i40e/i40e_flow.c +27
-0@@ -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(structi40e_pf*pf,drivers/net/i40e/i40e_flow.c +0
-8(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
PATCH v2 1/1 net/i40e: fix exception with multi-driver
In reply to [email protected]From: Alvin Zhang <[email protected]>
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.
--
v2: modify codes according to the comments.
--- drivers/net/i40e/i40e_flow.c | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-)
drivers/net/i40e/i40e_flow.c +27 -7
@@ -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;
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v2] net/i40e: fix exception with multi-driver
Quoted 4 lines · On 09/26, [email protected] wrote:
From: Alvin Zhang <[email protected]>
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
Quoted 18 lines
with
rte_flowAPI, the global registerGLQF_FD_MSKmay be changed.Fixes cfdfca493cae ("net/i40e: fix multiple driver support")Signed-off-by Alvin Zhang <[email protected]>--
v2: modify codes according to the comments.
---drivers/net/i40e/i40e_flow.c| 34 +++++++++++++++++++++++++++-------1 file changed, 27 insertions(+), 7 deletions(-)drivers/net/i40e/i40e_flow.c +0
-0
drivers/net/i40e/i40e_flow.c static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf, · line 2358
Quoted 10 lines
drivers/net/i40e/i40e_flow.c +7
-0@@ -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.
drivers/net/i40e/i40e_flow.c static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf, · line 2365
Quoted 7 lines
drivers/net/i40e/i40e_flow.c +7
-0+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
Quoted 33 lines
drivers/net/i40e/i40e_flow.c +13
-7+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;Signature · 1 line
1.8.3.1
PATCH v3 1/1 net/i40e: fix exception with multi-driver
In reply to [email protected]From: Alvin Zhang <[email protected]>
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.
--
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(-)
drivers/net/i40e/i40e_flow.c +31 -7
@@ -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;
Signature · 1 line
1.8.3.1
PATCH v3 1/1 net/i40e: fix exception with multi-driver
From: Alvin Zhang <[email protected]>
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.
--
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(-)
drivers/net/i40e/i40e_flow.c +31 -7
@@ -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;
Signature · 1 line
1.8.3.1
Re: [dpdk-dev] [PATCH v3] net/i40e: fix exception with multi-driver
In reply to [email protected]Quoted 10 lines · On 10/08, [email protected] wrote:
From: Alvin Zhang <[email protected]>
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_flowAPI, the global registerGLQF_FD_MSKmay be changed.Fixes cfdfca493cae ("net/i40e: fix multiple driver support")Signed-off-by root <[email protected]>
The signature should be Alvin Zhang <[email protected]>, fixed it while merging.
Quoted 4 lines
--
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.
Quoted 63 lines
---
drivers/net/i40e/i40e_flow.c| 38 +++++++++++++++++++++++++++++++-------1 file changed, 31 insertions(+), 7 deletions(-)drivers/net/i40e/i40e_flow.c +31
-7@@ -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;Signature · 1 line
1.8.3.1
Applied to dpdk-next-net-intel. Thanks.