From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [119.145.14.66]) by dpdk.org (Postfix) with ESMTP id 1EE645592 for ; Fri, 14 Oct 2016 09:31:21 +0200 (CEST) Received: from 172.24.1.47 (EHLO SZXEML424-HUB.china.huawei.com) ([172.24.1.47]) by szxrg03-dlp.huawei.com (MOS 4.4.3-GA FastPath queued) with ESMTP id CJI56320; Fri, 14 Oct 2016 15:30:40 +0800 (CST) Received: from [127.0.0.1] (10.177.20.223) by SZXEML424-HUB.china.huawei.com (10.82.67.153) with Microsoft SMTP Server id 14.3.235.1; Fri, 14 Oct 2016 15:30:36 +0800 To: Yuanhan Liu References: <1471939839-29778-1-git-send-email-yuanhan.liu@linux.intel.com> <57FA2014.1020904@huawei.com> <20161010080339.GC1597@yliu-dev.sh.intel.com> CC: , Maxime Coquelin From: linhaifeng Message-ID: <5800899B.8080604@huawei.com> Date: Fri, 14 Oct 2016 15:30:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20161010080339.GC1597@yliu-dev.sh.intel.com> Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.20.223] X-CFilter-Loop: Reflected 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: Fri, 14 Oct 2016 07:31:23 -0000 在 2016/10/10 16:03, Yuanhan Liu 写道: > 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. > > . > It ok to set data_off zero. But we also can use 128 bytes headromm when guest use virtio_net PMD but not for virtio_net kernel driver. I think it's better to add headroom size to desc and kernel dirver support set headroom size.