From: John Fastabend <john.r.fastabend@intel.com>
To: Narendra_K@Dell.com
Cc: stephen@networkplumber.org, netdev@vger.kernel.org,
Ben Hutchings <bhutchings@solarflare.com>
Subject: Re: Generic interface to make physical port number used by a netdevice available to user space
Date: Fri, 07 Jun 2013 07:59:57 -0700 [thread overview]
Message-ID: <51B1F56D.5000007@intel.com> (raw)
In-Reply-To: <20130531121201.GA1311@fedora-17-guest.blr.amer.dell.com>
On 5/31/2013 5:13 AM, Narendra_K@Dell.com wrote:
> On Mon, May 27, 2013 at 06:39:00PM +0530, Narendra_K@Dell.com wrote:
>>
>>> -----Original Message-----
>>> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
>>> Sent: Thursday, May 23, 2013 10:04 PM
>>> To: K, Narendra
>>> Cc: netdev@vger.kernel.org
>>> One idea would be to reuse the mostly outdated if_port field.
>>> As far as I can see only drivers using it are legacy drivers which support
>> AUI vs.
>>> TP back in the old bad days of BNC Ethernet.
>>
>> Hi Stephen, thank you.
>>
>> I think if_port or dev_id would be fine. The difference seems to be that
>> dev_id is already exported to sysfs.
>>
>
> I think the following options could be explored -
>
> 1. dev_id:
> Do not initialize it to -1, but use it to indicate physical port number
> used by netdevice.
>
> It is currently being used for indicating physical port number and
> is also being used to differentiate OS instances as noted here.
> http://marc.info/?l=linux-netdev&m=136992115300526&w=2
>
My opinion would be to use dev_id as the comment in netdevice.h suggests
it can be used for this. I'm not sure the addrconf.c bits are still
valid.
If need be you could fix the check in addrconf to check for not -1.
> 2. if_port:
>
> Reuse if_port to indicate physical port number used by a netdevice as
> suggested.
>
Sure you could use this as well but I got more hits with drivers using
this to indicate the media type. I'm guessing this would break KABI for
someone somewhere, but maybe there is a way to work around it. dev_id
seems like an easier problem to me.
> A quick look at the sources seems to indicate that it is also
> being used to indicate the physical port number and data transfer mode.
>
> Used to indicate physical port number by
> -drivers/net/ethernet/chelsio/cxgb/cxgb2.c
> -drivers/net/ethernet/tehuti/tehuti.c
>
> Used to indicate data transfer mode by
> -drivers/net/ethernet/realtek/atp.c
>
> Also, 'if_port' seems to be available to userspace via
> -netlink (by rtnl_dump_ifinfo in net/core/rtnetlink.c)
> -SIOCGIFMAP ioctl
>
> 3. Add a new field 'physport' to 'struct net_device' and export it to sysfs.
Probably not we already have two fields that seem ill-defined no reason
to add another to the confusion. If you absolutely can't make dev_id or
if_port coherent then maybe but I really think one of the above two will
work.
>
> It would be great to know your thoughts on which of the above would be
> preferable.
>
next prev parent reply other threads:[~2013-06-07 15:00 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 7:54 Generic interface to make physical port number used by a netdevice available to user space Narendra_K
2013-05-22 16:04 ` Ben Hutchings
2013-05-23 13:27 ` Narendra_K
2013-05-23 16:18 ` Ben Hutchings
2013-05-23 18:33 ` Dan Williams
2013-05-23 18:48 ` Ben Hutchings
2013-05-23 19:05 ` Dan Williams
2013-05-23 19:49 ` Ben Hutchings
2013-05-23 16:34 ` Stephen Hemminger
2013-05-27 13:09 ` Narendra_K
2013-05-31 12:13 ` Narendra_K
2013-06-07 14:59 ` John Fastabend [this message]
2013-06-07 17:21 ` Ben Hutchings
2013-06-07 17:35 ` John Fastabend
2013-06-10 17:54 ` Narendra_K
2013-06-10 18:10 ` Ben Hutchings
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=51B1F56D.5000007@intel.com \
--to=john.r.fastabend@intel.com \
--cc=Narendra_K@Dell.com \
--cc=bhutchings@solarflare.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.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).