[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87jyxt4w9k.fsf@toke.dk>
Date: Wed, 07 Jan 2026 10:17:27 +0100
From: Toke Høiland-Jørgensen <toke@...e.dk>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>, Jamal Hadi Salim
<jhs@...atatu.com>, Cong Wang <xiyou.wangcong@...il.com>, Jiri Pirko
<jiri@...nulli.us>, "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>, Simon Horman <horms@...nel.org>
Cc: Jonas Köppeler <j.koeppeler@...berlin.de>,
cake@...ts.bufferbloat.net,
netdev@...r.kernel.org
Subject: Re: [PATCH net-next v6 2/6] net/sched: sch_cake: Factor out config
variables into separate struct
Willem de Bruijn <willemdebruijn.kernel@...il.com> writes:
>> static int cake_init(struct Qdisc *sch, struct nlattr *opt,
>> struct netlink_ext_ack *extack)
>> {
>> - struct cake_sched_data *q = qdisc_priv(sch);
>> + struct cake_sched_data *qd = qdisc_priv(sch);
>> + struct cake_sched_config *q;
>> int i, j, err;
>>
>> + q = kvcalloc(1, sizeof(struct cake_sched_config), GFP_KERNEL);
>> + if (!q)
>> + return -ENOMEM;
>> +
>
> Can this just be a regular kzalloc?
Yeah, I guess so. I'll change this if there's a need to respin for other
reasons, but probably not worth respinning for this on its own? Seeing
as it'll all end up in the same kmalloc call anyway :)
> More importantly, where is q assigned to qd->config after init?
Just below:
>> sch->limit = 10240;
>> sch->flags |= TCQ_F_DEQUEUE_DROPS;
>>
>> @@ -2742,33 +2755,36 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt,
>> * for 5 to 10% of interval
>> */
>> q->rate_flags |= CAKE_FLAG_SPLIT_GSO;
>> - q->cur_tin = 0;
>> - q->cur_flow = 0;
>> + qd->cur_tin = 0;
>> + qd->cur_flow = 0;
>> + qd->config = q;
Here: ^^^^^^^
-Toke
Powered by blists - more mailing lists