[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130719171302.GA1995@minipsycho.orion>
Date: Fri, 19 Jul 2013 19:13:03 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Ben Hutchings <bhutchings@...arflare.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
stephen@...workplumber.org, Narendra_K@...l.com,
john.r.fastabend@...el.com
Subject: Re: [patch net-next 2/3] rtnl: export physical port id via RT netlink
Fri, Jul 19, 2013 at 06:07:10PM CEST, bhutchings@...arflare.com wrote:
>On Fri, 2013-07-19 at 15:55 +0200, Jiri Pirko wrote:
>> Signed-off-by: Jiri Pirko <jiri@...nulli.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@...r.kernel.org
>More majordomo info at http://vger.kernel.org/majordomo-info.html
--
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