Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp451545rwb; Wed, 16 Nov 2022 03:09:46 -0800 (PST) X-Google-Smtp-Source: AA0mqf4GKXe/SEdwq6wjzQlWBAmDXBUXwT6Un0A1Ywrx2EEb31p5LbpSiURAbse9zu3lEijwCvX7 X-Received: by 2002:a50:ef0b:0:b0:461:9b6c:a415 with SMTP id m11-20020a50ef0b000000b004619b6ca415mr19079419eds.261.1668596986678; Wed, 16 Nov 2022 03:09:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668596986; cv=none; d=google.com; s=arc-20160816; b=wzoHlG46HfjpEYZb8TLLEFBYFyL9F288+Dlwd4IG3gYIZkoYqdgJUuxxAqbNQfD6mv TzE/RZma6ZonBQ5oTSN6G/yXhwAAyH3O4j95qNzoLe6cuSzGibJ0tC5KXXEzZjqij+GS jhbs6mvQ8PPAjHOyCkdCBeHtmcPjLgOOuI4lPbajxReBl5+LHcIfzaX6OBl1uld0zuvK D0wBZJM/ggmftXLLpUTQdaWQT+hhKKUdIj9gcuO6QXsth87wijf9g5peSUbf6Yd4K4H7 xI/e2zu8le+Zs4SZjfbLffzsyBO0TxLp8ncGwWeE4IihLSnCcJ4Tz+nGM/UbGrPvUthF Vhsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Plqwnup+7oIelGEONlO5qvIt8Tuu+/wT1TXFJs1u9Nk=; b=l5zo2wV3AOE86N9FDesq+EolCYtZIeSFi07n1oRYZj7Uf0w7jkS0P7jKUiAKOMiTri ImXlSHGOpoHX2LDNFERIuwEBNZpqqkIZ4qqA4txXa3HyhFQj3C7XusmjZafkKdIZDG4j oXq3R1uIJH+QxN8fuWf4SyGIH2M2hJa/UvloyDSerFV40+WJo+H7xEFjtBEJ48FTIt2j 5MdX8j+jgkk1SJpyAhaN4W+tVl+7BSyhB4TlIcSgIMb8ggQqq0bBvT2EmFZ7JTBJTa4G KaN6fbe8+O+NE98j5/cIPNO3cCbUFmVKnX1w4+BsNhaH6RoSjjvtPgFQeoCkvtum3HJm U1Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rasmusvillemoes.dk header.s=google header.b=edTfsxl8; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q7-20020a056402248700b00456964d3369si14069372eda.230.2022.11.16.03.09.24; Wed, 16 Nov 2022 03:09:46 -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=@rasmusvillemoes.dk header.s=google header.b=edTfsxl8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239026AbiKPLG1 (ORCPT + 92 others); Wed, 16 Nov 2022 06:06:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238608AbiKPLFm (ORCPT ); Wed, 16 Nov 2022 06:05:42 -0500 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B660F30541 for ; Wed, 16 Nov 2022 02:52:12 -0800 (PST) Received: by mail-lj1-x233.google.com with SMTP id x21so21297756ljg.10 for ; Wed, 16 Nov 2022 02:52:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Plqwnup+7oIelGEONlO5qvIt8Tuu+/wT1TXFJs1u9Nk=; b=edTfsxl8lhPrR/gzCTwcVjVGe7HY9DcTsgM5PzvXupDXWAahISUX/t7qj7j6wsvZAB xJOrpZ0YJ3ZWOTnpV8q6t+UhgJeXGOdxhB/O69iyc8wumAieFnlZDVEk/SYXg//QMYZ8 Gc7lUQPoSqfuhGarWKYaGCE2rnkKC6QraGVDE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Plqwnup+7oIelGEONlO5qvIt8Tuu+/wT1TXFJs1u9Nk=; b=V81lHzpJ+IUgKdgViiJikDVFFX96qOF3umG8nUmZ9/8e1UkKnltGQdWB1SU/RH6enI 7UiN07iMLBK+xTF2yQXZ1mMpR6J46X57fJpf+/H5FgNm6bt+B32mjt3HUNwVUrkbfxWQ LRUj2SD3/2R9KNgRiECdCH6uakgvV99vglVy52hzRm1yhW/Bf5oc/lRIoUhE8e46yXaJ /j8ZagtufAJr7Qvx9m0WURXaYUGA3w1uyKEn+0+bPaRqJY6E4jlWBVASBTaDYoKVVv1d KYXyX1nBJcMgNk81nRSvxXHgUnKz9XOqgkJbkSDUJfo5GzK1a3Jr+azi4h1uKMUGs2/X FodA== X-Gm-Message-State: ANoB5pmcYfULgc9MgBzikiT5h7+KL6iX2slKiCPsPFWUFKkFvj4hY92q 6mxRtMS91qmBKssxYvfnddgb6w== X-Received: by 2002:a2e:b007:0:b0:276:ff14:7a4d with SMTP id y7-20020a2eb007000000b00276ff147a4dmr7197293ljk.490.1668595931072; Wed, 16 Nov 2022 02:52:11 -0800 (PST) Received: from localhost.localdomain ([87.54.42.112]) by smtp.gmail.com with ESMTPSA id g42-20020a0565123baa00b004b094730074sm2547119lfv.267.2022.11.16.02.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Nov 2022 02:52:10 -0800 (PST) From: Rasmus Villemoes To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Rasmus Villemoes , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/3] net: dsa: use NET_NAME_PREDICTABLE for user ports with name given in DT Date: Wed, 16 Nov 2022 11:52:03 +0100 Message-Id: <20221116105205.1127843-3-linux@rasmusvillemoes.dk> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20221116105205.1127843-1-linux@rasmusvillemoes.dk> References: <20221115074356.998747-1-linux@rasmusvillemoes.dk> <20221116105205.1127843-1-linux@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 When a user port has a label in device tree, the corresponding netdevice is, to quote include/uapi/linux/netdevice.h, "predictably named by the kernel". This is also explicitly one of the intended use cases for NET_NAME_PREDICTABLE, quoting 685343fc3ba6 ("net: add name_assign_type netdev attribute"): NET_NAME_PREDICTABLE: The ifname has been assigned by the kernel in a predictable way [...] Examples include [...] and names deduced from hardware properties (including being given explicitly by the firmware). Expose that information properly for the benefit of userspace tools that make decisions based on the name_assign_type attribute, e.g. a systemd-udev rule with "kernel" in NamePolicy. Signed-off-by: Rasmus Villemoes --- net/dsa/slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d19e9a536b8f..dfefcc4a9ccf 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2385,7 +2385,7 @@ int dsa_slave_create(struct dsa_port *port) if (port->name) { name = port->name; - assign_type = NET_NAME_UNKNOWN; + assign_type = NET_NAME_PREDICTABLE; } else { name = "eth%d"; assign_type = NET_NAME_UNKNOWN; -- 2.37.2