netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Linux Netdev List <netdev@vger.kernel.org>,
	David Miller <davem@davemloft.net>,
	mlxsw@mellanox.com, Ido Schimmel <idosch@mellanox.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>,
	vivien.didelot@gmail.com,
	Michael Chan <michael.chan@broadcom.com>,
	Or Gerlitz <ogerlitz@mellanox.com>
Subject: Re: [patch net-next 00/12] net: expose switch ID via devlink
Date: Sat, 30 Mar 2019 08:35:27 +0100	[thread overview]
Message-ID: <20190330073527.GB14297@nanopsycho> (raw)
In-Reply-To: <CAJpBn1yodDt5oa4gkj-jb7owsZFAkcsHDp98xv54Ri_8M+N=2Q@mail.gmail.com>

Fri, Mar 29, 2019 at 11:34:14PM CET, jakub.kicinski@netronome.com wrote:
>On Fri, Mar 29, 2019 at 2:21 PM Jiri Pirko <jiri@resnulli.us> wrote:
>> Fri, Mar 29, 2019 at 07:59:26PM CET, jakub.kicinski@netronome.com wrote:
>> >On Fri, 29 Mar 2019 07:49:05 +0100, Jiri Pirko wrote:
>> >> Thu, Mar 28, 2019 at 10:40:02PM CET, jakub.kicinski@netronome.com wrote:
>> >> >On Thu, 28 Mar 2019 22:12:42 +0100, Jiri Pirko wrote:
>> >> >> From: Jiri Pirko <jiri@mellanox.com>
>> >> >>
>> >> >> To provide visibility of the ports, this patchset exposes switch ID
>> >> >> for devlink ports, which are part of a switch. The rest of the ports
>> >> >> if any (in case of sr-iov for example) do not set switch ID.
>> >> >
>> >> >I don't feel good about this patch set.  There is no visibility
>> >> >provided here.  Should the port flavour should be a sufficient
>> >>
>> >> 1) this patch is mainly about avoiding need to define the ndo and moving
>> >>    the switch id definition to devlink port attr.
>> >
>> >Sure, that you could achieve by putting the data in the netdevice
>> >structure as well..
>> >
>> >What is the guiding principle here?  I'm trying to argue for leaving
>> >forwarding-related info in netdev code, and only have HW control in
>> >devlink.  I just don't see switch id being useful at devlink level in
>> >any way.
>>
>> Well we have switchib driver which does not have any netdevice and still
>> the ports are part of a switch. In other words, this is not
>> ethernet-specific attribute, therefore devlink is the right fit.
>
>Ack, but switch id is a switchdev thing, controlling which ports are
>considered to be part of the same device _for_ _switchdev_.

"Switchdev" is a bridge offload. Nothing else.


>
>Is switchib doing forwarding?  Not long ago Parav was convincing us
>that switchdev mode for IB is pretty much meaningless.  Even though
>there are apparently representors for IB (judging by the recent RDMA
>patchset on netdev)...

Switch id is simply identifier for ports in general that belong to some
switch. No matter if ethernet or IB.


>
>> >> 2) along with that, switch id is added as attribute. It tells the user
>> >>    that some devlink port is part of a switch with certain id. If port
>> >>    is not part of a switch (like upcoming hostport, cpu, dsa, etc),
>> >>    switch id is not set on that port
>> >
>> >If the flavour already gives that information, why crowd the attributes
>> >for ports with switch id?
>>
>> Hmm, we'll have multiple non-switch port flavours and once your vf/pf
>> patchset  hits the tree we'll have multipkle switch port flavours.
>> So makes sense to have switch id.
>
>It's probably a matter of preference then.  To me its very clear to say that
>you can switch to physical/vf/pf ports and not cpu/dsa/host. I don't like
>the duplication of dumpnig the same attribute both in rtnetlink and devlink.

I want to remind you, that switch_id in rtnetlink was introduced before
devlink existed. Back than, if was the only place to put it. However, as
I explained, it is not ethernet speficic thing and rather belongs to
devlink. This patchset is doing that.


>
>> Also, you can have multiple switches within one asic.
>
>That line is blurry.

It is. So far, it is mlx CX hw that have basically 2 switches, one per
PF.


>
>> >> >indication of whether netdev associated with that port can be
>> >> >switched to or not?  CPU, DSA, and Host flavours can't be switched
>> >> >to.  And the switchid can be an attribute of the devlink instance,
>> >> >if we want to expose it via devlink.
>> >>
>> >> One devlink instance can have multiple switch ids in use as it may
>> >> contain multiple switches. Take mlx5 as an instance. Currently every PF
>> >> creates a separate devlink instance, however there are some features
>> >> shared. In this example, with proposed idea of aliasing, there would be
>> >> one devlink instance aliased between these 2 pf inctances, with 2
>> >> eswitches and 2 sets of switch ports each belonging to an eswitch -
>> >> distinguished by switch id.
>> >
>> >Out of curiosity, what are the shared features?  It seems mlx5 drives
>> >a lot of our API design, it'd be good if the community had a better
>> >understanding of it.
>>
>> I have to gather that info. Not so many things are shared. There is one
>> extra switch to mix 2 pfs together. I know about some IB features that
>> also mix 2 pfs.
>
>I see, so a dual port IB card would somehow have only one whatever the
>equivalent of a netdev in IB world is?

Yes. We have a patchset internally to manage that.


>
>> >The situation with pipelined devices is somewhat murky.  Didn't Or add
>> >some from of PCIe-side looped queue to forward between PFs?
>>
>> I have no clue. Ccing Or. Or?
>>
>> >Presumably DSA would lean the opposite way with multiple ASICs
>> >reporting the same ID?
>>
>> Yes, sounds right.
>
>Right, so to me switch ID really is a forwarding attribute.

  reply	other threads:[~2019-03-30  7:35 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28 21:12 [patch net-next 00/12] net: expose switch ID via devlink Jiri Pirko
2019-03-28 21:12 ` [patch net-next 01/12] net: devlink: convert devlink_port_attrs bools to bits Jiri Pirko
2019-03-28 21:12 ` [patch net-next 02/12] net: devlink: extend port attrs for switch ID Jiri Pirko
2019-03-28 21:12 ` [patch net-next 03/12] net: devlink: introduce devlink_compat_switch_id_get() helper Jiri Pirko
2019-03-28 21:12 ` [patch net-next 04/12] mlxsw: Pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 05/12] mlxsw: Remove ndo_get_port_parent_id implementation Jiri Pirko
2019-03-28 21:12 ` [patch net-next 06/12] bnxt: pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 07/12] bnxt: remove ndo_get_port_parent_id implementation for physical ports Jiri Pirko
2019-03-28 21:12 ` [patch net-next 08/12] nfp: pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 09/12] nfp: remove ndo_get_port_parent_id implementation Jiri Pirko
2019-03-28 21:12 ` [patch net-next 10/12] mlxsw: switch_ib: Pass valid HW id down to mlxsw_core_port_init() Jiri Pirko
2019-03-28 21:12 ` [patch net-next 11/12] dsa: pass switch ID through devlink_port_attrs_set() Jiri Pirko
2019-03-29 21:59   ` Florian Fainelli
2019-04-01 13:04     ` Jiri Pirko
2019-03-28 21:12 ` [patch net-next 12/12] net: devlink: add warning for ndo_get_port_parent_id set when not needed Jiri Pirko
2019-03-28 21:40 ` [patch net-next 00/12] net: expose switch ID via devlink Jakub Kicinski
2019-03-29  6:49   ` Jiri Pirko
2019-03-29 18:59     ` Jakub Kicinski
2019-03-29 21:21       ` Jiri Pirko
2019-03-29 22:34         ` Jakub Kicinski
2019-03-30  7:35           ` Jiri Pirko [this message]
2019-03-30 19:49             ` Jakub Kicinski
2019-03-31  8:50               ` Jiri Pirko
2019-03-31 20:57                 ` Jakub Kicinski
2019-03-29 21:29       ` Florian Fainelli
2019-03-29 21:57         ` Jakub Kicinski
2019-03-29 22:04           ` 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=20190330073527.GB14297@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=michael.chan@broadcom.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --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).