From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev@vger.kernel.org, Vivien Didelot <vivien.didelot@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH net-next 2/5] net: dsa: loop: Support 4K VLANs
Date: Mon, 3 Aug 2020 13:29:12 -0700 [thread overview]
Message-ID: <585749fb-18fa-973b-57f2-05fd03bd9fdb@gmail.com> (raw)
In-Reply-To: <20200803202735.GB1919070@lunn.ch>
On 8/3/2020 1:27 PM, Andrew Lunn wrote:
> On Mon, Aug 03, 2020 at 01:03:51PM -0700, Florian Fainelli wrote:
>> Allocate a 4K array of VLANs instead of limiting ourselves to just 5
>> which is arbitrary.
>>
>> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
>> ---
>> drivers/net/dsa/dsa_loop.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
>> index 4a57238cdfd8..6e97b44c6f3f 100644
>> --- a/drivers/net/dsa/dsa_loop.c
>> +++ b/drivers/net/dsa/dsa_loop.c
>> @@ -48,12 +48,10 @@ struct dsa_loop_port {
>> u16 pvid;
>> };
>>
>> -#define DSA_LOOP_VLANS 5
>> -
>> struct dsa_loop_priv {
>> struct mii_bus *bus;
>> unsigned int port_base;
>> - struct dsa_loop_vlan vlans[DSA_LOOP_VLANS];
>> + struct dsa_loop_vlan vlans[VLAN_N_VID];
>> struct net_device *netdev;
>> struct dsa_loop_port ports[DSA_MAX_PORTS];
>
> That is 4K x (2 x u16) = 16K RAM. I suppose for a test driver which is
> never expected to be used in production, that is O.K.
I think so too, if we are worried we could switch to vmalloc() down the
road.
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew
>
--
Florian
next prev parent reply other threads:[~2020-08-03 20:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-03 20:03 [PATCH net-next 0/5] net: dsa: loop: Preparatory changes for Florian Fainelli
2020-08-03 20:03 ` [PATCH net-next 1/5] net: dsa: loop: PVID should be per-port Florian Fainelli
2020-08-03 20:34 ` Andrew Lunn
2020-08-03 20:03 ` [PATCH net-next 2/5] net: dsa: loop: Support 4K VLANs Florian Fainelli
2020-08-03 20:27 ` Andrew Lunn
2020-08-03 20:29 ` Florian Fainelli [this message]
2020-08-03 20:03 ` [PATCH net-next 3/5] net: dsa: loop: Move data structures to header Florian Fainelli
2020-08-03 20:03 ` [PATCH net-next 4/5] net: dsa: loop: Wire-up MTU callbacks Florian Fainelli
2020-08-03 20:29 ` Andrew Lunn
2020-08-03 20:03 ` [PATCH net-next 5/5] net: dsa: loop: Set correct number of ports Florian Fainelli
2020-08-03 20:29 ` Andrew Lunn
2020-08-03 20:33 ` [PATCH net-next 0/5] net: dsa: loop: Preparatory changes for Andrew Lunn
2020-08-03 20:36 ` Florian Fainelli
2020-08-04 1:20 ` David Miller
2020-08-04 2:22 ` Florian Fainelli
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=585749fb-18fa-973b-57f2-05fd03bd9fdb@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--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).