From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:organization:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=ueWH2hPsBX/kdFPJ2gMldkDGlnTkb/n5z8l9jq4/dsM=; b=SPBcTCoNZgkum1binB24jzNeSMMPTm+ZFtVOKSjT8TNziTGP4n3IJdfRZGPyuMBIpU YWfNic7axDj6Kn/LUaCQchPNwMJuvi72xI1Xuq52aTw7iV1mwzqtWuRD1FudYh4sgQ1Z C9GdhvZrR7wec5dSPmE0FeGcB8yUE5q6vyXnRZr4sQdkwkBtUT8Gehg+cGuMXfQi9WAl hkN4WahG1Zkboe+unW0LkCorTvWDkPGY+oQApJSJIapXpt0VUe2kUUsxiInrsU9wJr7u Bxf7C9+W9Cqb8FUEOBWTv6NOeOClQagaj7tVF4QWAErQxcuuXg0utuSr6QGLkAQtuEIY YpqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding; bh=ueWH2hPsBX/kdFPJ2gMldkDGlnTkb/n5z8l9jq4/dsM=; b=bDVeHMk0bxnnaG38mjDQZVcXjMDCZ1NXAGCG0KCud84YSbIC8eYgr0pwQRbckQqMUJ 1WUX4Ng8HCE3myj/RUwzkNm4lvujpQnBwfHg9/5p2MxsaIBoy9H69aavHuTrsVyBf5VE 0KtkUohOL4i+bU4apU4dUcKo9zZUUyOOwJZFJCulUdxP9d/cFcexRSJto2LrRLLtBSkl E+UmHg/5nEqpIPa73d9C5IMKn4Hw8jZU8Z+WzMGdC2oyQoBPh4oQ8c1SZgbOgzT+8aC4 q59pbN5Sww1iw3wvWedEv2dUA97M/eMQYqpr3Zg5sbSbotKsZ5CZi0qGWO49W7j/Rtju 1/rw== X-Gm-Message-State: AD7BkJI+hEahrI9jnJ/KHO8o0hjUMMluUuVNF2DpVqTmHn15aW4idsLBLastFahO1acVt3d3 X-Received: by 10.194.84.2 with SMTP id u2mr12062245wjy.61.1458248021098; Thu, 17 Mar 2016 13:53:41 -0700 (PDT) Received: from xps13.localnet (91.111.75.86.rev.sfr.net. [86.75.111.91]) by smtp.gmail.com with ESMTPSA id ka4sm9292995wjc.47.2016.03.17.13.53.40 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 17 Mar 2016 13:53:40 -0700 (PDT) From: Thomas Monjalon To: Yuanhan Liu Cc: "Xie, Huawei" , dev@dpdk.org Date: Thu, 17 Mar 2016 21:52:10 +0100 Message-ID: <1469207.ypjzrBGlMb@xps13> Organization: 6WIND User-Agent: KMail/4.14.10 (Linux/4.1.6-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: References: <1458110696-4914-1-git-send-email-yuanhan.liu@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] vhost: remove unnecessary memset for virtio net hdr X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 20:53:41 -0000 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