[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180323133002.GF5145@lunn.ch>
Date: Fri, 23 Mar 2018 14:30:02 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, davem@...emloft.net, idosch@...lanox.com,
jakub.kicinski@...ronome.com, mlxsw@...lanox.com,
vivien.didelot@...oirfairelinux.com, f.fainelli@...il.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
On Thu, Mar 22, 2018 at 11:55:14AM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@...lanox.com>
>
> Set the attrs and allow to expose port flavour to user via devlink.
>
> Signed-off-by: Jiri Pirko <jiri@...lanox.com>
> ---
> net/dsa/dsa2.c | 23 +++++++++++++++++++++++
> 1 file changed, 23 insertions(+)
>
> diff --git a/net/dsa/dsa2.c b/net/dsa/dsa2.c
> index adf50fbc4c13..49453690696d 100644
> --- a/net/dsa/dsa2.c
> +++ b/net/dsa/dsa2.c
> @@ -270,7 +270,27 @@ static int dsa_port_setup(struct dsa_port *dp)
> case DSA_PORT_TYPE_UNUSED:
> break;
> case DSA_PORT_TYPE_CPU:
> + /* dp->index is used now as port_number. However
> + * CPU ports should have separate numbering
> + * independent from front panel port numbers.
> + */
> + devlink_port_attrs_set(&dp->devlink_port,
> + DEVLINK_PORT_FLAVOUR_CPU,
> + dp->index, false, 0);
> + err = dsa_port_link_register_of(dp);
> + if (err) {
> + dev_err(ds->dev, "failed to setup link for port %d.%d\n",
> + ds->index, dp->index);
> + return err;
> + }
Ah, i get it. These used to be two case statements with one code
block. But you split them apart, so needed to duplicate the
dsa_port_link_register.
Unfortunately, you forgot to add a 'break;', so it still falls
through, and overwrites the port flavour to DSA.
> case DSA_PORT_TYPE_DSA:
> + /* dp->index is used now as port_number. However
> + * DSA ports should have separate numbering
> + * independent from front panel port numbers.
> + */
> + devlink_port_attrs_set(&dp->devlink_port,
> + DEVLINK_PORT_FLAVOUR_DSA,
> + dp->index, false, 0);
Andrew
Powered by blists - more mailing lists