app/testpmd: check Rx VLAN offload flag to print VLAN TCI
PATCH 1/1 app/testpmd: check Rx VLAN offload flag to print VLAN TCI
From: Hyong Youb Kim <[email protected]>
Since the following commit, PKT_RX_VLAN indicates the presence of mbuf's vlan_tci, not PKT_RX_VLAN_STRIPPED.
commit 380a7aab1ae2 ("mbuf: rename deprecated VLAN flags")
Cc: [email protected]
--- app/test-pmd/rxonly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/test-pmd/rxonly.c +1 -1
@@ -130,7 +130,7 @@ pkt_burst_receive(struct fwd_stream *fs) }if (ol_flags &PKT_RX_TIMESTAMP )printf (" - timestamp %" PRIu64" " , mb->timestamp); -if (ol_flags &PKT_RX_VLAN_STRIPPED ) +if (ol_flags &PKT_RX_VLAN )printf (" - VLAN tci=0x%x" , mb->vlan_tci);if (ol_flags &PKT_RX_QINQ_STRIPPED ) printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x",
Signature · 1 line
2.16.2
Quoted 19 lines · John Daley
From: Hyong Youb Kim <[email protected]>
Since the following commit,
PKT_RX_VLANindicates the presence of mbuf'svlan_tci, notPKT_RX_VLAN_STRIPPED.commit
380a7aab1ae2("mbuf: rename deprecated VLAN flags")
Cc: [email protected]Signed-off-by Hyong Youb Kim <[email protected]>Reviewed-by John Daley <[email protected]>--- app/test-pmd/rxonly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)app/test-pmd/rxonly.c +0
-0
app/test-pmd/rxonly.c pkt_burst_receive(struct fwd_stream *fs) · line 136
Quoted 8 lines
app/test-pmd/rxonly.c +1
-1@@ -130,7 +130,7 @@ pkt_burst_receive(struct fwd_stream *fs) }if (ol_flags &PKT_RX_TIMESTAMP )printf (" - timestamp %" PRIu64" " , mb->timestamp); -if (ol_flags &PKT_RX_VLAN_STRIPPED ) +if (ol_flags &PKT_RX_VLAN )printf (" - VLAN tci=0x%x" , mb->vlan_tci);if (ol_flags &PKT_RX_QINQ_STRIPPED ) printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x",
Isn't same also correct for QinQ, PKT_RX_QINQ means mb->vlan_tci & mb->vlan_tci_outer are set?
Quoted 15 lines · Ferruh Yigit
Quoted 14 lines · John Daley
From: Hyong Youb Kim <[email protected]>
Since the following commit,
PKT_RX_VLANindicates the presence of mbuf'svlan_tci, notPKT_RX_VLAN_STRIPPED.commit
380a7aab1ae2("mbuf: rename deprecated VLAN flags")
Cc: [email protected]Signed-off-by Hyong Youb Kim <[email protected]>Reviewed-by John Daley <[email protected]>--- app/test-pmd/rxonly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 17 lines
app/test-pmd/rxonly.c pkt_burst_receive(struct fwd_stream *fs) · line 136
Quoted 13 lines
app/test-pmd/rxonly.c +1
-1@@ -130,7 +130,7 @@ pkt_burst_receive(struct fwd_stream *fs) }if (ol_flags &PKT_RX_TIMESTAMP )printf (" - timestamp %" PRIu64" " , mb->timestamp); -if (ol_flags &PKT_RX_VLAN_STRIPPED ) +if (ol_flags &PKT_RX_VLAN )printf (" - VLAN tci=0x%x" , mb->vlan_tci);if (ol_flags &PKT_RX_QINQ_STRIPPED ) printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x",Isn't same also correct for QinQ,
PKT_RX_QINQmeansmb->vlan_tci&mb->vlan_tci_outerare set?
That is a good point.
According to rte_mbuf.h, PKT_RX_QINQ means "The RX packet is a double VLAN, and the outer tci has been saved in in mbuf->vlan_tci_outer."
Here is a summary.PKT_RX_VLAN => vlan_tci is setPKT_RX_QINQ => vlan_tci_outer is set PKT_RX_VLAN_STRIPPED => must also set PKT_RX_VLAN PKT_RX_QINQ_STRIPPED => must also set PKT_RX_VLAN, PKT_RX_QINQ,
PKT_RX_VLAN_STRIPPED
Looks like i40e is the only driver that is using PKT_RX_QINQ_STRIPPED. And, it does not set PKT_RX_QINQ. I am CC'ing i40e maintainers.
Back to rxonly..
+ if (ol_flags & (PKT_RX_QINQ | PKT_RX_VLAN))
printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x",
mb->vlan_tci, mb->vlan_tci_outer);A change like this would be technically correct, but may break i40e test cases. Or, if the above message is really meant for 'stripped', then perhaps add comment or rephrase the message for now?
As for the use of PKT_RX_VLAN, some drivers like enic and ixgbe can set PKT_RX_VLAN independent of vlan stripping, which led me to writing this patch. I think Olivier fixed all drivers when he introduced PKT_RX_VLAN. So using PKT_RX_VLAN in rxonly shouldn't be breaking anyone's test cases.
-Hyong
Quoted 34 lines · Hyong Youb Kim
Quoted 15 lines · Ferruh Yigit
Quoted 14 lines · John Daley
From: Hyong Youb Kim <[email protected]>
Since the following commit,
PKT_RX_VLANindicates the presence of mbuf'svlan_tci, notPKT_RX_VLAN_STRIPPED.commit
380a7aab1ae2("mbuf: rename deprecated VLAN flags")
Cc: [email protected]Signed-off-by Hyong Youb Kim <[email protected]>Reviewed-by John Daley <[email protected]>--- app/test-pmd/rxonly.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)Quoted 17 lines
app/test-pmd/rxonly.c pkt_burst_receive(struct fwd_stream *fs) · line 136
Quoted 13 lines
app/test-pmd/rxonly.c +1
-1@@ -130,7 +130,7 @@ pkt_burst_receive(struct fwd_stream *fs) }if (ol_flags &PKT_RX_TIMESTAMP )printf (" - timestamp %" PRIu64" " , mb->timestamp); -if (ol_flags &PKT_RX_VLAN_STRIPPED ) +if (ol_flags &PKT_RX_VLAN )printf (" - VLAN tci=0x%x" , mb->vlan_tci);if (ol_flags &PKT_RX_QINQ_STRIPPED ) printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x",Isn't same also correct for QinQ,
PKT_RX_QINQmeansmb->vlan_tci&mb->vlan_tci_outerare set?
Quoted 8 lines
That is a good point.
According to
rte_mbuf.h,PKT_RX_QINQmeans "The RX packet is a double VLAN, and the outer tci has been saved in inmbuf->vlan_tci_outer."Here is a summary.
PKT_RX_VLAN=>vlan_tciis setPKT_RX_QINQ=>vlan_tci_outeris set
Because of the comment on "PKT_RX_QINQ_STRIPPED" I think:PKT_RX_QINQ => vlan_tci_outer & vlan_tci is set
Although it is not clear from "PKT_RX_QINQ" comment.
Quoted 18 lines
PKT_RX_VLAN_STRIPPED=> must also setPKT_RX_VLANPKT_RX_QINQ_STRIPPED=> must also setPKT_RX_VLAN,PKT_RX_QINQ,
PKT_RX_VLAN_STRIPPEDLooks like i40e is the only driver that is using
PKT_RX_QINQ_STRIPPED. And, it does not setPKT_RX_QINQ. I am CC'ing i40e maintainers.Back to rxonly..
+ if (
ol_flags& (PKT_RX_QINQ|PKT_RX_VLAN))printf(" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x", mb->vlan_tci, mb->vlan_tci_outer);A change like this would be technically correct, but may break i40e test cases. Or, if the above message is really meant for 'stripped', then perhaps add comment or rephrase the message for now?
Quoted 5 lines
As for the use of
PKT_RX_VLAN, some drivers like enic and ixgbe can setPKT_RX_VLANindependent of vlan stripping, which led me to writing this patch. I think Olivier fixed all drivers when he introducedPKT_RX_VLAN. So usingPKT_RX_VLANin rxonly shouldn't be breaking anyone's test cases.
+1 to PKT_RX_VLAN update.
I was thinking PKT_RX_QINQ also can be fixed quickly in testpmd with this patch, taking into account that it may affect other piece of code, agree to get this patch as it is and consider QINQ changes in different patch.
Quoted 10 lines · John Daley
From: Hyong Youb Kim <[email protected]>
Since the following commit,
PKT_RX_VLANindicates the presence of mbuf'svlan_tci, notPKT_RX_VLAN_STRIPPED.commit
380a7aab1ae2("mbuf: rename deprecated VLAN flags")
Cc: [email protected]Signed-off-by Hyong Youb Kim <[email protected]>Reviewed-by John Daley <[email protected]>
Ferruh Yigit
AppliedQuoted 6 lines · Ferruh Yigit
Quoted 5 lines · John Daley
From: Hyong Youb Kim <[email protected]>
Since the following commit,
PKT_RX_VLANindicates the presence of mbuf'svlan_tci, notPKT_RX_VLAN_STRIPPED.
Quoted 7 lines
Quoted 5 lines
commit
380a7aab1ae2("mbuf: rename deprecated VLAN flags")
Cc: [email protected]Signed-off-by Hyong Youb Kim <[email protected]>Reviewed-by John Daley <[email protected]>Reviewed-by Ferruh Yigit <[email protected]>
Applied to dpdk-next-net/master, thanks.