netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vivien Didelot <vivien.didelot@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, f.fainelli@gmail.com
Subject: Re: [PATCH net-next 3/3] net: dsa: mv88e6xxx: add RXNFC support
Date: Sun, 8 Sep 2019 10:55:29 +0200	[thread overview]
Message-ID: <20190908085529.GB28580@lunn.ch> (raw)
In-Reply-To: <20190907172510.GB27514@t480s.localdomain>

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@lunn.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@lunn.ch>

    Andrew

  reply	other threads:[~2019-09-08  8:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-07 20:00 [PATCH net-next 0/3] net: dsa: mv88e6xxx: add PCL support Vivien Didelot
2019-09-07 20:00 ` [PATCH net-next 1/3] net: dsa: mv88e6xxx: complete ATU state definitions Vivien Didelot
2019-09-07 20:33   ` Andrew Lunn
2019-09-07 20:00 ` [PATCH net-next 2/3] net: dsa: mv88e6xxx: introduce .port_set_policy Vivien Didelot
2019-09-07 20:33   ` Andrew Lunn
2019-09-07 23:54   ` Marek Behun
2019-09-07 20:00 ` [PATCH net-next 3/3] net: dsa: mv88e6xxx: add RXNFC support Vivien Didelot
2019-09-07 20:32   ` Andrew Lunn
2019-09-07 21:25     ` Vivien Didelot
2019-09-08  8:55       ` Andrew Lunn [this message]
2019-09-08  2:48   ` Florian Fainelli
2019-09-10 15:53 ` [PATCH net-next 0/3] net: dsa: mv88e6xxx: add PCL support David Miller

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=20190908085529.GB28580@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).