Thread (75 messages) flat view 75 messages, 5 authors, 2016-11-29

Re: [PATCH 0/6] vhost: add Tx zero copy support

From: linhaifeng <hidden>
Date: 2016-10-14 07:31:21

在 2016/10/10 16:03, Yuanhan Liu 写道:
On Sun, Oct 09, 2016 at 06:46:44PM +0800, linhaifeng wrote:
quoted
在 2016/8/23 16:10, Yuanhan Liu 写道:
quoted
The basic idea of Tx zero copy is, instead of copying data from the
desc buf, here we let the mbuf reference the desc buf addr directly.
Is there problem when push vlan to the mbuf which reference the desc buf addr directly?
Yes, you can't do that when zero copy is enabled, due to following code
piece:

    +               if (unlikely(dev->dequeue_zero_copy && (hpa = gpa_to_hpa(dev,
    +                                       desc->addr + desc_offset, cpy_len)))) {
    +                       cur->data_len = cpy_len;
==> +                       cur->data_off = 0;
    +                       cur->buf_addr = (void *)(uintptr_t)desc_addr;
    +                       cur->buf_physaddr = hpa;

The marked line basically makes the mbuf has no headroom to use.

	--yliu
quoted
We know if guest use virtio_net(kernel) maybe skb has no headroom.
.
It ok to set data_off zero.
But we also can use 128 bytes headromm when guest use virtio_net PMD but not for virtio_net kernel driver.

I think it's better to add headroom size to desc and kernel dirver support set headroom size.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help