From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9FD6C43381 for ; Fri, 1 Mar 2019 16:37:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B393C20850 for ; Fri, 1 Mar 2019 16:37:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=resnulli-us.20150623.gappssmtp.com header.i=@resnulli-us.20150623.gappssmtp.com header.b="UavQW3e3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389215AbfCAQhb (ORCPT ); Fri, 1 Mar 2019 11:37:31 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38324 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728449AbfCAQhO (ORCPT ); Fri, 1 Mar 2019 11:37:14 -0500 Received: by mail-wr1-f65.google.com with SMTP id g12so14494593wrm.5 for ; Fri, 01 Mar 2019 08:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bmbe4HeGAaSCfa5n2X0Y/yeDiS6imQ1q4+3UR75MZFk=; b=UavQW3e3Xvi/7z9MfUtz5Os4ApodzaArHLAXkw+Ha4uImOjoCpSKWgiFqLT31QpgOO scraValds0zHFlt0UjQL3Jy2nV9/f//bKmzoD6nvIeZfN8QdFTkyxHwVR+uqgVvLAoFt LDKtEWuEXmaGAFWE3yNpMybiMfIXhk0v13MZ+AwyZ2Ies5p4CqT0v9E9UToxJxzsf4eD H88U7fSv0sMUL9TFxMLKypjyvDt7CPVu1ebuYn9dUwN1B7xHgMlH76nb+sVswr7UQ2Yh 253xzIhHPPwuGRTibOQuBp3mS4BtB2Eu6yLBMEmB1GFBdE+O6xIGMyPT8Xh7OWAcSQFc 2toQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bmbe4HeGAaSCfa5n2X0Y/yeDiS6imQ1q4+3UR75MZFk=; b=BkkXO7R+W1jQgzx5dadb1b4wZjw3frRd7yG09mlrXyXyLSBnt+xUlgEiIt7LM1He9/ W3FY6W3PdRbL6FVpXSfiDV7a3G6iFxg317hVU/MEOQHFQfDJYegYb2F/f2dY5K75r2of pEsJJWKnioBTB0iiqUIBtjBFRl2Q2OeyS20IsVzGRxstchPERfvqoQnrw4SMeNONvPeu rBCYel5iny8G3eI6CPTxACJWLp0VDrGX3CGUcz+oHlETlUZ9IsRSvlrhe9touUvzBbS6 UQWJQjmQY0Qa5uzqJkrZ0m+TuEpbvlWxrJ95K7R5JrZKYcSljMPsuFc3eIvuqtVLDyJL MxRQ== X-Gm-Message-State: APjAAAWctMQvR4TcpmYXJBbXw53APAVhgyOXehbVw5Cf1pDbAyaX2n6r AYH7RGtOh/RDn0s2gL24Co1/Cg== X-Google-Smtp-Source: APXvYqwIHahkV7OmJhTec3nGOVcSMFteYmrTJOLy83sKUcRrEyjMI1hDLdlyHQdepfshRi6ILbmT5Q== X-Received: by 2002:a5d:6446:: with SMTP id d6mr4221447wrw.72.1551458233185; Fri, 01 Mar 2019 08:37:13 -0800 (PST) Received: from localhost (ip-89-177-134-16.net.upcbroadband.cz. [89.177.134.16]) by smtp.gmail.com with ESMTPSA id v10sm21956031wrn.26.2019.03.01.08.37.12 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 01 Mar 2019 08:37:12 -0800 (PST) Date: Fri, 1 Mar 2019 17:27:20 +0100 From: Jiri Pirko To: Jakub Kicinski 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 Message-ID: <20190301162720.GL2314@nanopsycho> References: <20190301081402.6074-1-jiri@resnulli.us> <20190301081402.6074-6-jiri@resnulli.us> <20190301082529.6d7aee20@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190301082529.6d7aee20@cakuba.netronome.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 >> >> Now it is unused, remove it. >> >> Signed-off-by: Jiri Pirko > >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, >