DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header
@ 2016-04-05  2:11 Rich Lane
  2016-04-05  3:20 ` Tan, Jianfeng
  2016-04-05  4:25 ` Yuanhan Liu
  0 siblings, 2 replies; 6+ messages in thread
From: Rich Lane @ 2016-04-05  2:11 UTC (permalink / raw)
  To: dev; +Cc: Huawei Xie, Yuanhan Liu, Stephen Hemminger

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(-)

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header
  2016-04-05  2:11 [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header Rich Lane
@ 2016-04-05  3:20 ` Tan, Jianfeng
  2016-04-05  4:26   ` Yuanhan Liu
  2016-04-05  4:25 ` Yuanhan Liu
  1 sibling, 1 reply; 6+ messages in thread
From: Tan, Jianfeng @ 2016-04-05  3:20 UTC (permalink / raw)
  To: Rich Lane, dev; +Cc: Huawei Xie, Yuanhan Liu, Stephen Hemminger

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 =

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header
  2016-04-05  2:11 [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header Rich Lane
  2016-04-05  3:20 ` Tan, Jianfeng
@ 2016-04-05  4:25 ` Yuanhan Liu
  2016-04-06 10:28   ` Thomas Monjalon
  1 sibling, 1 reply; 6+ messages in thread
From: Yuanhan Liu @ 2016-04-05  4:25 UTC (permalink / raw)
  To: Rich Lane; +Cc: dev, Huawei Xie, Stephen Hemminger

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header
  2016-04-05  3:20 ` Tan, Jianfeng
@ 2016-04-05  4:26   ` Yuanhan Liu
  2016-04-05  5:34     ` Tan, Jianfeng
  0 siblings, 1 reply; 6+ messages in thread
From: Yuanhan Liu @ 2016-04-05  4:26 UTC (permalink / raw)
  To: Tan, Jianfeng; +Cc: Rich Lane, dev, Huawei Xie, Stephen Hemminger

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header
  2016-04-05  4:26   ` Yuanhan Liu
@ 2016-04-05  5:34     ` Tan, Jianfeng
  0 siblings, 0 replies; 6+ messages in thread
From: Tan, Jianfeng @ 2016-04-05  5:34 UTC (permalink / raw)
  To: Yuanhan Liu; +Cc: Rich Lane, dev, Huawei Xie, Stephen Hemminger

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header
  2016-04-05  4:25 ` Yuanhan Liu
@ 2016-04-06 10:28   ` Thomas Monjalon
  0 siblings, 0 replies; 6+ messages in thread
From: Thomas Monjalon @ 2016-04-06 10:28 UTC (permalink / raw)
  To: Rich Lane; +Cc: dev, Yuanhan Liu, Huawei Xie, Stephen Hemminger

> > 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-06 10:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-05  2:11 [dpdk-dev] [PATCH v2] virtio: use zeroed memory for simple TX header Rich Lane
2016-04-05  3:20 ` Tan, Jianfeng
2016-04-05  4:26   ` Yuanhan Liu
2016-04-05  5:34     ` Tan, Jianfeng
2016-04-05  4:25 ` Yuanhan Liu
2016-04-06 10:28   ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).