public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Eli Cohen <eli@dev.mellanox.co.il>
Cc: Eli Cohen <eli@mellanox.co.il>,
	davem@davemloft.net, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, rdreier@cisco.com,
	yevgenyp@mellanox.co.il
Subject: Re: [PATCH] net/core: use net_device dev_id to indicate port number
Date: Wed, 26 May 2010 08:33:18 -0700	[thread overview]
Message-ID: <20100526083318.5b7b7704@nehalam> (raw)
In-Reply-To: <20100526152730.GA10890@mtldesk030.lab.mtl.com>

On Wed, 26 May 2010 18:27:30 +0300
Eli Cohen <eli@dev.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@mellanox.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.

-- 

  reply	other threads:[~2010-05-26 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-26  9:52 [PATCH] net/core: use net_device dev_id to indicate port number Eli Cohen
     [not found] ` <20100526095200.GA7370-8YAHvHwT2UEvbXDkjdHOrw/a8Rv0c6iv@public.gmane.org>
2010-05-26 15:23   ` Stephen Hemminger
2010-05-26 15:27     ` Eli Cohen
2010-05-26 15:33       ` Stephen Hemminger [this message]
2010-05-26 16:09         ` Eli Cohen

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=20100526083318.5b7b7704@nehalam \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=eli@dev.mellanox.co.il \
    --cc=eli@mellanox.co.il \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rdreier@cisco.com \
    --cc=yevgenyp@mellanox.co.il \
    /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