netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Feldman <sfeldma@gmail.com>
To: David Ahern <dsahern@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>, Netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] net: rocker: Change netdev names to include slot number
Date: Mon, 2 Feb 2015 21:46:23 -0800	[thread overview]
Message-ID: <CAE4R7bArt7+C-kHJ7UXFo4w9feG0C_uZqQ7n8KC0brSXhqX3gg@mail.gmail.com> (raw)
In-Reply-To: <54CFF5B3.7070509@gmail.com>

On Mon, Feb 2, 2015 at 2:09 PM, David Ahern <dsahern@gmail.com> wrote:
> On 2/2/15 3:03 PM, Florian Fainelli wrote:
>>
>> Why not? virtio and rocker interfaces are backed by different devices
>> drivers which should allow you to use that to name interfaces
>> differently. In the case of rocker, you would probably want to read the
>> phys_port_id sysfs attribute to name them after their parent switch id
>> too.
>
>
> [root@f21 ~]# cat /sys/devices/virtual/net/sw5p0/phys_port_id
> cat: /sys/devices/virtual/net/sw5p0/phys_port_id: Operation not supported

We should implement .ndo_get_phys_port_id in rocker to return a unique
name for the port, which can then be used in udev script to name
interface.  When rocker device is instantiated, a unique switch name
is given on qemu cmd line, for example "sw1".  Rocker device could
return that string to the driver, or even combine that string with the
port index to have "sw1p1".  The second instantiated rocker device
would give up "sw2px" port names.

A real switch with a physical port than can be split, or when multiple
ports are ganged to form one mega port, letting the device pick a
unique name is probably best.  For example, splitting a single
physical 40Gb port into 4 10Gb ports would present 4 kernel
interfaces, but we probably want to use the base port in the naming,
so we'd have something like "sw1p1s1" to mean switch 1, front panel
port 1, split port 1.  Letting the device name the ports on current
port configuration of the port will keep driver/kernel simple, and let
udev be the final name chooser.

>
> But in general I guess need to find time to figure out systemd-udev files.
>
> David

  reply	other threads:[~2015-02-03  5:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-02  6:03 [PATCH] net: rocker: Change netdev names to include slot number David Ahern
2015-02-02 21:33 ` Scott Feldman
2015-02-02 21:41   ` David Ahern
2015-02-02 22:03     ` Florian Fainelli
2015-02-02 22:09       ` David Ahern
2015-02-03  5:46         ` Scott Feldman [this message]
2015-02-03 16:06           ` David Ahern
2015-02-03  7:33         ` Rosen, Rami
2015-02-02 22:16     ` David Miller
2015-02-02 22:15   ` David Miller

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=CAE4R7bArt7+C-kHJ7UXFo4w9feG0C_uZqQ7n8KC0brSXhqX3gg@mail.gmail.com \
    --to=sfeldma@gmail.com \
    --cc=dsahern@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    /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).