Skip to contentSkip to conversation

app/testpmd:vlan filter fail

PATCH Superseded Yanglong Wu 4 participants 13 messages Feb 2, 2018 – Feb 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd:vlan filter fail

Removing out port_conf.rxmode.hw_vlan_filter = 1 will let it equal to 0 and port_conf.rxmode.offloads is assigned as 0 again if hw_vlan_filter = 1. So it will always lead to fail for vlan filter setting

Fix:0074d02fc(convert to new Rx offloads API)

---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/testpmd.c +1 -1
index 5dc8ccac5..0751e573c 100644
@@ -2328,7 +2328,7 @@ init_port_dcb_config(portid_t pid,
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
 	if (retval < 0)
 		return retval;
-	port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
+	port_conf.rxmode.hw_vlan_filter = 1;
 
 	/**
 	 * Write the configuration into the device.
Signature · 1 line
2.11.0
#1 lore raw

Hi Wu,

Indeed there is an issue here, but this is not the right fix.

Friday, February 2, 2018 7:10 AM, Yanglong Wu:

Quoted 17 lines

Subject: [PATCH] app/testpmd:vlan filter fail

Removing out port_conf.rxmode.hw_vlan_filter = 1 will let it equal to 0 and port_conf.rxmode.offloads is assigned as 0 again if hw_vlan_filter = 1. So it will always lead to fail for vlan filter setting

Fix:0074d02fc(convert to new Rx offloads API)

---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

5dc8ccac5..0751e573c 100644

app/test-pmd/testpmd.c init_port_dcb_config(portid_t pid, · line 2332

Quoted 6 lines
app/test-pmd/testpmd.c +1 -1
@@ -2328,7 +2328,7 @@ init_port_dcb_config(portid_t pid,
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs,
 pfc_en);
 	if (retval < 0)
 		return retval;
-	port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
+	port_conf.rxmode.hw_vlan_filter = 1;

The VLAN filter resets because the rxmode.ignore_offload_bitfield is not set. If it was set, the ethdev rxmode convert functions would have convert the new flag to the old API (rxmode.hw_vlan_filter).

Am not much familiar with this configuration but here is a suggested fix:

app/test-pmd/testpmd.c +2 -0
index d8ac43268..caf282386 100644                           
@@ -2324,6 +2324,8 @@ init_port_dcb_config(portid_t pid,    
        rte_port = &ports[pid];                             
                                                            
        memset(&port_conf, 0, sizeof(struct rte_eth_conf)); 
+       port_conf.rxmode = rte_port->dev_conf.rxmode;       
+       port_conf.txmode = rte_port->dev_conf.txmode;       
        /* Enter DCB configuration status */                
        dcb_config = 1;                                     
                                                            

The port_conf for the dcb configuration will inherit the same configuration of the port (which has the ignore_offload_bitfield set). Otherwise, at least the rxmode.ignore_offload_bitfield must be set.

Quoted 5 lines
app/test-pmd/testpmd.c +0 -1
 	/**
 	 * Write the configuration into the device.
--

2.11.0

#2 lore raw

Hi,
Thanks for your review. I got it!

Yanglong Wu
-----Original Message-----
From: Shahaf Shuler [mailto:[email protected]]
Sent: Sunday, February 4, 2018 2:27 PM
To: Wu, Yanglong <[email protected]>; [email protected]
Cc: Lu, Wenzhuo <[email protected]>
Subject: RE: [PATCH] app/testpmd:vlan filter fail

Hi Wu,

Indeed there is an issue here, but this is not the right fix.

Friday, February 2, 2018 7:10 AM, Yanglong Wu:

Quoted 18 lines

Subject: [PATCH] app/testpmd:vlan filter fail

Removing out port_conf.rxmode.hw_vlan_filter = 1 will let it equal to 0 and port_conf.rxmode.offloads is assigned as 0 again if hw_vlan_filter = 1. So it will always lead to fail for vlan filter setting

Fix:0074d02fc(convert to new Rx offloads API)

---
 app/test-pmd/testpmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

5dc8ccac5..0751e573c 100644

app/test-pmd/testpmd.c init_port_dcb_config(portid_t pid, · line 2331

Quoted 5 lines
app/test-pmd/testpmd.c +1 -1
@@ -2328,7 +2328,7 @@ init_port_dcb_config(portid_t pid,
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
 	if (retval < 0)
 		return retval;
-	port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_VLAN_FILTER;
+	port_conf.rxmode.hw_vlan_filter = 1;

The VLAN filter resets because the rxmode.ignore_offload_bitfield is not set. If it was set, the ethdev rxmode convert functions would have convert the new flag to the old API (rxmode.hw_vlan_filter).

Am not much familiar with this configuration but here is a suggested fix:

app/test-pmd/testpmd.c +2 -0
index d8ac43268..caf282386 100644                           
@@ -2324,6 +2324,8 @@ init_port_dcb_config(portid_t pid,    
        rte_port = &ports[pid];                             
                                                            
        memset(&port_conf, 0, sizeof(struct rte_eth_conf)); 
+       port_conf.rxmode = rte_port->dev_conf.rxmode;       
+       port_conf.txmode = rte_port->dev_conf.txmode;       
        /* Enter DCB configuration status */                
        dcb_config = 1;                                     
                                                            

The port_conf for the dcb configuration will inherit the same configuration of the port (which has the ignore_offload_bitfield set). Otherwise, at least the rxmode.ignore_offload_bitfield must be set.

Quoted 5 lines
app/test-pmd/testpmd.c +0 -1
 	/**
 	 * Write the configuration into the device.
--

2.11.0

#3 lore raw

PATCH v2 1/1 app/testpmd:vlan filter fail

In reply to Yanglong Wu

This bug is caused by miss port configuration. The port_conf for the DCB configuration should inherit the same configuration of the port.

Fix:0074d02fc(convert to new Rx offloads API)

---
v2:
changing patch accoding to the review

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c +3 -0
index 5dc8ccac5..da1d9bd3a 100644
@@ -2324,6 +2324,9 @@ init_port_dcb_config(portid_t pid,
 	/* Enter DCB configuration status */
 	dcb_config = 1;
 
+	port_conf.rxmode = rte_port->dev_conf.rxmode;
+	port_conf.txmode = rte_port->dev_conf.txmode;
+
 	/*set configuration of DCB in vt mode and DCB in non-vt mode*/
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
 	if (retval < 0)
Signature · 1 line
2.11.0
#4 lore raw

Hi Wu,

Few small comment.

Monday, February 5, 2018 4:34 AM, Yanglong Wu:

Quoted 1 line

Subject: [PATCH v2] app/testpmd:vlan filter fail

The commit title can better describe the patch, something like: "app/testpmd: fix port DCB configuration"

Quoted 2 lines

This bug is caused by miss port configuration.

The above line is not needed.

Quoted 4 lines

The port_conf for the DCB configuration should inherit the same configuration of the port.

Fix:0074d02fc(convert to new Rx offloads API)

It needs to be :

Fixes 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")
Quoted 22 lines

---
v2:
changing patch accoding to the review

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

5dc8ccac5..da1d9bd3a 100644

app/test-pmd/testpmd.c +3 -0
@@ -2324,6 +2324,9 @@ init_port_dcb_config(portid_t pid,
 	/* Enter DCB configuration status */
 	dcb_config = 1;
 
+	port_conf.rxmode = rte_port->dev_conf.rxmode;
+	port_conf.txmode = rte_port->dev_conf.txmode;
+
 	/*set configuration of DCB in vt mode and DCB in non-vt mode*/
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs,
 pfc_en);
Quoted 2 lines

if (retval < 0)
--

Otherwise - Acked-by: Shahaf Shuler <[email protected]>

Quoted 1 line

2.11.0

#5 lore raw

Thx! I will change it right now

-----Original Message-----
From: Shahaf Shuler [mailto:[email protected]]
Sent: Monday, February 5, 2018 2:14 PM
To: Wu, Yanglong <[email protected]>; [email protected]
Cc: Lu, Wenzhuo <[email protected]>
Subject: RE: [PATCH v2] app/testpmd:vlan filter fail

Hi Wu,

Few small comment.

Monday, February 5, 2018 4:34 AM, Yanglong Wu:

Quoted 1 line

Subject: [PATCH v2] app/testpmd:vlan filter fail

The commit title can better describe the patch, something like: "app/testpmd: fix port DCB configuration"

Quoted 2 lines

This bug is caused by miss port configuration.

The above line is not needed.

Quoted 4 lines

The port_conf for the DCB configuration should inherit the same configuration of the port.

Fix:0074d02fc(convert to new Rx offloads API)

It needs to be :

Fixes 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")
Quoted 13 lines

---
v2:
changing patch accoding to the review

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

5dc8ccac5..da1d9bd3a 100644

app/test-pmd/testpmd.c init_port_dcb_config(portid_t pid,

Quoted 10 lines
app/test-pmd/testpmd.c +3 -1
@@ -2324,6 +2324,9 @@ init_port_dcb_config(portid_t pid,
 	/* Enter DCB configuration status */
 	dcb_config = 1;
 
+	port_conf.rxmode = rte_port->dev_conf.rxmode;
+	port_conf.txmode = rte_port->dev_conf.txmode;
+
 	/*set configuration of DCB in vt mode and DCB in non-vt mode*/
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
 	if (retval < 0)
--

Otherwise - Acked-by: Shahaf Shuler <[email protected]>

Quoted 1 line

2.11.0

#6 lore raw

PATCH v3 1/1 app/testpmd: fix port_id alloction issue

In reply to Yanglong Wu

In the feature of increasing port_id range from 8 bits to 16 bits, vlan port_id allocation function was forget to substitute UINT8 with UINT16, so the vlan port_id was allocated as a inccrete number.

Fixes 28caa76aea71 ("app/testpmd: fix port id type")

---
v2:
modified commit message
---
v3:
add review tag

---
 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/cmdline.c +1 -1
index f71d96301..8990ebf6b 100644
@@ -3352,7 +3352,7 @@ cmdline_parse_token_num_t cmd_vlan_tpid_tpid =
 			      tp_id, UINT16);
 cmdline_parse_token_num_t cmd_vlan_tpid_portid =
 	TOKEN_NUM_INITIALIZER(struct cmd_vlan_tpid_result,
-			      port_id, UINT8);
+			      port_id, UINT16);
 
 cmdline_parse_inst_t cmd_vlan_tpid = {
 	.f = cmd_vlan_tpid_parsed,
Signature · 1 line
2.11.0
#7 lore raw

Re: [PATCH v3] app/testpmd: fix port_id alloction issue

It seems that the patch has been applied by Thomas. Please check mail list.

Quoted 17 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yanglong Wu
Sent: Monday, February 5, 2018 3:53 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo <[email protected]>; Wu, Yanglong <[email protected]>
Subject: [dpdk-dev] [PATCH v3] app/testpmd: fix port_id alloction issue

In the feature of increasing port_id range from 8 bits to 16 bits, vlan port_id allocation function was forget to substitute UINT8 with UINT16, so the vlan port_id was allocated as a inccrete number.

Fixes 28caa76aea71 ("app/testpmd: fix port id type")

---

#8 lore raw

PATCH v3 1/1 app/testpmd: fix port DCB configuration

In reply to Yanglong Wu

The port_conf for the DCB configuration should
inherit the same configuration of the port.

Fix:0074d02fc("app/testpmd: convert to new Rx offloads API")

---
v2:
changing patch accoding to review
---
v3:
changing patch accoding to comments

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c +3 -0
index 5dc8ccac5..da1d9bd3a 100644
@@ -2324,6 +2324,9 @@ init_port_dcb_config(portid_t pid,
 	/* Enter DCB configuration status */
 	dcb_config = 1;
 
+	port_conf.rxmode = rte_port->dev_conf.rxmode;
+	port_conf.txmode = rte_port->dev_conf.txmode;
+
 	/*set configuration of DCB in vt mode and DCB in non-vt mode*/
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
 	if (retval < 0)
Signature · 1 line
2.11.0
Acked-by on v3 1/1
#9 lore raw

Re: [PATCH v3] app/testpmd: fix port DCB configuration

Monday, February 5, 2018 10:48 AM, Yanglong Wu:

Quoted 1 line

Fix:0074d02fc("app/testpmd: convert to new Rx offloads API")

The fix line is still wrong. Use the one I suggested.

Quoted 25 lines

---
v2:
changing patch accoding to review
---
v3:
changing patch accoding to comments

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

5dc8ccac5..da1d9bd3a 100644

app/test-pmd/testpmd.c +3 -0
@@ -2324,6 +2324,9 @@ init_port_dcb_config(portid_t pid,
 	/* Enter DCB configuration status */
 	dcb_config = 1;
 
+	port_conf.rxmode = rte_port->dev_conf.rxmode;
+	port_conf.txmode = rte_port->dev_conf.txmode;
+
 	/*set configuration of DCB in vt mode and DCB in non-vt mode*/
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs,
 pfc_en);
Quoted 3 lines

if (retval < 0)
--
2.11.0

#10 lore raw

PATCH v4 1/1 app/testpmd: fix port DCB configuration

In reply to Yanglong Wu

The port_conf for the DCB configuration should
inherit the same configuration of the port.

Fixes 0074d02fca21("app/testpmd: convert to new Rx offloads API")

---
v2:
changing patch accoding to review
---
v3:
changing patch accoding to comments
---
v4:
changing patch accoding to comments

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c +3 -0
index 5dc8ccac5..da1d9bd3a 100644
@@ -2324,6 +2324,9 @@ init_port_dcb_config(portid_t pid,
 	/* Enter DCB configuration status */
 	dcb_config = 1;
 
+	port_conf.rxmode = rte_port->dev_conf.rxmode;
+	port_conf.txmode = rte_port->dev_conf.txmode;
+
 	/*set configuration of DCB in vt mode and DCB in non-vt mode*/
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
 	if (retval < 0)
Signature · 1 line
2.11.0
#11 lore raw

PATCH v4 1/1 app/testpmd: fix port DCB configuration

In reply to Yanglong Wu

The port_conf for the DCB configuration should
inherit the same configuration of the port.

Fixes 0074d02fca21("app/testpmd: convert to new Rx offloads API")

---
v2:
changing patch accoding to review
---
v3:
changing patch accoding to comments
---
v4:
changing patch accoding to comments

---
 app/test-pmd/testpmd.c | 3 +++
 1 file changed, 3 insertions(+)
app/test-pmd/testpmd.c +3 -0
index 5dc8ccac5..da1d9bd3a 100644
@@ -2324,6 +2324,9 @@ init_port_dcb_config(portid_t pid,
 	/* Enter DCB configuration status */
 	dcb_config = 1;
 
+	port_conf.rxmode = rte_port->dev_conf.rxmode;
+	port_conf.txmode = rte_port->dev_conf.txmode;
+
 	/*set configuration of DCB in vt mode and DCB in non-vt mode*/
 	retval = get_eth_dcb_conf(&port_conf, dcb_mode, num_tcs, pfc_en);
 	if (retval < 0)
Signature · 1 line
2.11.0
Applied
#12 lore raw

Re: [PATCH v4] app/testpmd: fix port DCB configuration

Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Yanglong Wu
Sent: Monday, February 5, 2018 5:56 PM
To: [email protected]
Cc: [email protected]; Lu, Wenzhuo; Wu, Yanglong
Subject: [dpdk-dev] [PATCH v4] app/testpmd: fix port DCB configuration

Quoted 7 lines

The port_conf for the DCB configuration should inherit the same configuration of the port.

Fixes 0074d02fca21("app/testpmd: convert to new Rx offloads API")

Applied to dpdk-next-net-intel, thanks!

/Helin