From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B2723A04B5 for ; Thu, 1 Oct 2020 12:12:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D63AA1DAE0; Thu, 1 Oct 2020 12:12:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 114D71DAD0 for ; Thu, 1 Oct 2020 12:12:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601547127; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tkCMYcJxPPdDdhRhddMOzRN3LznzZqdglScsrtstOD4=; b=i7y40KUOK2nHp+IDZ4JwyX4ln1lbVvy5Vnzbm5Xq3ND4euTRyZ0b9oYXVbLVtKyGQjG1Yg iE0zez8Oug3aX2OxPDyoQuy+Fou+pilI5pjCGyAf4wv1EpCXXBv/qqctYWWwmvwwHufh/a a7qSmXCTcGsjHBEHNSmBscVRjgCUwig= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-441-9Q8UZ4KgO1ecgLC6cJ7XdA-1; Thu, 01 Oct 2020 06:12:05 -0400 X-MC-Unique: 9Q8UZ4KgO1ecgLC6cJ7XdA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B0A6109106D; Thu, 1 Oct 2020 10:12:04 +0000 (UTC) Received: from localhost.localdomain (unknown [10.36.110.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0759E60DA0; Thu, 1 Oct 2020 10:12:02 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, yong.liu@intel.com Cc: Maxime Coquelin , stable@dpdk.org Date: Thu, 1 Oct 2020 12:11:54 +0200 Message-Id: <20201001101155.206237-2-maxime.coquelin@redhat.com> In-Reply-To: <20201001101155.206237-1-maxime.coquelin@redhat.com> References: <20201001101155.206237-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Subject: [dpdk-stable] [PATCH 1/2] vhost: fix Virtio-net header len with packed ring X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 Signed-off-by: Maxime Coquelin --- 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