netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	stephen@networkplumber.org, Narendra_K@Dell.com,
	john.r.fastabend@intel.com
Subject: Re: [patch net-next 2/3] rtnl: export physical port id via RT netlink
Date: Fri, 19 Jul 2013 19:13:03 +0200	[thread overview]
Message-ID: <20130719171302.GA1995@minipsycho.orion> (raw)
In-Reply-To: <1374250030.2796.4.camel@bwh-desktop.uk.level5networks.com>

Fri, Jul 19, 2013 at 06:07:10PM CEST, bhutchings@solarflare.com wrote:
>On Fri, 2013-07-19 at 15:55 +0200, Jiri Pirko wrote:
>> Signed-off-by: Jiri Pirko <jiri@resnulli.us>
>> ---
>>  include/uapi/linux/if_link.h |  1 +
>>  net/core/rtnetlink.c         | 25 ++++++++++++++++++++++++-
>>  2 files changed, 25 insertions(+), 1 deletion(-)
>> 
>> diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h
>> index 03f6170..04c0e7a 100644
>> --- a/include/uapi/linux/if_link.h
>> +++ b/include/uapi/linux/if_link.h
>[...]
>> @@ -846,6 +847,24 @@ static int rtnl_port_fill(struct sk_buff *skb, struct net_device *dev)
>>  	return 0;
>>  }
>>  
>> +static int rtnl_phys_port_id_fill(struct sk_buff *skb, struct net_device *dev)
>> +{
>> +	int err;
>> +	struct netdev_phys_port_id ppid;
>> +
>> +	if (!dev->netdev_ops->ndo_get_phys_port_id)
>> +		return 0;
>> +
>> +	err = dev->netdev_ops->ndo_get_phys_port_id(dev, &ppid);
>> +	if (err)
>> +		return err;
>[...]
>
>I can imagine a driver only sometimes being able to get the physical
>port ID, depending on hardware variant or firmware version.  That
>shouldn't require defining another instance of net_device_ops.  So if
>the error is -EOPNOTSUPP this should return 0, same as if the function
>pointer is NULL.  

Makes sense. I will adjust this. Thanks Ben.

>
>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.
>
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@vger.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-07-19 17:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 13:55 [patch net-next 0/3] export device physical port id to userspace Jiri Pirko
2013-07-19 13:55 ` [patch net-next 1/3] net: add ndo to get id of physical port of the device Jiri Pirko
2013-07-19 13:55 ` [patch net-next 2/3] rtnl: export physical port id via RT netlink Jiri Pirko
2013-07-19 16:07   ` Ben Hutchings
2013-07-19 17:13     ` Jiri Pirko [this message]
2013-07-19 13:55 ` [patch net-next 3/3] net: export physical port id via sysfs Jiri Pirko
2013-07-19 13:55 ` [patch iproute2] ip: show physical port id Jiri Pirko
2013-08-04 18:48   ` Stephen Hemminger

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=20130719171302.GA1995@minipsycho.orion \
    --to=jiri@resnulli.us \
    --cc=Narendra_K@Dell.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=john.r.fastabend@intel.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).