lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130531121201.GA1311@fedora-17-guest.blr.amer.dell.com>
Date:	Fri, 31 May 2013 05:13:16 -0700
From:	<Narendra_K@...l.com>
To:	<stephen@...workplumber.org>
CC:	<netdev@...r.kernel.org>
Subject: Re: Generic interface to make physical port number used by a
 netdevice available to user space

On Mon, May 27, 2013 at 06:39:00PM +0530, Narendra_K@...l.com wrote:
> 
> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen@...workplumber.org]
> > Sent: Thursday, May 23, 2013 10:04 PM
> > To: K, Narendra
> > Cc: netdev@...r.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

2. if_port:

Reuse if_port to indicate physical port number used by a netdevice as
suggested.

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.

It would be great to know your thoughts on which of the above would be
preferable.

-- 
With regards,
Narendra K
Linux Engineering
Dell Inc.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ