[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190301082529.6d7aee20@cakuba.netronome.com>
Date: Fri, 1 Mar 2019 08:25:29 -0800
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Jiri Pirko <jiri@...nulli.us>
Cc: netdev@...r.kernel.org, davem@...emloft.net, mlxsw@...lanox.com,
idosch@...lanox.com, dirk.vandermerwe@...ronome.com,
f.fainelli@...il.com, andrew@...n.ch, vivien.didelot@...il.com
Subject: Re: [patch net-next 5/5] net: devlink: remove unused
devlink_port_get_phys_port_name() function
On Fri, 1 Mar 2019 09:14:02 +0100, Jiri Pirko wrote:
> From: Jiri Pirko <jiri@...lanox.com>
>
> Now it is unused, remove it.
>
> Signed-off-by: Jiri Pirko <jiri@...lanox.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.
> 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,
Powered by blists - more mailing lists