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=-9.0 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,URIBL_BLOCKED,USER_AGENT_GIT 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 00E0FC4360F for ; Thu, 28 Mar 2019 12:57:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C9769204EC for ; Thu, 28 Mar 2019 12:57:02 +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="R1SEW27t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726718AbfC1M5B (ORCPT ); Thu, 28 Mar 2019 08:57:01 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55420 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726601AbfC1M47 (ORCPT ); Thu, 28 Mar 2019 08:56:59 -0400 Received: by mail-wm1-f68.google.com with SMTP id o25so3471323wmf.5 for ; Thu, 28 Mar 2019 05:56:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BtRvBpiq3Sbkg56t9Nlm/HSvWcTQe/rTXzYzx6VZrNc=; b=R1SEW27t4e558ucYevYYJadN4NG0YKuhHKQx+JYpreq4qP+dXLKJpmHr9AlcZ4IOFG DF6sNYXXyNFe0VhYUotWbGzbCOiv5+pFG+w2PFhuA5n+JyAzMgaF1h6bYVF0pE6ZJdAg Wyfk4RD7mQatUtr3qIilM80jyULFJ03i7f+gqIqswl4RK2pBdK3poeYt8gHBuFvjPUiw sRHlX1ArwoDNwKIWe+sJ/jGb1BJxRU1irA9aLxLpTEKMBuikLPppf2OTO/JdTAHxEaXy yqRa8V1gkxCW5YrN1S8jDFDQPwkrv+SHiF66qbLzErRrwW5bk36RnCzrbgf+3q4P9zmg x0KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BtRvBpiq3Sbkg56t9Nlm/HSvWcTQe/rTXzYzx6VZrNc=; b=fsFZZJBSKDHmtvIOlZyyQ5CRWv6nlSatmY2sjMD1G2sX2m2hXZZxMekOlS0XxS30MG o9m1NJkpxwsKgUtW+pysw4WrtUTZQ/1GnUaRdn9EgYaB2XyPQDuxq5vqegJLvyD0q1Gk xuKNvIRuMJhJBnsxj78Xk4i0UVKBpxEr5kWcjbmyBHQtGTJYbDsnA2BcwtWWuYD2K/1D qykc91hNzxgk0DjIWyAY/N+BFG8pMid8ZVMZNwqV2Xah0wsGLCaYGwBzXqzLzGJyEzW4 7GbdnFpZvPVH7pL267/zNFwufYW/3HwVDQswTo2ZpplYNIR1ej6Fkh3+sXSi1eXKs1y4 5llQ== X-Gm-Message-State: APjAAAUXIuOMIF0MdzPkvOW4g8lGb+xKuKYjgka7MEB57dqzFx7rMplk Wbg4lnHQIUDO1n4nciFzLYap90Gd8j4= X-Google-Smtp-Source: APXvYqzHFDLB6ZwvHZGLaJ7eBr3o2uMjYmVkmKnh8/OH+GIglUR/c2ZzKFudCqPxzKkY0+IdrGioLA== X-Received: by 2002:a7b:cd95:: with SMTP id y21mr20462628wmj.29.1553777818101; Thu, 28 Mar 2019 05:56:58 -0700 (PDT) Received: from localhost (ip-94-113-223-73.net.upcbroadband.cz. [94.113.223.73]) by smtp.gmail.com with ESMTPSA id c10sm29515346wru.83.2019.03.28.05.56.57 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Mar 2019 05:56:57 -0700 (PDT) From: Jiri Pirko To: netdev@vger.kernel.org Cc: davem@davemloft.net, mlxsw@mellanox.com, idosch@mellanox.com, jakub.kicinski@netronome.com, f.fainelli@gmail.com, andrew@lunn.ch, vivien.didelot@gmail.com, michael.chan@broadcom.com Subject: [patch net-next v4 10/12] dsa: do not support ndo_get_phys_port_name for non-legacy ports Date: Thu, 28 Mar 2019 13:56:44 +0100 Message-Id: <20190328125646.872-11-jiri@resnulli.us> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190328125646.872-1-jiri@resnulli.us> References: <20190328125646.872-1-jiri@resnulli.us> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jiri Pirko Since each non-legacy slave has its own devlink port instance correctly set, rely on devlink core to generate correct phys port name. Signed-off-by: Jiri Pirko --- v3->v4: - changed to return -EOPNOTSUPP for non-legacy ports v1->v2: - new patch --- net/dsa/slave.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d1a0a656b6b5..80be8e86c82d 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -736,6 +736,13 @@ static int dsa_slave_get_phys_port_name(struct net_device *dev, { struct dsa_port *dp = dsa_slave_to_port(dev); + /* For non-legacy ports, devlink is used and it takes + * care of the name generation. This ndo implementation + * should be removed with legacy support. + */ + if (dp->ds->devlink) + return -EOPNOTSUPP; + if (snprintf(name, len, "p%d", dp->index) >= len) return -EINVAL; -- 2.17.2