From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A0383A00C2 for ; Wed, 4 Jan 2023 03:35:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9AC1B40698; Wed, 4 Jan 2023 03:35:08 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 67BD640697 for ; Wed, 4 Jan 2023 03:35:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672799707; x=1704335707; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=uixJm7Uvd5HIr0v9XcRIg0iHDXPm9FL9qYZ8/mEL4UM=; b=QIOHzrbfC6AHGy8QPuAAcrWUmjd252rP4eyWD43t/LJNHgyABM3vIcJV zGE61hXSjAdTsiMY+CU5IiFXl3/povQCtCnMU/YCurNd6VMOrntCg+7g4 arOcS/DOObBji8jB513fwB5HaYbUYC85xELeWhwntoOYsNTRvCdl0F4jg aAwz0+1VZaOMJ1ARMO201USuZuevu12pSYp4UMFMwMOLJ+XvnkBbWE4DZ iwnHXLtXoB8EvcQt/SQ/9L78onSq5d/iCSFYZxOwKIOwy4ANCB413pWnx vWlcKCA38gR0M5/FvoljBksFrH847t7Rj0MOeZxV+DPzGP8XEMdvoD6Ad A==; X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="301501421" X-IronPort-AV: E=Sophos;i="5.96,297,1665471600"; d="scan'208";a="301501421" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 18:35:06 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10579"; a="605036360" X-IronPort-AV: E=Sophos;i="5.96,297,1665471600"; d="scan'208";a="605036360" Received: from unknown (HELO localhost.localdomain) ([10.239.252.251]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jan 2023 18:35:03 -0800 From: Wenwu Ma To: maxime.coquelin@redhat.com, chenbo.xia@intel.com, stable@dpdk.org Cc: jiayu.hu@intel.com, yinan.wang@intel.com, weix.ling@intel.com, cheng1.jiang@intel.com, Wenwu Ma Subject: [PATCH] vhost: fix net header settings in vhost datapath Date: Wed, 4 Jan 2023 10:31:15 +0800 Message-Id: <20230104023115.6565-1-wenwux.ma@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 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 In vhost sync batch enqueue, the "num_buffers" of virtio net header is not be set, but it should be set to 1 if the mrg_rxbuf feature is turned on, This patch fix the issue. Fixes: ef861692c398 ("vhost: add packed ring batch enqueue") Cc: stable@dpdk.org Signed-off-by: Wenwu Ma --- lib/vhost/virtio_net.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index cf796183a0..61d9052a57 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -1493,6 +1493,12 @@ virtio_dev_rx_batch_packed_copy(struct virtio_net *dev, sizeof(struct virtio_net_hdr_mrg_rxbuf); } + if (rxvq_is_mergeable(dev)) { + vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) { + ASSIGN_UNLESS_EQUAL(hdrs[i]->num_buffers, 1); + } + } + vhost_for_each_try_unroll(i, 0, PACKED_BATCH_SIZE) virtio_enqueue_offload(pkts[i], &hdrs[i]->hdr); -- 2.25.1