[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d3a32766-550c-11a1-4364-98f876e7ce12@suse.de>
Date: Tue, 26 Oct 2021 14:16:16 +0300
From: Denis Kirjanov <dkirjanov@...e.de>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: Arnd Bergmann <arnd@...nel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Cong Wang <xiyou.wangcong@...il.com>,
Jiri Pirko <jiri@...nulli.us>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
"Ahmed S. Darwish" <a.darwish@...utronix.de>,
Arnd Bergmann <arnd@...db.de>,
Zheng Yongjun <zhengyongjun3@...wei.com>,
Eric Dumazet <edumazet@...gle.com>,
Randy Dunlap <rdunlap@...radead.org>, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH net-next v3] net: sched: gred: dynamically allocate
tc_gred_qopt_offload
10/26/21 1:51 PM, Sebastian Andrzej Siewior пишет:
> On 2021-10-26 13:42:24 [+0300], Denis Kirjanov wrote:
>>> diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
>>> index 72de08ef8335e..1073c76d05c45 100644
>>> --- a/net/sched/sch_gred.c
>>> +++ b/net/sched/sch_gred.c
>>> @@ -311,42 +312,43 @@ static void gred_offload(struct Qdisc *sch, enum tc_gred_command command)
>>> {
>>> struct gred_sched *table = qdisc_priv(sch);
>>> struct net_device *dev = qdisc_dev(sch);
>>> - struct tc_gred_qopt_offload opt = {
>>> - .command = command,
>>> - .handle = sch->handle,
>>> - .parent = sch->parent,
>>> - };
>>> + struct tc_gred_qopt_offload *opt = table->opt;
>>> if (!tc_can_offload(dev) || !dev->netdev_ops->ndo_setup_tc)
>>> return;
>>> + memset(opt, 0, sizeof(*opt));
>>
>> It's zeroed in kzalloc()
>
> but it is not limited to a single invocation?
I meant that all fields are set in the function as it was with the stack
storage.
>
> Sebastian
>
Powered by blists - more mailing lists