From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 3B08B6A73 for ; Mon, 10 Oct 2016 10:02:49 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 10 Oct 2016 01:02:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,471,1473145200"; d="scan'208";a="1062698257" Received: from yliu-dev.sh.intel.com (HELO yliu-dev) ([10.239.67.162]) by orsmga002.jf.intel.com with ESMTP; 10 Oct 2016 01:02:46 -0700 Date: Mon, 10 Oct 2016 16:03:39 +0800 From: Yuanhan Liu To: linhaifeng Cc: dev@dpdk.org, Maxime Coquelin Message-ID: <20161010080339.GC1597@yliu-dev.sh.intel.com> References: <1471939839-29778-1-git-send-email-yuanhan.liu@linux.intel.com> <57FA2014.1020904@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <57FA2014.1020904@huawei.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH 0/6] vhost: add Tx zero copy support 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: Mon, 10 Oct 2016 08:02:49 -0000 On Sun, Oct 09, 2016 at 06:46:44PM +0800, linhaifeng wrote: > 在 2016/8/23 16:10, Yuanhan Liu 写道: > > The basic idea of Tx zero copy is, instead of copying data from the > > desc buf, here we let the mbuf reference the desc buf addr directly. > > Is there problem when push vlan to the mbuf which reference the desc buf addr directly? Yes, you can't do that when zero copy is enabled, due to following code piece: + if (unlikely(dev->dequeue_zero_copy && (hpa = gpa_to_hpa(dev, + desc->addr + desc_offset, cpy_len)))) { + cur->data_len = cpy_len; ==> + cur->data_off = 0; + cur->buf_addr = (void *)(uintptr_t)desc_addr; + cur->buf_physaddr = hpa; The marked line basically makes the mbuf has no headroom to use. --yliu > We know if guest use virtio_net(kernel) maybe skb has no headroom.