From: Jason Wang <hidden> Date: 2018-03-14 03:23:46
Now we have ndo_xdp_xmit, switch to use it instead of the slow generic
XDP TX routine. XDP_TX on TAP gets ~20% improvements from ~1.5Mpps to
~1.8Mpps on 2.60GHz Core(TM) i7-5600U.
Signed-off-by: Jason Wang <redacted>
---
drivers/net/tun.c | 19 ++++++++-----------
1 file changed, 8 insertions(+), 11 deletions(-)
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2018-03-14 03:37:42
On Wed, Mar 14, 2018 at 11:23:40AM +0800, Jason Wang wrote:
Now we have ndo_xdp_xmit, switch to use it instead of the slow generic
XDP TX routine. XDP_TX on TAP gets ~20% improvements from ~1.5Mpps to
~1.8Mpps on 2.60GHz Core(TM) i7-5600U.
Signed-off-by: Jason Wang <redacted>
From: David Miller <davem@davemloft.net> Date: 2018-03-14 17:21:45
From: Jason Wang <redacted>
Date: Wed, 14 Mar 2018 11:23:40 +0800
Now we have ndo_xdp_xmit, switch to use it instead of the slow generic
XDP TX routine. XDP_TX on TAP gets ~20% improvements from ~1.5Mpps to
~1.8Mpps on 2.60GHz Core(TM) i7-5600U.
Signed-off-by: Jason Wang <redacted>
From: Jason Wang <hidden> Date: 2018-03-15 08:39:33
On 2018年03月14日 11:37, Michael S. Tsirkin wrote:
quoted
return NULL; case XDP_TX:- xdp_xmit = true;- /* fall through */+ get_page(alloc_frag->page);+ alloc_frag->offset += buflen;+ if (tun_xdp_xmit(tun->dev, &xdp))+ goto err_redirect;+ tun_xdp_flush(tun->dev);
Why do we have to flush here though?
It might be a good idea to document the reason in a code comment.
ndo_xdp_xmit() does not touch doorbell, so we need a ndo_xdp_flush() here. It's the assumption of XDP API I think, so not sure it's worth to mention it here.
Thanks
From: "Michael S. Tsirkin" <mst@redhat.com> Date: 2018-03-15 13:32:09
On Thu, Mar 15, 2018 at 04:39:25PM +0800, Jason Wang wrote:
On 2018年03月14日 11:37, Michael S. Tsirkin wrote:
quoted
quoted
return NULL; case XDP_TX:- xdp_xmit = true;- /* fall through */+ get_page(alloc_frag->page);+ alloc_frag->offset += buflen;+ if (tun_xdp_xmit(tun->dev, &xdp))+ goto err_redirect;+ tun_xdp_flush(tun->dev);
Why do we have to flush here though?
It might be a good idea to document the reason in a code comment.
ndo_xdp_xmit() does not touch doorbell, so we need a ndo_xdp_flush() here.
It's the assumption of XDP API I think, so not sure it's worth to mention it
here.
Thanks
Can't one flush we called after multiple xmit calls?
From: Jason Wang <hidden> Date: 2018-03-16 06:46:30
On 2018年03月15日 21:32, Michael S. Tsirkin wrote:
On Thu, Mar 15, 2018 at 04:39:25PM +0800, Jason Wang wrote:
quoted
On 2018年03月14日 11:37, Michael S. Tsirkin wrote:
quoted
quoted
return NULL; case XDP_TX:- xdp_xmit = true;- /* fall through */+ get_page(alloc_frag->page);+ alloc_frag->offset += buflen;+ if (tun_xdp_xmit(tun->dev, &xdp))+ goto err_redirect;+ tun_xdp_flush(tun->dev);
Why do we have to flush here though?
It might be a good idea to document the reason in a code comment.
ndo_xdp_xmit() does not touch doorbell, so we need a ndo_xdp_flush() here.
It's the assumption of XDP API I think, so not sure it's worth to mention it
here.
Thanks
Can't one flush we called after multiple xmit calls?
We can and could be another patch on top. But I want to unify it with the batching of XDP_REDIRECT by e.g let vhost submit more than one packets through msg.control in sendmsg().
Thanks