From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] vhost: remove unnecessary memset for virtio net hdr Date: Thu, 17 Mar 2016 21:52:10 +0100 Message-ID: <1469207.ypjzrBGlMb@xps13> References: <1458110696-4914-1-git-send-email-yuanhan.liu@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: "Xie, Huawei" , dev@dpdk.org To: Yuanhan Liu Return-path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 393292BE2 for ; Thu, 17 Mar 2016 21:53:41 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id l68so10979051wml.1 for ; Thu, 17 Mar 2016 13:53:41 -0700 (PDT) In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 2016-03-17 01:19, Xie, Huawei: > On 3/16/2016 2:44 PM, Yuanhan Liu wrote: > > We have to reset the virtio net hdr at virtio_enqueue_offload() > > before, due to all mbufs share a single virtio_hdr structure: > > > > struct virtio_net_hdr_mrg_rxbuf virtio_hdr = {{0, }, 0}; > > > > foreach (mbuf) { > > virtio_enqueue_offload(mbuf, &virtio_hdr.hdr); > > > > copy net hdr and mbuf to desc buf > > } > > > > However, after the vhost rxtx refactor, the code looks like: > > > > copy_mbuf_to_desc(mbuf) > > { > > struct virtio_net_hdr_mrg_rxbuf virtio_hdr = {{0, }, 0} > > > > virtio_enqueue_offload(mbuf, &virtio_hdr.hdr); > > > > copy net hdr and mbuf to desc buf > > } > > > > foreach (mbuf) { > > copy_mbuf_to_desc(mbuf); > > } > > > > Therefore, the memset at virtio_enqueue_offload() is not necessary > > any more; remove it. > > > > Signed-off-by: Yuanhan Liu > > Acked-by: Huawei Xie Applied, thanks