From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 ; Tue, 5 Apr 2016 04:11:09 +0200 (CEST) Received: by mail-pa0-f41.google.com with SMTP id fe3so12540pab.1 for ; 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 X-Google-Original-From: Rich Lane To: dev@dpdk.org Cc: Huawei Xie , Yuanhan Liu , Stephen Hemminger 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2016 02:11:10 -0000 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 --- 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 = -- 1.9.1