From: Alexei Starovoitov <ast@plumgrid.com>
To: David Miller <davem@davemloft.net>
Cc: jhs@mojatatu.com, daniel@iogearbox.net, jiri@resnulli.us,
netdev@vger.kernel.org
Subject: Re: [PATCH net-next] tc: fix tc actions in case of shared skb
Date: Mon, 13 Jul 2015 13:17:45 -0700 [thread overview]
Message-ID: <55A41CE9.8050907@plumgrid.com> (raw)
In-Reply-To: <20150713.130438.1857789246357119116.davem@davemloft.net>
On 7/13/15 1:04 PM, David Miller wrote:
> From: Alexei Starovoitov <ast@plumgrid.com>
> Date: Mon, 13 Jul 2015 12:47:42 -0700
>
>> In all normal cases skb->users == 1, but pktgen is using trick:
>> atomic_add(burst, &skb->users);
>> so when testing something like:
>
> You can want pktgen rx (which is the only buggy case as far as I can
> see, TX is fine) to run fast, but you must do so by abiding by the
> appropriate SKB sharing rules.
>
> You can't do an optimization in pktgen for RX processing that works
> "some of the time". We have shared SKB rules for a reason.
>
> And I don't want to have to explain to someone in the future why that
> drop check is there, and have to tell them "because pktgen is broken
> and we decided to add a hack here rather than make pktgen send
> properly formed SKBs into the RX path"
>
> Ok?
in general all makes sense, but it is both RX and TX.
Without burst hack we cannot achieve line rate TX.
atomic_add(burst, &pkt_dev->skb->users);
xmit_more:
ret = netdev_start_xmit(pkt_dev->skb, odev, txq, --burst > 0);
in pktgen we check that driver can work with users > 1 via:
pkt_dev->odev->priv_flags & IFF_TX_SKB_SHARING
so real hw driver are mostly ready for users > 1, it's only
few tc actions struggle a bit.
We cannot check tc actions from pktgen, since they can be added
dynamically.
So I see three options:
1 get rid of burst hack for both RX and TX in pktgen (kills performance)
2 add unlikely(skb_shread) check to few tc actions
3 do nothing
I think 2 isn't that bad after all if properly documented with
"because pktgen is doing this hack for performance" ?
I'm fine with 3 too, since the whole pktgen business is for root
and for kernel hackers who suppose to know what they're doing.
next prev parent reply other threads:[~2015-07-13 20:24 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-11 0:10 [PATCH net-next] tc: fix tc actions in case of shared skb Alexei Starovoitov
2015-07-12 4:29 ` David Miller
2015-07-13 19:47 ` Alexei Starovoitov
2015-07-13 20:04 ` David Miller
2015-07-13 20:17 ` Alexei Starovoitov [this message]
2015-07-13 20:55 ` Daniel Borkmann
2015-07-13 22:26 ` Alexei Starovoitov
2015-07-14 10:29 ` Daniel Borkmann
2015-07-14 11:57 ` Jamal Hadi Salim
2015-07-14 12:19 ` Daniel Borkmann
2015-07-14 15:46 ` Alexei Starovoitov
2015-07-14 22:34 ` David Miller
2015-07-14 23:08 ` Alexei Starovoitov
2015-07-15 0:58 ` John Fastabend
2015-07-15 1:01 ` Alexei Starovoitov
2015-07-13 13:13 ` Jamal Hadi Salim
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=55A41CE9.8050907@plumgrid.com \
--to=ast@plumgrid.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).