From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Hemminger Subject: Re: [PATCH 3/4] virtio: use indirect ring elements Date: Sun, 6 Sep 2015 11:43:55 -0700 Message-ID: <20150906114355.5282e5b8@urahara> References: <1441400308-5725-1-git-send-email-stephen@networkplumber.org> <1441400308-5725-4-git-send-email-stephen@networkplumber.org> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" To: "Ouyang, Changchun" Return-path: Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by dpdk.org (Postfix) with ESMTP id E5A505693 for ; Sun, 6 Sep 2015 20:43:43 +0200 (CEST) Received: by padhy16 with SMTP id hy16so71352149pad.1 for ; Sun, 06 Sep 2015 11:43:43 -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" On Sun, 6 Sep 2015 08:40:44 +0000 "Ouyang, Changchun" wrote: > > @@ -220,11 +221,26 @@ virtqueue_enqueue_xmit(struct virtqueue *txvq, > > struct rte_mbuf *cookie) > > dxp = &txvq->vq_descx[idx]; > > dxp->cookie = (void *)cookie; > > dxp->ndescs = needed; > > - > > start_dp = txvq->vq_ring.desc; > > - start_dp[idx].addr = > > - txvq->virtio_net_hdr_mem + idx * head_size; > > - start_dp[idx].len = (uint32_t)head_size; > > + > > + if (use_indirect) { > > + offs = offsetof(struct virtio_tx_region, tx_indir) > > + + idx * sizeof(struct virtio_tx_region); > > + > > + start_dp[idx].addr = txvq->virtio_net_hdr_mem + offs; > > + start_dp[idx].len = sizeof(struct vring_desc); > > Should the length be N * sizeof(struct vring_desc)? Yes.