All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kirjanov <dkirjanov@suse.de>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Arnd Bergmann <arnd@kernel.org>,
	Jamal Hadi Salim <jhs@mojatatu.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	"Ahmed S. Darwish" <a.darwish@linutronix.de>,
	Arnd Bergmann <arnd@arndb.de>,
	Zheng Yongjun <zhengyongjun3@huawei.com>,
	Eric Dumazet <edumazet@google.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH net-next v3] net: sched: gred: dynamically allocate tc_gred_qopt_offload
Date: Tue, 26 Oct 2021 14:16:16 +0300	[thread overview]
Message-ID: <d3a32766-550c-11a1-4364-98f876e7ce12@suse.de> (raw)
In-Reply-To: <20211026105104.vhfxrwisqcbvsxiq@linutronix.de>



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
> 

  reply	other threads:[~2021-10-26 11:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-26 10:07 [PATCH net-next v3] net: sched: gred: dynamically allocate tc_gred_qopt_offload Sebastian Andrzej Siewior
2021-10-26 10:42 ` Denis Kirjanov
2021-10-26 10:51   ` Sebastian Andrzej Siewior
2021-10-26 11:16     ` Denis Kirjanov [this message]
2021-10-26 11:43       ` Sebastian Andrzej Siewior
2021-10-27 19:20 ` patchwork-bot+netdevbpf

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=d3a32766-550c-11a1-4364-98f876e7ce12@suse.de \
    --to=dkirjanov@suse.de \
    --cc=a.darwish@linutronix.de \
    --cc=arnd@arndb.de \
    --cc=arnd@kernel.org \
    --cc=bigeasy@linutronix.de \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rdunlap@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=xiyou.wangcong@gmail.com \
    --cc=zhengyongjun3@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.