[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180518063735.GY1972@nanopsycho>
Date: Fri, 18 May 2018 08:37:35 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>, netdev@...r.kernel.org,
davem@...emloft.net, idosch@...lanox.com,
jakub.kicinski@...ronome.com, mlxsw@...lanox.com,
vivien.didelot@...oirfairelinux.com, michael.chan@...adcom.com,
ganeshgr@...lsio.com, saeedm@...lanox.com,
simon.horman@...ronome.com, pieter.jansenvanvuuren@...ronome.com,
john.hurley@...ronome.com, dirk.vandermerwe@...ronome.com,
alexander.h.duyck@...el.com, ogerlitz@...lanox.com,
dsahern@...il.com, vijaya.guvva@...ium.com,
satananda.burla@...ium.com, raghu.vatsavayi@...ium.com,
felix.manlunas@...ium.com, gospo@...adcom.com,
sathya.perla@...adcom.com, vasundhara-v.volam@...adcom.com,
tariqt@...lanox.com, eranbe@...lanox.com,
jeffrey.t.kirsher@...el.com
Subject: Re: [patch net-next RFC 04/12] dsa: set devlink port attrs for dsa
ports
Fri, May 18, 2018 at 03:41:37AM CEST, andrew@...n.ch wrote:
>> >>> ds = dsa_switch_alloc(&mdiodev->dev, DSA_MAX_PORTS);
>> >>>
>> >>> It is allocating a switch with 12 ports. However only 4 of them have
>> >>> names. So the core only creates slave devices for those 4.
>> >>>
>> >>> This is a useful test. Real hardware often has unused ports. A WiFi AP
>> >>> with a 7 port switch which only uses 6 ports is often seen.
>> >>
>> >> The following patch should fix this:
>> >>
>> >>
>> >> diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
>> >> index adf50fbc4c13..a06c29ec91f0 100644
>> >> --- a/net/dsa/dsa2.c
>> >> +++ b/net/dsa/dsa2.c
>> >> @@ -262,13 +262,14 @@ static int dsa_port_setup(struct dsa_port *dp)
>> >>
>> >> memset(&dp->devlink_port, 0, sizeof(dp->devlink_port));
>> >>
>> >> + if (dp->type == DSA_PORT_TYPE_UNUSED)
>> >> + return 0;
>> >> +
>> >> err = devlink_port_register(ds->devlink, &dp->devlink_port,
>> >> dp->index);
>> >
>> > Hi Florian, Jiri
>> >
>> > Maybe it is better to add a devlink port type unused?
>>
>> The port does not exist on the switch, so it should not even be
>> registered IMHO.
>
>Hi Florian
>
>The ports do exist, when you called dsa_switch_alloc() you said the
>switch has 12 ports.
What benefit does it have to register unused ports? What is a usecase
for them. Like Florian, I also think they should not be registered.
>
> Andrew
Powered by blists - more mailing lists