From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=HpcZcoN5AdClm/+SsrXFibPOHZUEJrRJKAQU7dLtNcM=; b=XccAFYraWNsgv7pgIPTUtN5Ynrt5HgUORtTKODCvhV/NvTPo1ne8lWIlrL2+4C6xBZ Acsl1NocOxoSHqn9dWqAToUZ9+ZT6DpPhphpztl69M/P4VIRhp0or2vy6F5yw8OgPGm9 y9QDA796hl/WHPyao0SG8kso1WwQvuNsrV4qXZfaOp9qFuBU8uSgLgvGPuJnogPQLsnA 59gYJ7nSuq9e1Yzz9cuQMAcY85Yl/INmEznQmq7SdL+1ZAdt0rQ5s+PHLoUCaGn0hgln 5LLq+u0BmdowqlMXSLnGetI1iprd86C6TxvYyQlIDjvTRNbiUwEkUUlDrskKC82nr0gp OtrQ== X-Gm-Message-State: ALoCoQlB78vFUKjMxz6DMj9TLEQioRFOPvui9P9UC8qXaGs/mGLShyrpyxjT2qyUjmIrtALLmfSa X-Received: by 10.69.17.1 with SMTP id ga1mr35886956pbd.163.1441565023343; Sun, 06 Sep 2015 11:43:43 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by smtp.gmail.com with ESMTPSA id pq2sm1998037pdb.18.2015.09.06.11.43.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 06 Sep 2015 11:43:43 -0700 (PDT) Date: Sun, 6 Sep 2015 11:43:55 -0700 From: Stephen Hemminger To: "Ouyang, Changchun" Message-ID: <20150906114355.5282e5b8@urahara> In-Reply-To: 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" Subject: Re: [dpdk-dev] [PATCH 3/4] virtio: use indirect ring elements 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: Sun, 06 Sep 2015 18:43:44 -0000 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.