Message ID | 1459822261-95284-1-git-send-email-rlane@bigswitch.com (mailing list archive) |
---|---|
State | Accepted, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 3F787137C; Tue, 5 Apr 2016 04:11:11 +0200 (CEST) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by dpdk.org (Postfix) with ESMTP id E5602370 for <dev@dpdk.org>; Tue, 5 Apr 2016 04:11:09 +0200 (CEST) Received: by mail-pa0-f41.google.com with SMTP id fe3so12540pab.1 for <dev@dpdk.org>; Mon, 04 Apr 2016 19:11:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bigswitch-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=b+2S7C5lMlFrUMimKuroaoLUy8/cB4bgRShcBPAe6wI=; b=RD+TOjVXWH5fSCPpFQWxEfBWWzQPWNOlCB8q6GyQn0nlIE6XsyMtCULBL3MGOM/AGl Uhqo2axHZ69Uy4bcw7UqinEr5WFjugn+nvRsaaotezkbjyoTLbNP3+h2eHPbKGz9jDWD zZwVocsslA0nTt/T5b0DQlCsFmGygCCIYR2R2RPMXdTmhqNA52cSUottK36wUB7RLHzK aXcWB6jNa8z6Jb/FL+O3Hv/Yk9HLMDK8fPS6VbjAQj96q0PwmJnyj0VmXZOjJYkFYVQl tT+YYp4eaObzWYLU2cve9cA7WG7Cnv3rhYmg110DDiEWwoC6M03SvXwpiBFxogpwavg5 xjAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=b+2S7C5lMlFrUMimKuroaoLUy8/cB4bgRShcBPAe6wI=; b=MWaQeDXZ3J2yOfXJJqIzaPNZWWn/kAEkmuQYcFoJbOqwfOUCjDIH6NqAamwJBDAY+Q X4ER9B5rUZSidbsBt+FcuzgwO4xb6WqjSLh1rqxC7jumwdiTc91K5qdAR4NiTW7pDDO+ 9s+9CaQbjJ70AdLoGytn0OMFP8CrqQXp0sE70AgONaWUooocwAF4PcZFdtNNamot8eH2 z9jAcrqjFHyzHP/XfTU36NwzKkfN4jS4XRnW4pvIKc3IV1mcxYETGC9bs0cwA3LjvvdO Ze9s9N5m+ghNRjjYzIRJ57B+LtxYJLsOtv04jssHaVqXIAGNWXYRByGULvss5BUX3bP0 TpNw== X-Gm-Message-State: AD7BkJJdKO7xsKOXIKV4hcuDx/RcDo8V8gp+5D7/AT01NhuX47qwqF3fiIAFgBSwEV8MZICK X-Received: by 10.66.218.196 with SMTP id pi4mr57893131pac.147.1459822269341; Mon, 04 Apr 2016 19:11:09 -0700 (PDT) Received: from rlane-work.eng.bigswitch.com (c-67-188-28-208.hsd1.ca.comcast.net. [67.188.28.208]) by smtp.gmail.com with ESMTPSA id 27sm42322166pfo.58.2016.04.04.19.11.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 Apr 2016 19:11:08 -0700 (PDT) From: Rich Lane <rich.lane@bigswitch.com> X-Google-Original-From: Rich Lane <rlane@bigswitch.com> To: dev@dpdk.org Cc: Huawei Xie <huawei.xie@intel.com>, Yuanhan Liu <yuanhan.liu@linux.intel.com>, Stephen Hemminger <stephen@networkplumber.org> Date: Mon, 4 Apr 2016 19:11:01 -0700 Message-Id: <1459822261-95284-1-git-send-email-rlane@bigswitch.com> X-Mailer: git-send-email 1.9.1 Subject: [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 <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Rich Lane
April 5, 2016, 2:11 a.m. UTC
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.
Fixes: 6dc5de3a (virtio: use indirect ring elements)
Signed-off-by: Rich Lane <rlane@bigswitch.com>
---
v1-v2:
- Use offsetof to get address of tx_hdr
drivers/net/virtio/virtio_rxtx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
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 <rlane@bigswitch.com> > --- > 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 =
On Mon, Apr 04, 2016 at 07:11:01PM -0700, 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. > > Fixes: 6dc5de3a (virtio: use indirect ring elements) > Signed-off-by: Rich Lane <rlane@bigswitch.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Thanks. --yliu
On Tue, Apr 05, 2016 at 11:20:05AM +0800, Tan, Jianfeng wrote: > 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? simple rxtx will not be enabled when TSO is enabled. --yliu
Hi, On 4/5/2016 12:26 PM, Yuanhan Liu wrote: > On Tue, Apr 05, 2016 at 11:20:05AM +0800, Tan, Jianfeng wrote: >> 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? > simple rxtx will not be enabled when TSO is enabled. Yes, I was missing simple rxtx is conflicting with ETH_TXQ_FLAGS_NOOFFLOADS, which indicates that simple rxtx does not want to fill any fields in the hdr. Acked-by: Jianfeng Tan <jianfeng.tan@intel.com> Thanks, Jianfeng > > --yliu
> > 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. > > > > Fixes: 6dc5de3a (virtio: use indirect ring elements) > > Signed-off-by: Rich Lane <rlane@bigswitch.com> > > Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Applied, thanks
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 =