Thread (16 messages) 16 messages, 4 authors, 2016-04-06

Re: [PATCH net-next 1/6] net: skbuff: don't use union for napi_id and sender_cpu

From: Jason Wang <jasowang@redhat.com>
Date: 2016-04-06 06:22:29
Also in: lkml


On 04/01/2016 09:04 PM, Eric Dumazet wrote:
On Fri, 2016-04-01 at 12:49 +0800, Jason Wang wrote:
quoted
On 04/01/2016 10:55 AM, Eric Dumazet wrote:
quoted
On Fri, 2016-04-01 at 10:13 +0800, Jason Wang wrote:

quoted
The problem is we want to support busy polling for tun. This needs
napi_id to be passed to tun socket by sk_mark_napi_id() during
tun_net_xmit(). But before reaching this, XPS will set sender_cpu will
make us can't see correct napi_id.
Looks like napi_id should have precedence then ?
But then when busy polling is enabled, we may still hit the issue before
commit 2bd82484bb4c5db1d5dc983ac7c409b2782e0154? So looks like sometimes
(e.g for tun), we need both two fields.
You did not clearly show me the path you take where both fields would be
needed. If you expect me to do that, it wont happen.
Right, since tun does not use XPS. But the stacked device on top of tun
does not know this which may still try to set sender_cpu.
quoted
quoted
Only forwarding should allow the field to be cleared to allow XPS to do
its job.

Maybe skb_sender_cpu_clear() was removed too early (commit
64d4e3431e686dc37ce388ba531c4c4e866fb141)
Not sure I get you, but this will clear napi_id too.
Only when allowed. In your case it would not be called.
Looks like I miss something, there used to be a skb_sender_cpu_clear()
in br_dev_queue_push_xmit() which will be called before tun_net_xmit().
Some people do not use tun, and want to forward or cook millions of
packets per second. sk_buff size is critical. 

If busy polling gives you 5 % of performance improvement, but cost
everyone else a performance decrease, this is a serious problem.

XPS is a sender problem, NAPI is a receiver problem. Fields should be
shared.
How about introduce a napi_id field in softnet_data to record the napi
that is being polled, then sk_mark_napi_id() can fetch napi_id from it
instead of skb?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help