DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor
@ 2016-04-07 17:11 John Guzik
  2016-04-07 17:34 ` Thomas Monjalon
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: John Guzik @ 2016-04-07 17:11 UTC (permalink / raw)
  To: dev

With the new jumbo frame patch a latent bug has appeared to have been uncovered: the VLAN offload is on the last rx descriptor, when rcd->eop is true, not the first rx descriptor, when rcd->sop is true and rcd->eop could be false.
Most likely the reason this has not been seen before is that for non-jumbo frames rcd->eop has always been true when rcd->sop is true as well.

The following patch should fix the problem:

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 4ac0456..3d4a5eb 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -587,12 +587,6 @@ vmxnet3_post_rx_bufs(vmxnet3_rx_queue_t *rxq, uint8_t ring_id)
static void
vmxnet3_rx_offload(const Vmxnet3_RxCompDesc *rcd, struct rte_mbuf *rxm)
{
-       /* Check for hardware stripped VLAN tag */
-       if (rcd->ts) {
-               rxm->ol_flags |= PKT_RX_VLAN_PKT;
-               rxm->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci);
-       }
-
        /* Check for RSS */
        if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE) {
                rxm->ol_flags |= PKT_RX_RSS_HASH;
@@ -737,7 +731,15 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
                rxq->last_seg = rxm;

                if (rcd->eop) {
-                       rx_pkts[nb_rx++] = rxq->start_seg;
+                       struct rte_mbuf *start = rxq->start_seg;
+
+                       /* Check for hardware stripped VLAN tag */
+                       if (rcd->ts) {
+                               start->ol_flags |= PKT_RX_VLAN_PKT;
+                               start->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci);
+                       }
+
+                       rx_pkts[nb_rx++] = start;
                        rxq->start_seg = NULL;
                }

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

* Re: [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor
  2016-04-07 17:11 [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor John Guzik
@ 2016-04-07 17:34 ` Thomas Monjalon
  2016-04-07 18:22   ` Yong Wang
  2016-04-07 17:35 ` Stephen Hemminger
  2016-04-12 23:08 ` [dpdk-dev] [PATCH] vmxnet3: VLAN tag on end packet, not first John Guzik
  2 siblings, 1 reply; 6+ messages in thread
From: Thomas Monjalon @ 2016-04-07 17:34 UTC (permalink / raw)
  To: John Guzik, Yong Wang; +Cc: dev

2016-04-07 17:11, John Guzik:
> With the new jumbo frame patch a latent bug has appeared to have been uncovered: the VLAN offload is on the last rx descriptor, when rcd->eop is true, not the first rx descriptor, when rcd->sop is true and rcd->eop could be false.
> Most likely the reason this has not been seen before is that for non-jumbo frames rcd->eop has always been true when rcd->sop is true as well.

Thanks for reporting.
Please Yong, could you confirm?

John, 2 tags are needed to be applied:
Fixes: commit-origin-of-the-bug
Signed-off-by:
Please check http://dpdk.org/dev#send for more details. Thanks

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

* Re: [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor
  2016-04-07 17:11 [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor John Guzik
  2016-04-07 17:34 ` Thomas Monjalon
@ 2016-04-07 17:35 ` Stephen Hemminger
  2016-04-12 23:08 ` [dpdk-dev] [PATCH] vmxnet3: VLAN tag on end packet, not first John Guzik
  2 siblings, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2016-04-07 17:35 UTC (permalink / raw)
  To: John Guzik; +Cc: dev

On Thu, 7 Apr 2016 17:11:19 +0000
John Guzik <john@shieldxnetworks.com> wrote:

> With the new jumbo frame patch a latent bug has appeared to have been uncovered: the VLAN offload is on the last rx descriptor, when rcd->eop is true, not the first rx descriptor, when rcd->sop is true and rcd->eop could be false.
> Most likely the reason this has not been seen before is that for non-jumbo frames rcd->eop has always been true when rcd->sop is true as well.
> 
> The following patch should fix the problem:
> 
> diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> index 4ac0456..3d4a5eb 100644
> --- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
> +++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
> @@ -587,12 +587,6 @@ vmxnet3_post_rx_bufs(vmxnet3_rx_queue_t *rxq, uint8_t ring_id)
> static void
> vmxnet3_rx_offload(const Vmxnet3_RxCompDesc *rcd, struct rte_mbuf *rxm)
> {
> -       /* Check for hardware stripped VLAN tag */
> -       if (rcd->ts) {
> -               rxm->ol_flags |= PKT_RX_VLAN_PKT;
> -               rxm->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci);
> -       }
> -
>         /* Check for RSS */
>         if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE) {
>                 rxm->ol_flags |= PKT_RX_RSS_HASH;
> @@ -737,7 +731,15 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
>                 rxq->last_seg = rxm;
> 
>                 if (rcd->eop) {
> -                       rx_pkts[nb_rx++] = rxq->start_seg;
> +                       struct rte_mbuf *start = rxq->start_seg;
> +
> +                       /* Check for hardware stripped VLAN tag */
> +                       if (rcd->ts) {
> +                               start->ol_flags |= PKT_RX_VLAN_PKT;
> +                               start->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci);
> +                       }
> +
> +                       rx_pkts[nb_rx++] = start;
>                         rxq->start_seg = NULL;
>                 }
> 
> 

Yes, your analysis and bug fix looks correct. The Linux driver checks for VLAN tag in the
last (eop) segment.

Acked-by: Stephen Hemminger <stephen@networkplumber.org>

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

* Re: [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor
  2016-04-07 17:34 ` Thomas Monjalon
@ 2016-04-07 18:22   ` Yong Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Yong Wang @ 2016-04-07 18:22 UTC (permalink / raw)
  To: Thomas Monjalon, John Guzik; +Cc: dev

On 4/7/16, 10:34 AM, "Thomas Monjalon" <thomas.monjalon@6wind.com> wrote:



>2016-04-07 17:11, John Guzik:
>> With the new jumbo frame patch a latent bug has appeared to have been uncovered: the VLAN offload is on the last rx descriptor, when rcd->eop is true, not the first rx descriptor, when rcd->sop is true and rcd->eop could be false.
>> Most likely the reason this has not been seen before is that for non-jumbo frames rcd->eop has always been true when rcd->sop is true as well.
>
>Thanks for reporting.
>Please Yong, could you confirm?
>
>John, 2 tags are needed to be applied:
>Fixes: commit-origin-of-the-bug
>Signed-off-by:
>Please check https://urldefense.proofpoint.com/v2/url?u=http-3A__dpdk.org_dev-23send&d=BQICAg&c=Sqcl0Ez6M0X8aeM67LKIiDJAXVeAw-YihVMNtXt-uEs&r=44mSO5N5yEs4CeCdtQE0xt0F7J0p67_mApYVAzyYms0&m=qucd32eb66O4TLIXrrV-znC7i8UqlSsNVl12u64zFxI&s=P5mdk_qNVscagTjvA2DK44y4vfbI0yN2M8XDlBirX5M&e=  for more details. Thanks

Please add the sign-off and fixes info as Thomas suggested.

Acked-by: Yong Wang <yongwang@vmware.com>

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

* [dpdk-dev] [PATCH] vmxnet3: VLAN tag on end packet, not first
  2016-04-07 17:11 [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor John Guzik
  2016-04-07 17:34 ` Thomas Monjalon
  2016-04-07 17:35 ` Stephen Hemminger
@ 2016-04-12 23:08 ` John Guzik
  2016-05-10 15:04   ` Bruce Richardson
  2 siblings, 1 reply; 6+ messages in thread
From: John Guzik @ 2016-04-12 23:08 UTC (permalink / raw)
  To: dev; +Cc: John Guzik

Signed-off-by: John Guzik <john@shieldxnetworks.com>
Fixes: 9fd5e98b

---
 drivers/net/vmxnet3/vmxnet3_rxtx.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 4ac0456..3d4a5eb 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -587,12 +587,6 @@ vmxnet3_post_rx_bufs(vmxnet3_rx_queue_t *rxq, uint8_t ring_id)
 static void
 vmxnet3_rx_offload(const Vmxnet3_RxCompDesc *rcd, struct rte_mbuf *rxm)
 {
-	/* Check for hardware stripped VLAN tag */
-	if (rcd->ts) {
-		rxm->ol_flags |= PKT_RX_VLAN_PKT;
-		rxm->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci);
-	}
-
 	/* Check for RSS */
 	if (rcd->rssType != VMXNET3_RCD_RSS_TYPE_NONE) {
 		rxm->ol_flags |= PKT_RX_RSS_HASH;
@@ -737,7 +731,15 @@ vmxnet3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 		rxq->last_seg = rxm;
 
 		if (rcd->eop) {
-			rx_pkts[nb_rx++] = rxq->start_seg;
+			struct rte_mbuf *start = rxq->start_seg;
+
+			/* Check for hardware stripped VLAN tag */
+			if (rcd->ts) {
+				start->ol_flags |= PKT_RX_VLAN_PKT;
+				start->vlan_tci = rte_le_to_cpu_16((uint16_t)rcd->tci);
+			}
+
+			rx_pkts[nb_rx++] = start;
 			rxq->start_seg = NULL;
 		}
 
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH] vmxnet3: VLAN tag on end packet, not first
  2016-04-12 23:08 ` [dpdk-dev] [PATCH] vmxnet3: VLAN tag on end packet, not first John Guzik
@ 2016-05-10 15:04   ` Bruce Richardson
  0 siblings, 0 replies; 6+ messages in thread
From: Bruce Richardson @ 2016-05-10 15:04 UTC (permalink / raw)
  To: John Guzik; +Cc: dev

On Tue, Apr 12, 2016 at 04:08:04PM -0700, John Guzik wrote:
> Signed-off-by: John Guzik <john@shieldxnetworks.com>
> Fixes: 9fd5e98b
> 
> ---
>  drivers/net/vmxnet3/vmxnet3_rxtx.c | 16 +++++++++-------
>  1 file changed, 9 insertions(+), 7 deletions(-)
> 
Applied to dpdk-next-net/rel_16_07, with corrected fixes line, maintainer ack
from V1, and updated commit message.

Thanks,
/Bruce

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

end of thread, other threads:[~2016-05-10 15:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-07 17:11 [dpdk-dev] vmxnet3 driver - vlan offload is on end descriptor John Guzik
2016-04-07 17:34 ` Thomas Monjalon
2016-04-07 18:22   ` Yong Wang
2016-04-07 17:35 ` Stephen Hemminger
2016-04-12 23:08 ` [dpdk-dev] [PATCH] vmxnet3: VLAN tag on end packet, not first John Guzik
2016-05-10 15:04   ` Bruce Richardson

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).