lkml.org 
[lkml]   [2021]   [Oct]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next v3] net: sched: gred: dynamically allocate tc_gred_qopt_offload
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?

Sebastian

\
 
 \ /
  Last update: 2021-10-26 12:51    [W:0.041 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site