netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <bhutchings@solarflare.com>
To: Or Gerlitz <or.gerlitz@gmail.com>
Cc: Jiri Pirko <jiri@resnulli.us>, <netdev@vger.kernel.org>,
	<davem@davemloft.net>, <stephen@networkplumber.org>,
	<Narendra_K@dell.com>, <john.r.fastabend@intel.com>
Subject: Re: [patch net-next v2 1/3] net: add ndo to get id of physical port of the device
Date: Sun, 21 Jul 2013 16:00:02 +0100	[thread overview]
Message-ID: <1374418802.16533.80.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <CAJZOPZJaKbMhtN4JSi6ScaRtwUNMK69trCccsdZvA7=57cDknQ@mail.gmail.com>

On Sun, 2013-07-21 at 14:10 +0300, Or Gerlitz wrote:
> On Sat, Jul 20, 2013 at 8:53 PM, Jiri Pirko <jiri@resnulli.us> wrote:
> >
> > This patch adds a ndo for getting physical port of the device. Driver
> > which is aware of being virtual function of some physical port should
> > implement this ndo.
> >
> > Signed-off-by: Jiri Pirko <jiri@resnulli.us>
> > ---
> >  include/linux/netdevice.h | 20 ++++++++++++++++++++
> >  net/core/dev.c            | 18 ++++++++++++++++++
> >  2 files changed, 38 insertions(+)
> >
> > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> > index 0741a1e..726dec2 100644
> > --- a/include/linux/netdevice.h
> > +++ b/include/linux/netdevice.h
> > @@ -728,6 +728,16 @@ struct netdev_fcoe_hbainfo {
> >  };
> >  #endif
> >
> > +#define MAX_PHYS_PORT_ID_LEN 32
> > +
> > +/* This structure holds a unique identifier to identify the
> > + * physical port used by a netdevice.
> > + */
> > +struct netdev_phys_port_id {
> > +       unsigned char id[MAX_PHYS_PORT_ID_LEN];
> > +       unsigned char id_len;
> > +};
> 
> 
> So an integer (four bytes?) is OK here? does it need to be in certain
> byte order?

It's an arbitrary value but is supposed to be universally unique.  So
you could use, for example, the first non-volatile MAC address assigned
to the port (if there is one).

Ben.

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

  reply	other threads:[~2013-07-21 15:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20 17:53 [patch net-next v2 0/3] export device physical port id to userspace Jiri Pirko
2013-07-20 17:53 ` [patch net-next v2 1/3] net: add ndo to get id of physical port of the device Jiri Pirko
2013-07-21 11:10   ` Or Gerlitz
2013-07-21 15:00     ` Ben Hutchings [this message]
2013-07-21 15:01   ` Ben Hutchings
2013-07-21 20:26   ` Or Gerlitz
2013-07-21 21:02     ` Jiri Pirko
2013-07-22 11:29       ` Narendra_K
2013-07-22 11:53         ` Jiri Pirko
2013-07-22 15:52       ` Or Gerlitz
2013-07-20 17:53 ` [patch net-next v2 2/3] rtnl: export physical port id via RT netlink Jiri Pirko
2013-07-21 15:03   ` Ben Hutchings
2013-07-22 11:50   ` Narendra_K
2013-07-20 17:53 ` [patch net-next v2 3/3] net: export physical port id via sysfs Jiri Pirko
2013-07-21 15:05   ` Ben Hutchings
2013-07-22 11:54   ` Narendra_K
2013-07-21  5:59 ` [patch net-next v2 0/3] export device physical port id to userspace Or Gerlitz
2013-07-21  7:26   ` Jiri Pirko

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=1374418802.16533.80.camel@deadeye.wl.decadent.org.uk \
    --to=bhutchings@solarflare.com \
    --cc=Narendra_K@dell.com \
    --cc=davem@davemloft.net \
    --cc=jiri@resnulli.us \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=or.gerlitz@gmail.com \
    --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).