Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1537521rwd; Tue, 13 Jun 2023 10:22:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AmM2YSgS5FkNqmUUrHIrdlzjBVEijOskeRtLBJjk3Q3/5SnaM7K1GkpRrdbK0+DCN0dIH X-Received: by 2002:a54:4789:0:b0:39c:e31c:b14b with SMTP id o9-20020a544789000000b0039ce31cb14bmr5045277oic.4.1686676961743; Tue, 13 Jun 2023 10:22:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1686676961; cv=pass; d=google.com; s=arc-20160816; b=Bjo4fQnfMQPuyxRc4MgiUmbu524xqMND6xZg7KAAuEi6tDL/OWh+qkUJWc1NEZnFbT yiSh8SDXTHAiWx1Mk/lvz5K6i69pOBaEf4tMNlhZKJ93zYwxbou2fLJ0n9Xd77r8eoIq LOE3NCE+eEm1CNCSkiKUQiBjbtoJdTCjDqkpX92K1XIJwkdJD5NL2FQ398pI4OkMkiqm /YFoQQMVfFOwWbhCWgwbCT6zplO9CbvrJzePzYdx4tNj7hmUqPPCzgcj9Wd20jRuziLw OfhMEyYKvYQ/swkzqamLzBabpWhjzLABKjJRkrHRIovQjAmTa70Ahj+h/SakxbxZSLEx RWLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=nEMtIqngoCAEAyT+fpf/LXjugwgNpXqZT2MooeG0VEk=; b=DqGmTdH7StRdR0i9PRH7lA/t0xI+vt4VVYFswOyBbMGm7V19k9tOarSnL9MyViwlD/ Bzz3IanvEVlWTCve1q4EtQVtOy94Kcfc66bkRra++mwwndGdDZgSbN0RECfhyrrtPkEu Q+jO43dKzjtnR3JGlj3OkxrbE2akLlnL6VWYa4K95qlYrw6zNJJW1lYaHoKVLWE8HlV2 ggIyuh7Oe2WUV2EXfa2Wuzi7Pi0FsrYw8sbEP/Ejj8siUJjt6yqux+FmIdayA4w7qaxw GstpmOBgeYOSoWe/7sMQuhImlO5lUAjHwbdtwmKHHppisLfejzuXHwthpw3QZEGZoVDh 8mIQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arinc9.com header.s=zmail header.b="AjM/jtql"; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 k11-20020a17090a9d8b00b0025bdeb86c50si4167497pjp.137.2023.06.13.10.22.28; Tue, 13 Jun 2023 10:22:41 -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=@arinc9.com header.s=zmail header.b="AjM/jtql"; arc=pass (i=1 spf=pass spfdomain=arinc9.com dkim=pass dkdomain=arinc9.com dmarc=pass fromdomain=arinc9.com>); 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 S237514AbjFMRPg (ORCPT + 99 others); Tue, 13 Jun 2023 13:15:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231454AbjFMRPe (ORCPT ); Tue, 13 Jun 2023 13:15:34 -0400 Received: from sender3-op-o18.zoho.com (sender3-op-o18.zoho.com [136.143.184.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD48B19B7; Tue, 13 Jun 2023 10:15:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686676491; cv=none; d=zohomail.com; s=zohoarc; b=lz3sdfZjEVjsHOHX1i+1kne1PU5B10VTEJ44ohq/FmwWqdNKwhrNoLHDhK2b759ZrPb8QW+aOxebY9rvuEy9BoHRf5UpGzM3OOhCGbwpastP8gtNxAGk354KLiUpNrvUetaRV8ukyVo8hVZw+yy86/Bl/AvalnYDJc3UdQ8HVTQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686676491; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=nEMtIqngoCAEAyT+fpf/LXjugwgNpXqZT2MooeG0VEk=; b=UCzvd6VAF+Y+FiklAgTUDa75yDjZBBA8aVVlr6qHHCd5l4TjL7Am1DMeHAaGKCjiPt8lzCoKr0BTpRsFaFG88oyFmaI1rzhBgeU/tIQoqgOcGCIhNcwM19CnhUGL3vWTsDBVyd7KSJVeMx6RoTeKEHW1r7ACx+XUxfPNpnegl4U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=arinc9.com; spf=pass smtp.mailfrom=arinc.unal@arinc9.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1686676491; s=zmail; d=arinc9.com; i=arinc.unal@arinc9.com; h=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:Cc:Cc:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=nEMtIqngoCAEAyT+fpf/LXjugwgNpXqZT2MooeG0VEk=; b=AjM/jtql6fiVufSKKLUDB2frT5CoRHbXUAhS6wYCvEJ/OeIkFE9tAPWHv+b1r/0f s62ZjndlrGNUMdHbnpy2k2X0cUMV4h7iIxxl6XkJC7fCzely07TlDuXhGDat4fiKbOz IieXNrnAKjgBiEjKdb06JgsFBfgOK65omjiwfkKc= Received: from [192.168.1.248] (178-147-169-233.haap.dm.cosmote.net [178.147.169.233]) by mx.zohomail.com with SMTPS id 1686676484920865.7792338096236; Tue, 13 Jun 2023 10:14:44 -0700 (PDT) Message-ID: Date: Tue, 13 Jun 2023 20:14:35 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH net v2 2/7] net: dsa: mt7530: fix trapping frames with multiple CPU ports on MT7530 Content-Language: en-US To: Vladimir Oltean Cc: Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20230611081547.26747-1-arinc.unal@arinc9.com> <20230611081547.26747-2-arinc.unal@arinc9.com> <20230613150815.67uoz3cvvwgmhdp2@skbuf> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20230613150815.67uoz3cvvwgmhdp2@skbuf> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ZohoMailClient: External X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On 13.06.2023 18:08, Vladimir Oltean wrote: > On Sun, Jun 11, 2023 at 11:15:42AM +0300, Arınç ÜNAL wrote: >> The CPU_PORT bits represent the CPU port to trap frames to for the MT7530 >> switch. This switch traps frames to the CPU port set on the CPU_PORT bits, >> regardless of the affinity of the user port which the frames are received >> from. >> >> When multiple CPU ports are being used, the trapped frames won't be >> received when the DSA conduit interface, which the frames are supposed to >> be trapped to, is down because it's not affine to any user port. This >> requires the DSA conduit interface to be manually set up for the trapped >> frames to be received. >> >> To fix this, implement ds->ops->master_state_change() on this subdriver and >> set the CPU_PORT bits to the CPU port which the DSA conduit interface its >> affine to is up. Introduce the active_cpu_ports field to store the >> information of the active CPU ports. Correct the macros, CPU_PORT is bits 4 >> through 6 of the register. >> >> Add comments to explain frame trapping for this switch. >> >> Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") >> Suggested-by: Vladimir Oltean >> Signed-off-by: Arınç ÜNAL >> --- > > My only concern with this patch is that it depends upon functionality > that was introduced in kernel v5.18 - commit 295ab96f478d ("net: dsa: > provide switch operations for tracking the master state"). But otherwise > it is correct, does not require subsequent net-next rework, and > relatively clean, at least I think it's cleaner than checking which of > the multiple CPU ports is the active CPU port - the other will have no > user port dp->cpu_dp pointing to it. But strictly, the master_state_change() > logic is not needed when you can't change the CPU port assignment. > > It might also be that your patch "net: dsa: introduce > preferred_default_local_cpu_port and use on MT7530" gets backported > to stable kernels that this patch doesn't get backported to, and then, > we have a problem, because that will cause even more breakage. > > I wonder if there's a way to specify a dependency from this to that > other patch, to ensure that at least that does not happen? Actually, having only "net: dsa: introduce preferred_default_local_cpu_port and use on MT7530" backported is an enough solution for the current stable kernels. When multiple CPU ports are defined on the devicetree, the CPU_PORT bits will be set to port 6. The active CPU port will also be port 6. This would only become an issue with the changing the DSA conduit support. But that's never going to happen as this patch will always be on the kernels that support changing the DSA conduit. Arınç