netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jamal Hadi Salim <jhs@mojatatu.com>
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,
	Taehee Yoo <ap420073@gmail.com>
Subject: Re: [PATCH net-next v3 2/3] net: sched: Make tc-related drop reason more flexible for remaining qdiscs
Date: Thu, 14 Dec 2023 10:01:54 -0800	[thread overview]
Message-ID: <20231214100154.2298fc8d@kernel.org> (raw)
In-Reply-To: <CAM0EoM=+zoLNc2JihS4Xyz77YciKCywXdtr8N3cDuwYRxc8TcQ@mail.gmail.com>

On Thu, 14 Dec 2023 10:31:24 -0500 Jamal Hadi Salim wrote:
> > 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.

Okay I got it now, for some reason I thought the new fields in
struct tc_skb_cb overlay the data[] in struct qdisc_skb_cb...

  parent reply	other threads:[~2023-12-14 18:01 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
2023-12-15 14:42                   ` Jamal Hadi Salim
2023-12-14 18:01                 ` Jakub Kicinski [this message]
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=20231214100154.2298fc8d@kernel.org \
    --to=kuba@kernel.org \
    --cc=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=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).