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 6313AA0032; Fri, 24 Jun 2022 07:42:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53E2E40A87; Fri, 24 Jun 2022 07:42:29 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 9C6A240A82 for ; Fri, 24 Jun 2022 07:42:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656049348; x=1687585348; h=from:to:cc:subject:date:message-id; bh=xKzAFiZxMO3MVX+a+wxwpdzyCXu+87Dq6M31kuAq/Wk=; b=j8cbJfh8o48+8p05vMhY+lLiCjtZ8g6L1D8jZ18uhoDp1QagcS8Erl3j XybXGwFqMAZLXDz3ojDqvgDqHnT+fJjTgY4U8stw2gjtHDPLiBgkP9576 ENexJdhtVhqzvEE0LP3Ef+Xdrry2HhG+0kqL+VVJZ9GBmTID82wu5mOxQ rugqApUiYgV9iFeqf+xf2Yk5Jnl08X6w1FjX6W99dAN41rK7wIsQwhrFd Q76iF0xG/PiEirEfz25aYik6Y0IN9lJRKz7dXK5iSgPU0ve8M9iShiCEC /IZmIfJXc6+SxIntBNYmHEUUWuyOruMx9VImwCMBCBM/VjSmxsMcgfDkp A==; X-IronPort-AV: E=McAfee;i="6400,9594,10387"; a="281661413" X-IronPort-AV: E=Sophos;i="5.92,218,1650956400"; d="scan'208";a="281661413" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Jun 2022 22:42:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,218,1650956400"; d="scan'208";a="593070518" Received: from npg-dpdk-xuan-cbdma.sh.intel.com ([10.67.110.228]) by fmsmga007.fm.intel.com with ESMTP; 23 Jun 2022 22:42:24 -0700 From: xuan.ding@intel.com To: maxime.coquelin@redhat.com, chenbo.xia@intel.com Cc: dev@dpdk.org, jiayu.hu@intel.com, weix.ling@intel.com, Xuan Ding Subject: [PATCH] vhost: fix sync dequeue offload Date: Fri, 24 Jun 2022 05:38:24 +0000 Message-Id: <20220624053824.31432-1-xuan.ding@intel.com> X-Mailer: git-send-email 2.17.1 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org From: Xuan Ding This patch fixes the missing virtio net header copy in sync dequeue path caused by refactoring, which affects dequeue offloading. Fixes: 6d823bb302c7("vhost: prepare sync for descriptor to mbuf refactoring") Signed-off-by: Xuan Ding --- lib/vhost/virtio_net.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 68a26eb17d..d5a9f7c691 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -2635,9 +2635,17 @@ desc_to_mbuf(struct virtio_net *dev, struct vhost_virtqueue *vq, buf_iova + buf_offset, cpy_len, false) < 0) goto error; } else { - sync_fill_seg(dev, vq, cur, mbuf_offset, - buf_addr + buf_offset, - buf_iova + buf_offset, cpy_len, false); + if (hdr && cur == m) { + rte_memcpy(rte_pktmbuf_mtod_offset(cur, void *, mbuf_offset), + (void *)((uintptr_t)(buf_addr + buf_offset)), + cpy_len); + vhost_log_cache_write_iova(dev, vq, buf_iova + buf_offset, cpy_len); + PRINT_PACKET(dev, (uintptr_t)(buf_addr + buf_offset), cpy_len, 0); + } else { + sync_fill_seg(dev, vq, cur, mbuf_offset, + buf_addr + buf_offset, + buf_iova + buf_offset, cpy_len, false); + } } mbuf_avail -= cpy_len; -- 2.17.1