[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190908085529.GB28580@lunn.ch>
Date: Sun, 8 Sep 2019 10:55:29 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Vivien Didelot <vivien.didelot@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net, f.fainelli@...il.com
Subject: Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: add RXNFC support
On Sat, Sep 07, 2019 at 05:25:10PM -0400, Vivien Didelot wrote:
> Hi Andrew,
>
> On Sat, 7 Sep 2019 22:32:56 +0200, Andrew Lunn <andrew@...n.ch> wrote:
> > > + policy = devm_kzalloc(chip->dev, sizeof(*policy), GFP_KERNEL);
> > > + if (!policy)
> > > + return -ENOMEM;
> >
> > I think this might be the first time we have done dynamic memory
> > allocation in the mv88e6xxx driver. It might even be a first for a DSA
> > driver?
> >
> > I'm not saying it is wrong, but maybe we should discuss it.
> >
> > I assume you are doing this because the ATU entry itself is not
> > sufficient?
> >
> > How much memory is involved here, worst case? I assume one struct
> > mv88e6xxx_policy per ATU entry? Which you think is too much to
> > allocate as part of chip? I guess most users will never use this
> > feature, so for most users it would be wasted memory. So i do see the
> > point for dynamically allocating it.
>
> A layer 2 policy is not limited to the ATU. It can also be based on a VTU
> entry, on the port's Etype, or frame's Etype. We can have 0, 1 or literally
> thousands of policies programmed by the user.
O.K, then it has to by dynamic memory.
Reviewed-by: Andrew Lunn <andrew@...n.ch>
Andrew
Powered by blists - more mailing lists