public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Daniel Borkmann <daniel@iogearbox•net>
To: Alexei Starovoitov <ast@plumgrid•com>,
	"Devon H. O'Dell" <dho@fastly•com>
Cc: davem@davemloft•net, edumazet@google•com, netdev@vger•kernel.org
Subject: Re: [PATCH net-next] bpf, skb_do_redirect: clear sender_cpu before xmit
Date: Fri, 09 Oct 2015 19:33:14 +0200	[thread overview]
Message-ID: <5617FA5A.9090406@iogearbox.net> (raw)
In-Reply-To: <561727D5.2070001@plumgrid.com>

On 10/09/2015 04:35 AM, Alexei Starovoitov wrote:
> On 10/8/15 5:50 PM, Devon H. O'Dell wrote:
>>> with the amount of skb_sender_cpu_clear() all over the code base
>>> >I wonder whether there is a better solution to all of these.
>> I think there is. We found that splitting the union of sender_cpu and
>> napi_id solved the issue for us. In general, I think this is an OK
>> solution as long as the following hold:
>>
>>   * skbs are always allocated via kzalloc
>>   * out -> out cloned skbs are always cloned on the same CPU
>>   * an extra four bytes in skbuff isn't a bad thing
>
> I'm pretty sure extending sk_buff for this is not acceptable.

+1, I agree.

> I was thinking may be we can use sign bit to distinguish between
> napi_id and sender_cpu.
> Like:
>          if ((int)skb->sender_cpu >= 0)
>                  skb->sender_cpu = - (raw_smp_processor_id() + 1);
> and inside get_xps_queue() use it only if it's negative.
> Then we can remove skb_sender_cpu_clear() from everywhere.
> Adding a check to napi_hash_add() to make sure that napi_id is not
> negative is probably ok too.
> Thoughts?

I think this doesn't make it any more maintainable.

skb_sender_cpu_clear(), one can at least git-grep to easily find
out and review call-sites in the code. There are various members
already used differently depending on the context.

Thanks,
Daniel

  parent reply	other threads:[~2015-10-09 17:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-07  8:16 [PATCH net-next] bpf, skb_do_redirect: clear sender_cpu before xmit Daniel Borkmann
2015-10-07 15:46 ` Alexei Starovoitov
2015-10-09  0:50   ` Devon H. O'Dell
2015-10-09  2:35     ` Alexei Starovoitov
2015-10-09 16:40       ` Devon H. O'Dell
2015-10-10  3:11         ` Alexei Starovoitov
2015-10-09 17:33       ` Daniel Borkmann [this message]
2015-10-10  3:19         ` Alexei Starovoitov
2015-10-10  4:38           ` Eric Dumazet
2015-10-10  4:55             ` Alexei Starovoitov
2015-10-10  4:56             ` Alexei Starovoitov
2015-10-10 17:12               ` Eric Dumazet
2015-11-16 18:07         ` Eric Dumazet
2015-10-08 12:07 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5617FA5A.9090406@iogearbox.net \
    --to=daniel@iogearbox$(echo .)net \
    --cc=ast@plumgrid$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=dho@fastly$(echo .)com \
    --cc=edumazet@google$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox