Re: [net PATCH 1/4] virtio_net: disable XDP_REDIRECT in receive_mergeable() case
From: Jason Wang <hidden>
Date: 2018-02-27 02:29:10
On 2018年02月27日 10:25, Jason Wang wrote:
On 2018年02月27日 08:40, Michael S. Tsirkin wrote:quoted
quoted
IMHO we should consider NOT supporting XDP in receive_mergeable() at all, because the principles behind XDP are to gain speed by (1) code simplicity, (2) sacrificing memory and (3) where possible moving runtime checks to setup time. These principles are clearly being violated in receive_mergeable(), that e.g. runtime track average buffer size to save memory consumption. In the longer run, we should consider introducing a separate receive function when attaching an XDP program, and also change the memory model to be compatible with XDP when attaching an XDP prog.I agree with a separate function approach. So each buffer is tagged as xdp/non xdp, we check that and handle appropriately - where non xdp could be handled by the generic path.If we want to have separated function, should we do it for all XDP capable drivers instead of virtio-net only? Thanks
What's more, since we don't stop device during XDP set. Even if a buffer is tagged as xdp/non xdp during refill, we still can't make sure whether or not XDP was used at receive function. So we can not handle them separately. Thanks