* [Cake] Parsing DSCP out of skb->priority
@ 2025-09-07 12:40 Matt Corallo
2025-09-09 10:32 ` [Cake] " Toke Høiland-Jørgensen
0 siblings, 1 reply; 2+ messages in thread
From: Matt Corallo @ 2025-09-07 12:40 UTC (permalink / raw)
To: cake
Its (presumably) not uncommon to have multiple encapsulation tunnels running on a host which then
wants to do (cake) shaping on the actual outbound interface. In this case, the skb->hash is
(hopefully) preserved from the original packet to select the right flow queue, but the DSCP isn't.
This is ideally what the priority field of the skb is for - `skbedit` can set the priority flag of
the packet before "exiting" the tunnel interface, and cake can ultimately read that priority flag to
select a tin. However, doing so requires manual tin mapping in skbedit, reading the DSCP field and
mapping them to the right tin entirely be hand.
skbedit also supports `inheritdsfield` which just sets skb->priority to the DSCP field as-is. It
would be nice if cake could read such priority fields, treating skb->priority as a DSCP when
TC_H_MAJ(skb->priority) is zero (which it always will be in this case). Is there any interest in a
patch to do so? Would such a patch need a new userspace option to disable it, or would wash suffice?
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cake] Re: Parsing DSCP out of skb->priority
2025-09-07 12:40 [Cake] Parsing DSCP out of skb->priority Matt Corallo
@ 2025-09-09 10:32 ` Toke Høiland-Jørgensen
0 siblings, 0 replies; 2+ messages in thread
From: Toke Høiland-Jørgensen @ 2025-09-09 10:32 UTC (permalink / raw)
To: Matt Corallo, cake
Matt Corallo <cltaapptfwbs@mattcorallo.com> writes:
> Its (presumably) not uncommon to have multiple encapsulation tunnels
> running on a host which then wants to do (cake) shaping on the actual
> outbound interface. In this case, the skb->hash is (hopefully)
> preserved from the original packet to select the right flow queue, but
> the DSCP isn't. This is ideally what the priority field of the skb is
> for - `skbedit` can set the priority flag of the packet before
> "exiting" the tunnel interface, and cake can ultimately read that
> priority flag to select a tin. However, doing so requires manual tin
> mapping in skbedit, reading the DSCP field and mapping them to the
> right tin entirely be hand.
>
> skbedit also supports `inheritdsfield` which just sets skb->priority
> to the DSCP field as-is. It would be nice if cake could read such
> priority fields, treating skb->priority as a DSCP when
> TC_H_MAJ(skb->priority) is zero (which it always will be in this
> case). Is there any interest in a patch to do so?
Hmm, we already have quite a few custom ways of assigning packets to
tins, so I'm not sure if it's really a good idea to add another one.
What you're describing is fairly straight-forward to do with a BPF
program, without any performance overhead compared to the mapping cake
itself is doing.
> Would such a patch need a new userspace option to disable it, or would
> wash suffice?
We certainly can't assume that any priority value is a diffserv value
without some sort of explicit opt-in. And adding an option just for this
is really pushing it in the complexity-to-niche-feature trade-off scale :)
-Toke
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-09 10:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-07 12:40 [Cake] Parsing DSCP out of skb->priority Matt Corallo
2025-09-09 10:32 ` [Cake] " Toke Høiland-Jørgensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox