Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1231228rwi; Thu, 27 Oct 2022 13:02:04 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4dRcnv1xoZjdX0I5S2n8CjeNiM92BS6ujMA4Le32MZ0So04ZsXEP9Kzsui4p854gHHoByh X-Received: by 2002:a17:90b:4a04:b0:213:587b:204e with SMTP id kk4-20020a17090b4a0400b00213587b204emr10737762pjb.98.1666900924312; Thu, 27 Oct 2022 13:02:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666900924; cv=none; d=google.com; s=arc-20160816; b=aN5p0qXKHvhkKOoEq6NDcx1Y8u1RREsqONnst+mAh8H4pZKeYPwq+yVX4JssoAoM/Y Qwe39ZjDpEdLu3PX3hszRFjUfRoZQ5AFGAkY2/Y1UvStvOgxTQGQ9QX7VoT09fh6vCGX emM7AwgiXwbLASo093LSq/G61L+HOLTOnHxMJ5ZELseMk6VglJfhisISbNhETX3xhhFt i2cdDMS/2qAM0a1iJoftTo5obZSzba1wpT0ZEll03ZcjSI1+rWtfixu/Vzc2m6xEcMwL CmFZOMLbeYAqNcfua7vn5HPyNV8+bur/4bn4OhIvzWf1+jeRyIkHtdyV1CT72iPkqYcM gIWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature; bh=bP6tBJ5LItFY8cd4o65sGEV49YMopXKugfmg9p8xRTM=; b=TCA48lqiTBjJCnza36YIHZlPuH58XjUHpg2pfK511EqDfvAyYwGi5vlIidzYozi4qp iyobyQNpMnteMS0Yff6iejOf+5yOjZ5tf7sx9yem26jeRwqyWAXoyp8NUCvErgfIFH1c AQ7f1uCz7nSXDpKDf52a1NOy3EvAJqjiuqfNTLMd6LNlshgp8BRNyKVxNaGfCfJReY1Q dWIoUfIwE3rB+GjMHWTRLjrbHVMikWKiPyDyPOvCZlDPbKh5CP3OEA3tLNPhr5NH6/wZ HmX0B7bqSivfteBkoY3jNk69fpS4RR2D3UIyifn4c2OhODUn0OYT59d2ilfyP/e8Eeld ZQaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b="C/RCOzPp"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y12-20020a17090a600c00b0020c8e9efc7bsi6492593pji.47.2022.10.27.13.01.46; Thu, 27 Oct 2022 13:02:04 -0700 (PDT) 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=@walle.cc header.s=mail2022082101 header.b="C/RCOzPp"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236016AbiJ0TK1 (ORCPT + 99 others); Thu, 27 Oct 2022 15:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234810AbiJ0TKZ (ORCPT ); Thu, 27 Oct 2022 15:10:25 -0400 Received: from mail.3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE2D1C3B; Thu, 27 Oct 2022 12:10:22 -0700 (PDT) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.3ffe.de (Postfix) with ESMTPSA id 0E7B61B40; Thu, 27 Oct 2022 21:10:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1666897821; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bP6tBJ5LItFY8cd4o65sGEV49YMopXKugfmg9p8xRTM=; b=C/RCOzPpijiskM8GR4oWBWVhWGDQYsLqZMnjGE/cuPhXKJpyx7M9UEqDaODTkB7HbFPBkE 77Muipe+zGVcdfPeTxIb1giXj4JWHmr6SXkqleqXLj3eKTeXc5/zakRA6sKenGG3fxP0We /pwpfDY5Rzh6jENo0sWyYoSHhyZyjPBcoIfPymYY4YjTPzZPPc7LLaf2oLFLotFdmr0Omc Dp5IButJAWziLhCReJxzplljbOaFXjDR4s2fQ3gmbgtPd7KECppSkh1rk8kEPVT9JSla6v 4BFkjozxh1HpMBN88KkafrYpPSRmO6122qDvDOBOeqmP99kJtn3x6N7/4Z5loQ== MIME-Version: 1.0 Date: Thu, 27 Oct 2022 21:10:20 +0200 From: Michael Walle To: Vladimir Oltean Cc: Shawn Guo , Leo Li , Rob Herring , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Heiko Thiery , Andrew Lunn , Florian Fainelli Subject: Re: [PATCH] Revert "arm64: dts: ls1028a: sl28: use ocelot-8021q tagging by default" In-Reply-To: <20221027180445.74btifpmfhkt74zy@skbuf> References: <20221027113248.420216-1-michael@walle.cc> <20221027120519.7f3xun66l4lamcq6@skbuf> <20221027122727.fhs35eqtzmeen6x4@skbuf> <84c5e0a041909615a1ba8a4508131206@walle.cc> <20221027180445.74btifpmfhkt74zy@skbuf> User-Agent: Roundcube Webmail/1.4.13 Message-ID: <3ea25819670c088df0cc6f483ab4fe01@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Am 2022-10-27 20:04, schrieb Vladimir Oltean: > On Thu, Oct 27, 2022 at 06:00:04PM +0200, Michael Walle wrote: >> > - change the MODULE_ALIAS() of all tagging protocol driver modules from >> > "dsa_tag-> > proposed. I don't know why the current MODULE_ALIAS() is formatted the >> > way it is. Maybe Andrew can comment on whether this is feasible. >> > I think there isn't any backwards compatibility concern, since only >> > modules compiled for a certain kernel version are expected to be >> > loaded. >> >> FWIW, you can have multiple aliases if we somehow need to keep the >> IDs, >> too. > > Yeah, that's worth exploring, but it means that we have 2 code paths > for > request_module() with different string formats. To me this is slightly > undesirable, we should try to consolidate the mechanisms in the core. > >> > - put a translation table between string and MODULE_ALIAS() inside >> > dsa_core.ko, which potentially duplicates code. Maybe if we >> > auto-generate it somehow? >> >> Yeah, I also thought of a table with of name to module alias mapping. >> But then you'd have two places to keep in sync (of not autogenerated). > > Well, to be fair, this is not exactly true. As far as I could find > (grep for "ops->name" in net/dsa), there are only 3 instances of > reading > the "name" field of struct dsa_device_ops, and none of them are from a > fast path. > > I can imagine a table along the lines of: > > static const char * const dsa_tag_proto_names[] = { > [DSA_TAG_PROTO_NONE] = "none", > [DSA_TAG_PROTO_BRCM] = "brcm", > .... > }; > > which is then used to directly replace ops->name > (becomes dsa_tag_proto_names[ops->proto]). > > Then, we could add a new function "dsa_tag_protocol_name_to_id()" or > something along those lines, and construct the modalias string based on > that. > > No duplication necessary, since we would remove dsa_device_ops :: name. If one would a new tagger you'd need to add it to dsa_tag_proto_names[] as well as adding the tagger source file. Thus, two places to keep in sync. And you don't have all the information in one place, e.g. the tagger module. The name of the tagger as used in sysfs or device tree is then in the core. Just wanted to point that out. After all it's up to you as the maintainer to decide ;) -michael