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: <20100526083318.5b7b7704@nehalam>
Date:	Wed, 26 May 2010 08:33:18 -0700
From:	Stephen Hemminger <shemminger@...tta.com>
To:	Eli Cohen <eli@....mellanox.co.il>
Cc:	Eli Cohen <eli@...lanox.co.il>, davem@...emloft.net,
	netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
	rdreier@...co.com, yevgenyp@...lanox.co.il
Subject: Re: [PATCH] net/core: use net_device dev_id to indicate port number

On Wed, 26 May 2010 18:27:30 +0300
Eli Cohen <eli@....mellanox.co.il> wrote:

> On Wed, May 26, 2010 at 08:23:06AM -0700, Stephen Hemminger wrote:
> > On Wed, 26 May 2010 12:52:00 +0300
> > Eli Cohen <eli@...lanox.co.il> wrote:
> > 
> > > Today, there are no means to know which port of a hardware device a netdev
> > > interface uses. struct net_device conatins a field, dev_id, that can be used
> > > for that. This patch adds a new macro, SET_NETDEV_DEV_ID(), to provide a
> > > standard way to set the value of this field.
> > > Also also make use of this feature in the mlx4_en driver to set the port
> > > number; port numbers are zero based.
> > 
> > Why is a macro wrapper needed?
> > 
> 
> I guess for the same reason we use SET_NETDEV_DEV - to provide a
> consistent interface for setting this value...

SET_NETDEV_DEV macro exists because at the time 2.5 kernel was being developed
it was important to be able to maintain source compatibility between 2.4 and
2.6 (nee 2.5) drivers. Since 2.4 did not have sysfs, the macro was a mechanism
to allow the same code to run on both kernel versions.

Your situation is different, just use dev_id and update documentation if
you need to.

-- 
--
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