From: Taehee Yoo <ap420073@gmail.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>, Jakub Kicinski <kuba@kernel.org>
Cc: Jamal Hadi Salim <hadi@mojatatu.com>,
Eric Dumazet <edumazet@google.com>,
Victor Nogueira <victor@mojatatu.com>,
xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net,
pabeni@redhat.com, daniel@iogearbox.net, dcaratti@redhat.com,
netdev@vger.kernel.org, kernel@mojatatu.com
Subject: Re: [PATCH net-next v3 2/3] net: sched: Make tc-related drop reason more flexible for remaining qdiscs
Date: Fri, 15 Dec 2023 02:18:13 +0900 [thread overview]
Message-ID: <fecd5da8-4657-3454-b64d-d3f07b071a5d@gmail.com> (raw)
In-Reply-To: <CAM0EoM=+zoLNc2JihS4Xyz77YciKCywXdtr8N3cDuwYRxc8TcQ@mail.gmail.com>
On 12/15/23 00:31, Jamal Hadi Salim wrote:
Hi Jamal,
> On Wed, Dec 13, 2023 at 4:08 PM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Wed, 13 Dec 2023 13:36:31 -0500 Jamal Hadi Salim wrote:
>>> Putting this to rest:
>>> Other than fq codel, the others that deal with multiple skbs due to
>>> gso segments. So the conclusion is: if we have a bunch in the list
>>> then they all suffer the same fate. So a single reason for the list is
>>> sufficient.
>>
>> Alright.
>>
>> I'm still a bit confused about the cb, tho.
>>
>> struct qdisc_skb_cb is the state struct.
>
> Per packet state within tc though, no? Once it leaves tc whatever sits
> in that space cant be trusted to be valid.
> To answer your earlier question tcf_result is not available at the
> qdisc level (when we call free_skb_list() but cb is and thats why we
> used it)
>
>> But we put the drop reason in struct tc_skb_cb.
>> How does that work. Qdiscs will assume they own all of
>> qdisc_skb_cb::data ?
>>
>
> Short answer, yes. Anyone can scribble over that. And multiple
> consumers have a food fight going on - but it is expected behavior:
> ebpf's skb->cb, cake, fq_codel etc - all use qdisc_skb_cb::data.
> Out of the 48B in skb->cb qdisc_skb_cb redefined the first 28B and
> left in qdisc_skb_cb::data as free-for-all space. I think,
> unfortunately, that is now cast in stone.
> Which still leaves us 20 bytes which is now being squatered by
> tc_skb_cb where the drop reason was placed. Shit, i just noticed this
> is not exclusive - seems like
> drivers/net/amt.c is using this space - not sure why it is even using
> tc space. I am wondering if we can make it use the 20B scratch pad.
> +Cc author Taehee Yoo - it doesnt seem to conflict but strange that it
> is considering qdisc_skb_cb
The reason why amt considers qdisc_skb_cb is to not use CB area the TC
is using.
When amt driver send igmp/mld packet, it stores tunnel data in CB before
calling dev_queue_xmit().
Then, it uses that tunnel data from CB in the amt_dev_xmit().
So, amt CB area should not be used by TC, this is the reason why it
considers qdisc_skb_cb size.
But It looks wrong, it should use tc_skb_cb instead of qdisc_skb_cb to
fully avoid CB area of TC, right?
>
>> Maybe some documentation about the lifetimes of these things
>> would clarify things?
>
> What text do you think makes sense and where should it go?
>
> cheers,
> jamal
next prev parent reply other threads:[~2023-12-14 17:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-05 20:50 [PATCH net-next v3 0/3] net: sched: Make tc-related drop reason more flexible for remaining qdiscs Victor Nogueira
2023-12-05 20:50 ` [PATCH net-next v3 1/3] net: sched: Move drop_reason to struct tc_skb_cb Victor Nogueira
2023-12-05 21:17 ` Daniel Borkmann
2023-12-11 13:37 ` Simon Horman
2023-12-05 20:50 ` [PATCH net-next v3 2/3] net: sched: Make tc-related drop reason more flexible for remaining qdiscs Victor Nogueira
2023-12-05 21:20 ` Daniel Borkmann
2023-12-11 13:38 ` Simon Horman
2023-12-12 2:25 ` Jakub Kicinski
2023-12-12 16:27 ` Jamal Hadi Salim
2023-12-12 16:57 ` Eric Dumazet
2023-12-12 17:16 ` Jamal Hadi Salim
2023-12-13 18:36 ` Jamal Hadi Salim
2023-12-13 21:08 ` Jakub Kicinski
2023-12-14 15:31 ` Jamal Hadi Salim
2023-12-14 17:18 ` Taehee Yoo [this message]
2023-12-15 14:42 ` Jamal Hadi Salim
2023-12-14 18:01 ` Jakub Kicinski
2023-12-05 20:50 ` [PATCH net-next v3 3/3] net: sched: Add initial TC error skb drop reasons Victor Nogueira
2023-12-11 13:38 ` Simon Horman
2023-12-12 2:30 ` Jakub Kicinski
2023-12-13 18:25 ` Victor Nogueira
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=fecd5da8-4657-3454-b64d-d3f07b071a5d@gmail.com \
--to=ap420073@gmail.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dcaratti@redhat.com \
--cc=edumazet@google.com \
--cc=hadi@mojatatu.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel@mojatatu.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=victor@mojatatu.com \
--cc=xiyou.wangcong@gmail.com \
/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).