On Thu, Mar 15, 2018 at 04:39:25PM +0800, Jason Wang wrote:
Can't one flush we called after multiple xmit calls?
On 2018å03æ14æ 11:37, Michael S. Tsirkin wrote:
ndo_xdp_xmit() does not touch doorbell, so we need a ndo_xdp_flush() here.return NULL;Why do we have to flush here though?
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);
It might be a good idea to document the reason in a code comment.
It's the assumption of XDP API I think, so not sure it's worth to mention it
here.
Thanks