From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id D493B201 for ; Tue, 5 Apr 2016 05:20:08 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 04 Apr 2016 20:20:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,442,1455004800"; d="scan'208";a="778159511" Received: from shwdeisgchi083.ccr.corp.intel.com (HELO [10.239.67.193]) ([10.239.67.193]) by orsmga003.jf.intel.com with ESMTP; 04 Apr 2016 20:20:06 -0700 To: Rich Lane , dev@dpdk.org References: <1459822261-95284-1-git-send-email-rlane@bigswitch.com> Cc: Huawei Xie , Yuanhan Liu , Stephen Hemminger From: "Tan, Jianfeng" Message-ID: <57032EE5.4050408@intel.com> Date: Tue, 5 Apr 2016 11:20:05 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <1459822261-95284-1-git-send-email-rlane@bigswitch.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header 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: Tue, 05 Apr 2016 03:20:09 -0000 Hi, On 4/5/2016 10:11 AM, Rich Lane wrote: > For simple TX the virtio-net header must be zeroed, but it was using memory > that had been initialized with indirect descriptor tables. This resulted in > "unsupported gso type" errors from librte_vhost. > > We can use the same memory for every descriptor to save cachelines in the > vswitch. Pointing all virtio_net_hdr into the same memory may brings performance, but how much? It also introduces difficulty to adding tso in future? Thanks, Jianfeng > > Fixes: 6dc5de3a (virtio: use indirect ring elements) > Signed-off-by: Rich Lane > --- > v1-v2: > - Use offsetof to get address of tx_hdr > > drivers/net/virtio/virtio_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/virtio/virtio_rxtx.c b/drivers/net/virtio/virtio_rxtx.c > index 2b88efd..ef21d8e 100644 > --- a/drivers/net/virtio/virtio_rxtx.c > +++ b/drivers/net/virtio/virtio_rxtx.c > @@ -377,7 +377,7 @@ virtio_dev_vring_start(struct virtqueue *vq, int queue_type) > vq->vq_ring.desc[i + mid_idx].next = i; > vq->vq_ring.desc[i + mid_idx].addr = > vq->virtio_net_hdr_mem + > - i * vq->hw->vtnet_hdr_size; > + offsetof(struct virtio_tx_region, tx_hdr); > vq->vq_ring.desc[i + mid_idx].len = > vq->hw->vtnet_hdr_size; > vq->vq_ring.desc[i + mid_idx].flags =