Subject: Re: [patch net-next RFC 04/12] dsa: set devlink port attrs for dsa ports

From: Andrew Lunn <[email-masked]>
Date: Fri, 23 Mar 2018 14:19:29 +0100

On Thu, Mar 22, 2018 at 11:55:14AM +0100, Jiri Pirko wrote:
> From: Jiri Pirko <[email-masked]>
> 
> Set the attrs and allow to expose port flavour to user via devlink.
> 
> Signed-off-by: Jiri Pirko <[email-masked]>
> ---
>  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;
> +		}

Hi Jiri

Please could you explain what you are trying to achieve with this call to 
dsa_port_link_register_of(dp);

Thanks
	Andrew