Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2443115rwb; Fri, 11 Nov 2022 09:20:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf43HV6xf7TLOFtDQa4Lx8ZuPwG/iQK6QR+UCyoTnqoz/dagdktNqfCmAKQwfPUCKnpmZLtA X-Received: by 2002:a05:6402:177b:b0:461:5b75:72d4 with SMTP id da27-20020a056402177b00b004615b7572d4mr2272426edb.112.1668187214019; Fri, 11 Nov 2022 09:20:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668187214; cv=none; d=google.com; s=arc-20160816; b=z763CJNL8sX61Vt0eR+SAd+r/xno6fuoFtb+K01/lTHwalnIywRjzU2m7F78T0ONTe MJMeUnn7SQMgvLc/pcmF6WZl+pNu4Lc4dp+OwkG6Tv80V6XtFSGc+z63anUWjsiL9yr/ zNHi2DtOrZwo+629oyUeenHGI9ZbQq0kDnCmA05et5HJAPgw5/khZRAEVe33C7oqiQhx BR1R1c2NrB3Nplc7xsKrdLNOSR08MevUK28YPluaNMW1Dd47sfqhWMXNfno3VoipFhyT eZLfuXB+sUZUHtPJBnNqPbVsDryTxm07ACjTfhX+CnnLjizkwfwEachgDGzh7cr2eB+R +tPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Tk0Hf69YpxSBIfkAMdq6PCEYbR7nI6ryQyiKET4SZR0=; b=z81pt5Nb4Hg0D9TFTvcqU3QMIlcLB9GOwA2+OB+L00vg4K0E02z8MRI98PaqZ7BAeL M9TtLM5oyrWXgdSP2/WZd3Bqf/EoPrK8QWigtY5zcct+YIpuCCTcDYb8rkClLoxc9jy0 b4WPCp5OwT/L3bNl6ymImlTO5tE0yG4bC8YOvJemLe5iJZRNH2MGq0n8g8SdLky/JsD/ Z6RXFWq1uC+NMHjZkBPwr9KOvhE4wx4rGMPIc8fEuf4zVfQRNNz6YKeelztEkv5qNv1i RCoEqA7YEvVcs/UAqPHMVI+Sj/Zx4QH8av/My0Au6psfw7bCiaLSEq8f+30BublVxfrl /arw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="5wn/6vDB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji5-20020a170907980500b007417c6edb0asi121358ejc.402.2022.11.11.09.19.51; Fri, 11 Nov 2022 09:20:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b="5wn/6vDB"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233317AbiKKRK7 (ORCPT + 92 others); Fri, 11 Nov 2022 12:10:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231625AbiKKRK5 (ORCPT ); Fri, 11 Nov 2022 12:10:57 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B76906447; Fri, 11 Nov 2022 09:10:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=Tk0Hf69YpxSBIfkAMdq6PCEYbR7nI6ryQyiKET4SZR0=; b=5wn/6vDBGpTFEcDieElbxGjbHR gr/SORd92RIorBuTsjdfZQxlTdTfTqLg8RqY2g5VRvTSj6bWf709Y37Q9tnGcyy2uhwWtrtLXKMrf u2qODuuLaKIOtxICJ7TkXV9yONeRZDymOCXwmKQCCEkApiHp3TBPv4xU3K/5wMacl8EI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1otXXc-0028Sr-7k; Fri, 11 Nov 2022 18:10:08 +0100 Date: Fri, 11 Nov 2022 18:10:08 +0100 From: Andrew Lunn To: Rasmus Villemoes Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: dsa: use NET_NAME_PREDICTABLE for user ports with name given in DT Message-ID: References: <20221111161729.915233-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111161729.915233-1-linux@rasmusvillemoes.dk> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_PASS,T_SPF_HELO_TEMPERROR autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > diff --git a/net/dsa/slave.c b/net/dsa/slave.c > index a9fde48cffd4..dfefcc4a9ccf 100644 > --- a/net/dsa/slave.c > +++ b/net/dsa/slave.c > @@ -2374,16 +2374,25 @@ int dsa_slave_create(struct dsa_port *port) > { > struct net_device *master = dsa_port_to_master(port); > struct dsa_switch *ds = port->ds; > - const char *name = port->name; > struct net_device *slave_dev; > struct dsa_slave_priv *p; > + const char *name; > + int assign_type; > int ret; > > if (!ds->num_tx_queues) > ds->num_tx_queues = 1; > > + if (port->name) { > + name = port->name; > + assign_type = NET_NAME_PREDICTABLE; > + } else { > + name = "eth%d"; > + assign_type = NET_NAME_UNKNOWN; > + } I know it is a change in behaviour, but it seems like NET_NAME_ENUM should be used, not NET_NAME_UNKNOWN. alloc_etherdev_mqs() uses NET_NAME_ENUM. https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/netdevice.h#L42 says that NET_NAME_UNKNOWN does not get passed to user space, but i assume NET_NAME_ENUM does. So maybe changing it would be an ABI change? Humm, i don't know what the right thing is... Andrew