netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, mlxsw@mellanox.com,
	idosch@mellanox.com, dirk.vandermerwe@netronome.com,
	f.fainelli@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com
Subject: Re: [patch net-next 5/5] net: devlink: remove unused devlink_port_get_phys_port_name() function
Date: Fri, 1 Mar 2019 17:27:20 +0100	[thread overview]
Message-ID: <20190301162720.GL2314@nanopsycho> (raw)
In-Reply-To: <20190301082529.6d7aee20@cakuba.netronome.com>

Fri, Mar 01, 2019 at 05:25:29PM CET, jakub.kicinski@netronome.com wrote:
>On Fri,  1 Mar 2019 09:14:02 +0100, Jiri Pirko wrote:
>> From: Jiri Pirko <jiri@mellanox.com>
>> 
>> Now it is unused, remove it.
>> 
>> Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>
>Oh, you nuke this completely, that's going to conflict hard with my
>series :)
>
>(Provided the locking is okay) I think it'd be good if we flipped the
>logic in dev_get_phys_port_name().  Always try devlink:
>
>@@ -7872,7 +7873,7 @@ int dev_get_phys_port_name(struct net_device *dev,
> 	const struct net_device_ops *ops = dev->netdev_ops;
> 	
>+	if (!devlink_compat_phys_port_name_get(dev, name, len))
>+		return 0;
> 	if (!ops->ndo_get_phys_port_name)
>		return -EOPNOTSUPP;
> 	return ops->ndo_get_phys_port_name(dev, name, len);
> }
>
>NFP is using a single set of NDOs for PFs and VFs (which don't have
>devlink ports), so either it'd be good if I could call the devlink
>helper for real ports, or we need the above.

That wouldn't give correct results now. Until you introduce PF/VF port
flavours, devlink_compat_phys_port_name_get() does not assemble correct
names for them. So we have to call ndo_get_phys_port_name until it knows
how to do that.


>
>> diff --git a/include/net/devlink.h b/include/net/devlink.h
>> index ae2cd34da99e..227c453cc20e 100644
>> --- a/include/net/devlink.h
>> +++ b/include/net/devlink.h
>> @@ -578,8 +578,6 @@ void devlink_port_attrs_set(struct devlink_port *devlink_port,
>>  			    enum devlink_port_flavour flavour,
>>  			    u32 port_number, bool split,
>>  			    u32 split_subport_number);
>> -int devlink_port_get_phys_port_name(struct devlink_port *devlink_port,
>> -				    char *name, size_t len);
>>  int devlink_sb_register(struct devlink *devlink, unsigned int sb_index,
>>  			u32 size, u16 ingress_pools_count,
>>  			u16 egress_pools_count, u16 ingress_tc_count,
>> @@ -794,13 +792,6 @@ static inline void devlink_port_attrs_set(struct devlink_port *devlink_port,
>>  {
>>  }
>>  
>> -static inline int
>> -devlink_port_get_phys_port_name(struct devlink_port *devlink_port,
>> -				char *name, size_t len)
>> -{
>> -	return -EOPNOTSUPP;
>> -}
>> -
>>  static inline int devlink_sb_register(struct devlink *devlink,
>>  				      unsigned int sb_index, u32 size,
>>  				      u16 ingress_pools_count,
>> diff --git a/net/core/devlink.c b/net/core/devlink.c
>> index 4fd45d4a4818..d90a745d8258 100644
>> --- a/net/core/devlink.c
>> +++ b/net/core/devlink.c
>> @@ -5451,13 +5451,6 @@ static int __devlink_port_phys_port_name_get(struct devlink_port *devlink_port,
>>  	return 0;
>>  }
>>  
>> -int devlink_port_get_phys_port_name(struct devlink_port *devlink_port,
>> -				    char *name, size_t len)
>> -{
>> -	return __devlink_port_phys_port_name_get(devlink_port, name, len);
>> -}
>> -EXPORT_SYMBOL_GPL(devlink_port_get_phys_port_name);
>> -
>>  int devlink_sb_register(struct devlink *devlink, unsigned int sb_index,
>>  			u32 size, u16 ingress_pools_count,
>>  			u16 egress_pools_count, u16 ingress_tc_count,
>

  reply	other threads:[~2019-03-01 16:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-01  8:13 [patch net-next 0/5] net: call for phys_port_name into devlink directly is possible Jiri Pirko
2019-03-01  8:13 ` [patch net-next 1/5] net: replace ndo_get_devlink for ndo_get_devlink_port Jiri Pirko
2019-03-01 12:45   ` Michal Kubecek
2019-03-01 13:42     ` Jiri Pirko
2019-03-02  2:20   ` Florian Fainelli
2019-03-01  8:13 ` [patch net-next 2/5] net: devlink: introduce devlink_compat_phys_port_name_get() Jiri Pirko
2019-03-01 16:14   ` Jakub Kicinski
2019-03-01 16:21     ` Jiri Pirko
2019-03-01  8:14 ` [patch net-next 3/5] mlxsw: spectrum: Implement ndo_get_devlink_port Jiri Pirko
2019-03-01  8:14 ` [patch net-next 4/5] mlxsw: Remove ndo_get_phys_port_name implementation Jiri Pirko
2019-03-01  8:14 ` [patch net-next 5/5] net: devlink: remove unused devlink_port_get_phys_port_name() function Jiri Pirko
2019-03-01 16:25   ` Jakub Kicinski
2019-03-01 16:27     ` Jiri Pirko [this message]
2019-03-01 16:48       ` Jakub Kicinski

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=20190301162720.GL2314@nanopsycho \
    --to=jiri@resnulli.us \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=dirk.vandermerwe@netronome.com \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.com \
    /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).