All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Xia, Chenbo" <chenbo.xia@intel.com>
To: Maxime Coquelin <maxime.coquelin@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>, "Liu, Yong" <yong.liu@intel.com>
Cc: "stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] vhost: fix Virtio-net header len with packed ring
Date: Fri, 9 Oct 2020 06:33:11 +0000	[thread overview]
Message-ID: <MN2PR11MB40635D421438EE1108273A869C080@MN2PR11MB4063.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201001101155.206237-2-maxime.coquelin@redhat.com>

> -----Original Message-----
> From: Maxime Coquelin <maxime.coquelin@redhat.com>
> Sent: Thursday, October 1, 2020 6:12 PM
> To: dev@dpdk.org; Xia, Chenbo <chenbo.xia@intel.com>; Liu, Yong
> <yong.liu@intel.com>
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; stable@dpdk.org
> Subject: [PATCH 1/2] vhost: fix Virtio-net header len with packed ring
> 
> In case packed ring layout has been negotiated, but neither
> Version 1 nor mergeable buffers, the Virtio-net header len
> is assigned to the legacy devices value, which is wrong.
> 
> This patch fixes this with using the proper len as devices
> using packed ring are not legacy devices.
> 
> Fixes: a922401f35cc ("vhost: add Rx support for packed ring")
> Fixes: ae999ce49dcb ("vhost: add Tx support for packed ring")
> Cc: stable@dpdk.org
> 
> Reported-by: Marvin Liu <yong.liu@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  lib/librte_vhost/vhost_user.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
> index 4deceb3e00..5d1fb9e863 100644
> --- a/lib/librte_vhost/vhost_user.c
> +++ b/lib/librte_vhost/vhost_user.c
> @@ -341,7 +341,9 @@ vhost_user_set_features(struct virtio_net **pdev,
> struct VhostUserMsg *msg,
> 
>  	dev->features = features;
>  	if (dev->features &
> -		((1 << VIRTIO_NET_F_MRG_RXBUF) | (1ULL << VIRTIO_F_VERSION_1)))
> {
> +		((1ULL << VIRTIO_NET_F_MRG_RXBUF) |
> +		 (1ULL << VIRTIO_F_VERSION_1) |
> +		 (1ULL << VIRTIO_F_RING_PACKED))) {
>  		dev->vhost_hlen = sizeof(struct virtio_net_hdr_mrg_rxbuf);
>  	} else {
>  		dev->vhost_hlen = sizeof(struct virtio_net_hdr);
> --
> 2.26.2

Reviewed-by: Chenbo Xia <chenbo.xia@intel.com>


  reply	other threads:[~2020-10-09  6:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01 10:11 [dpdk-dev] [PATCH 0/2] Fix packed ring header len Maxime Coquelin
2020-10-01 10:11 ` [dpdk-dev] [PATCH 1/2] vhost: fix Virtio-net header len with packed ring Maxime Coquelin
2020-10-09  6:33   ` Xia, Chenbo [this message]
2020-10-01 10:11 ` [dpdk-dev] [PATCH 2/2] vhost: use fixed Virtio-net header len " Maxime Coquelin
2020-10-09  6:36   ` Xia, Chenbo
2020-10-09  7:23     ` Maxime Coquelin
2020-10-09  7:23 ` [dpdk-dev] [PATCH 0/2] Fix packed ring header len Maxime Coquelin

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=MN2PR11MB40635D421438EE1108273A869C080@MN2PR11MB4063.namprd11.prod.outlook.com \
    --to=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    --cc=yong.liu@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.