All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	netdev@vger.kernel.org, davem@davemloft.net, idosch@mellanox.com,
	jakub.kicinski@netronome.com, mlxsw@mellanox.com,
	vivien.didelot@savoirfairelinux.com, michael.chan@broadcom.com,
	ganeshgr@chelsio.com, saeedm@mellanox.com,
	simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com,
	john.hurley@netronome.com, dirk.vandermerwe@netronome.com,
	alexander.h.duyck@intel.com, ogerlitz@mellanox.com,
	dsahern@gmail.com, vijaya.guvva@cavium.com,
	satananda.burla@cavium.com, raghu.vatsavayi@cavium.com,
	felix.manlunas@cavium.com, gospo@broadcom.com,
	sathya.perla@broadcom.com, vasundhara-v.volam@broadcom.com,
	tariqt@mellanox.com, eranbe@mellanox.com,
	jeffrey.t.kirsher@intel.com
Subject: Re: [patch net-next RFC 04/12] dsa: set devlink port attrs for dsa ports
Date: Thu, 17 May 2018 16:30:20 +0200	[thread overview]
Message-ID: <20180517143020.GU1972@nanopsycho> (raw)
In-Reply-To: <189f0c4d-aacb-73b9-0ff6-9feefe320c46@gmail.com>

Thu, May 17, 2018 at 04:08:10PM CEST, f.fainelli@gmail.com wrote:
>
>
>On 05/17/2018 07:02 AM, Jiri Pirko wrote:
>> Fri, Mar 23, 2018 at 06:09:29PM CET, f.fainelli@gmail.com wrote:
>>> On 03/23/2018 07:49 AM, Jiri Pirko wrote:
>>>> Fri, Mar 23, 2018 at 02:30:02PM CET, andrew@lunn.ch wrote:
>>>>> On Thu, Mar 22, 2018 at 11:55:14AM +0100, Jiri Pirko wrote:
>>>>>> From: Jiri Pirko <jiri@mellanox.com>
>>>>>>
>>>>>> Set the attrs and allow to expose port flavour to user via devlink.
>>>>>>
>>>>>> Signed-off-by: Jiri Pirko <jiri@mellanox.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.
>>>>
>>>> ah, crap. Don't have hw to test this :/
>>>> Will fix. Thanks!
>>>
>>> You don't need hardware, there is drivers/net/dsa/dsa_loop.c which will
>>> emulate a DSA switch. It won't create interconnect ports, since only one
>> 
>> Hmm, trying to use dsa_loop. Doing:
>> modprobe dsa_loop
>> modprobe fixed_phy
>> 
>> I don't see the netdevs. Any idea what am I doing wrong? Thanks!
>
>Yes, modprobe dsa-loop-bdinfo first, which will create the

That is compiled inside "fixed_phy", isn't it?
In my case, "Module fixed_phy is builtin"
So it should be enough just to "modprobe dsa_loop", right? That does not
work :/


>mdio_board_info and then modprobe dsa-loop.
>
>> 
>> 
>>> switch can be created with the method chosen, but this would have helped
>>> you catch the missing break since the "CPU" port would have been
>>> displayed as "DSA" anyway.
>>>
>>> If you need hardware, I am sure this can be somehow arranged. By that, I
>>> mean something on which you can run upstream Linux on without out of
>>> tree patches.
>>> -- 
>>> Florian
>
>-- 
>Florian

  reply	other threads:[~2018-05-17 14:30 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 10:55 [patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 01/12] devlink: introduce devlink_port_attrs_set Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 02/12] devlink: extend attrs_set for setting port flavours Jiri Pirko
2018-03-23  3:36   ` Jakub Kicinski
2018-03-23  6:30     ` Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 03/12] devlink: introduce a helper to generate physical port names Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 04/12] dsa: set devlink port attrs for dsa ports Jiri Pirko
2018-03-23 13:19   ` Andrew Lunn
2018-03-23 13:30   ` Andrew Lunn
2018-03-23 14:49     ` Jiri Pirko
2018-03-23 17:09       ` Florian Fainelli
2018-03-24  7:28         ` Jiri Pirko
2018-05-17 14:02         ` Jiri Pirko
2018-05-17 14:08           ` Florian Fainelli
2018-05-17 14:30             ` Jiri Pirko [this message]
2018-05-17 14:48               ` Andrew Lunn
2018-05-17 16:37                 ` Jiri Pirko
2018-05-17 14:51               ` Florian Fainelli
2018-05-17 17:39                 ` Jiri Pirko
2018-05-17 19:14                   ` Florian Fainelli
2018-05-17 20:28                     ` Andrew Lunn
2018-05-17 20:48                     ` Jiri Pirko
2018-05-17 21:08                       ` Andrew Lunn
2018-05-17 22:06                         ` Florian Fainelli
2018-05-17 22:40                           ` Andrew Lunn
2018-05-17 22:45                             ` Florian Fainelli
2018-05-18  1:41                               ` Andrew Lunn
2018-05-18  6:37                                 ` Jiri Pirko
2018-05-18 13:45                                   ` Andrew Lunn
2018-05-19  3:11                                     ` Florian Fainelli
2018-05-18  6:55                             ` Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 05/12] dsa: use devlink helper to generate physical port name Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 06/12] mlxsw: " Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 07/12] nfp: flower: fix error path during representor creation Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 08/12] nfp: set eth_id for representors to avoid port index conflict Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 09/12] nfp: register devlink port for VF/PF representors Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 10/12] nfp: flower: create port for flower vnic Jiri Pirko
2018-03-23  3:38   ` Jakub Kicinski
2018-03-23  6:29     ` Jiri Pirko
2018-03-24  3:32       ` Jakub Kicinski
2018-03-24  7:41         ` Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 11/12] nfp: use devlink helper to generate physical port name Jiri Pirko
2018-03-22 10:55 ` [patch net-next RFC 12/12] nfp: flower: set sysfs link to device for representors Jiri Pirko
2018-03-22 14:40 ` [patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation Roopa Prabhu
2018-03-22 14:58   ` Jiri Pirko
2018-03-22 15:34 ` David Ahern
2018-03-22 15:51   ` Roopa Prabhu
2018-03-22 17:49   ` Jiri Pirko
2018-03-22 19:10     ` David Ahern
2018-03-22 19:25       ` Andy Gospodarek
2018-05-17  8:47         ` Jiri Pirko
2018-03-23  6:34       ` Jiri Pirko
2018-03-22 23:35 ` Andrew Lunn
2018-03-23  6:35   ` [patch iproute2 rfc 1/2] devlink: introduce support for showing port flavours Jiri Pirko
2018-03-27 15:28     ` Stephen Hemminger
2018-03-23  6:35   ` [patch iproute2 rfc 2/2] devlink: introduce support for showing port number and split subport number Jiri Pirko
2018-03-23  3:34 ` [patch net-next RFC 00/12] devlink: introduce port flavours and common phys_port_name generation Jakub Kicinski
2018-03-23  6:37   ` Jiri Pirko
2018-03-23 13:43 ` Andrew Lunn
2018-03-23 14:59   ` Jiri Pirko
2018-03-23 15:24     ` Andrew Lunn
2018-03-24  7:45       ` Jiri Pirko
2018-03-24 14:35         ` Florian Fainelli
2018-03-24 16:07           ` Jiri Pirko
2018-03-24 17:07             ` Florian Fainelli
2018-03-24 17:42               ` Jiri Pirko
2018-03-24 19:00                 ` Andrew Lunn
2018-03-24 20:05                   ` Florian Fainelli
2018-03-24 14:40         ` Andrew Lunn
2018-03-24 16:04           ` Jiri Pirko
2018-03-28  5:02 ` Stephen Hemminger
2018-03-28  6:17   ` Jiri Pirko
2018-04-17 13:23 ` Or Gerlitz
2018-04-17 23:42   ` Jakub Kicinski

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=20180517143020.GU1972@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=alexander.h.duyck@intel.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dirk.vandermerwe@netronome.com \
    --cc=dsahern@gmail.com \
    --cc=eranbe@mellanox.com \
    --cc=f.fainelli@gmail.com \
    --cc=felix.manlunas@cavium.com \
    --cc=ganeshgr@chelsio.com \
    --cc=gospo@broadcom.com \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=john.hurley@netronome.com \
    --cc=michael.chan@broadcom.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=pieter.jansenvanvuuren@netronome.com \
    --cc=raghu.vatsavayi@cavium.com \
    --cc=saeedm@mellanox.com \
    --cc=satananda.burla@cavium.com \
    --cc=sathya.perla@broadcom.com \
    --cc=simon.horman@netronome.com \
    --cc=tariqt@mellanox.com \
    --cc=vasundhara-v.volam@broadcom.com \
    --cc=vijaya.guvva@cavium.com \
    --cc=vivien.didelot@savoirfairelinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.