DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xie, Huawei" <huawei.xie@intel.com>
To: "Ouyang, Changchun" <changchun.ouyang@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH v4 1/3] vhost: Fix packet length issue
Date: Wed, 5 Nov 2014 16:46:59 +0000	[thread overview]
Message-ID: <C37D651A908B024F974696C65296B57B0F2E211F@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1415171435-24252-2-git-send-email-changchun.ouyang@intel.com>

> -----Original Message-----
> From: Ouyang, Changchun
> Sent: Wednesday, November 05, 2014 12:11 AM
> To: dev@dpdk.org
> Cc: Xie, Huawei; Ananyev, Konstantin; Cao, Waterman; Ouyang, Changchun
> Subject: [PATCH v4 1/3] vhost: Fix packet length issue
> 
> As HW vlan strip will reduce the packet length by minus length of vlan tag,
> so it need restore the packet length by plus it.
> 
> Signed-off-by: Changchun Ouyang <changchun.ouyang@intel.com>
> ---
>  examples/vhost/main.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 57ef464..5ca8dce 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -1078,7 +1078,13 @@ virtio_tx_route(struct vhost_dev *vdev, struct
> rte_mbuf *m, uint16_t vlan_tag)
>  					rte_pktmbuf_free(m);
>  					return;
>  				}
> -				offset = 4;
> +
> +				/*
> +				 * HW vlan strip will reduce the packet length
> +				 * by minus length of vlan tag, so need restore
> +				 * the packet length by plus it.
> +				 */
> +				offset = VLAN_HLEN;
>  				vlan_tag =
>  				(uint16_t)
>  				vlan_tags[(uint16_t)dev_ll->vdev->dev-
> >device_fh];
> @@ -1102,8 +1108,10 @@ virtio_tx_route(struct vhost_dev *vdev, struct
> rte_mbuf *m, uint16_t vlan_tag)
>  	len = tx_q->len;
> 
>  	m->ol_flags = PKT_TX_VLAN_PKT;
> -	/*FIXME: offset*/
> +
>  	m->data_len += offset;
> +	m->pkt_len += offset;
> +
>  	m->vlan_tci = vlan_tag;
> 
>  	tx_q->m_table[len] = m;
> --
> 1.8.4.2
Only one thing, I feel "by minus/plus" has grammar problem. :).
Acked-by: Huawei Xie <huawei.xie@intel.com>.

  reply	other threads:[~2014-11-05 16:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30  9:00 [dpdk-dev] [PATCH] " Ouyang Changchun
2014-10-30 14:59 ` [dpdk-dev] [PATCH v2] " Ouyang Changchun
2014-11-04  7:05   ` [dpdk-dev] [PATCH v3 0/2] " Ouyang Changchun
2014-11-04  7:05     ` [dpdk-dev] [PATCH v3 1/2] vhost: " Ouyang Changchun
2014-11-04  7:05     ` [dpdk-dev] [PATCH v3 2/2] vhost: Remove duplicated codes Ouyang Changchun
2014-11-05  7:10     ` [dpdk-dev] [PATCH v4 0/3] Fix packet length issue Ouyang Changchun
2014-11-05  7:10       ` [dpdk-dev] [PATCH v4 1/3] vhost: " Ouyang Changchun
2014-11-05 16:46         ` Xie, Huawei [this message]
2014-11-05  7:10       ` [dpdk-dev] [PATCH v4 2/3] vhost: Remove duplicated codes Ouyang Changchun
2014-11-05  7:10       ` [dpdk-dev] [PATCH v4 3/3] vhost: Check offset value Ouyang Changchun
2014-11-05 16:52         ` Xie, Huawei
2014-11-05 17:00           ` Thomas Monjalon
2014-11-05 17:05             ` Xie, Huawei
2014-11-06  0:44             ` Ouyang, Changchun
2014-11-05  9:28       ` [dpdk-dev] [PATCH v4 0/3] Fix packet length issue Ananyev, Konstantin
2014-11-05 22:07         ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C37D651A908B024F974696C65296B57B0F2E211F@SHSMSX101.ccr.corp.intel.com \
    --to=huawei.xie@intel.com \
    --cc=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).