Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp104238rwd; Wed, 14 Jun 2023 12:56:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ARBHzbovHUWfgWgEWM9Kokmh5JTbSbwcY3mbrZZwpfT4JUsztawVjJo7wCc99EYlbqlxg X-Received: by 2002:a05:6a00:2d83:b0:64d:3e99:83a5 with SMTP id fb3-20020a056a002d8300b0064d3e9983a5mr3654341pfb.26.1686772560390; Wed, 14 Jun 2023 12:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686772560; cv=none; d=google.com; s=arc-20160816; b=OFodd7TgkUX2nPvoK4UXLpQLlx4P6yAs1fKBdU3ITQMhZiXru6zfERGQY0ZTzDEGuV ZBh5S6Who1A94n5qERTqQYIZEy0Z8IjEOfOFPLDXXCsC7DWl9mB3rZQ2yUwxCSpvIIEQ 6QQqjyBR4GCwKXApS4gvhdy2Y5/mwfheXcJs7v7zsHTEofpI7VVXjl86vgL/acedrSry pP4SD6IRCtjyNlvEu0NAMkUFtqP3WKdTTk7y5hhL8gdwO68s/UCqM9MtDmNGE3PXpi2c 2Xr8Q8OIuC+6ulqkgve76C+R1AJjj+u0auiUav1KV/717nfKqtaBG1hwu12PRqb2AjJ6 7o0Q== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=wo2k8B7MGNyxmh3jaU19PWvWJJrdjMUIt4dfyXki7UM=; b=s1VvlF/5wMeK8xOnrKPqxLKnEdCuYMufe1pkv0D+wqexuHVmX40mXA4/TFcVwtsguq 6p0YsehHPiA5sZgwqsHv5QfCmXVMWSgb135CfhgLCw36Q2n0hB79wEItHd2qaLH6TlnR TLy4ZaSn7YOsUhT05GHGRupJStLOCiGVGdwe/3d7L28GqyTv9dZuC0dfaP1gotKUN19V BmjSl7swE4G2yxTsnT00rlndYkp/+FRjZVSpmUTaVj+3YVAMltFutCHQMXLUqksTM6wG 7apEKhrZSyRxyQWBEJEAYpk1mZlTMUwuk+5MEBC2hFBu5TkK9MRCS2G0C7En0Njz05EJ gZfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=hhV5dkXm; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t13-20020a654b8d000000b00543c84bf588si11468021pgq.473.2023.06.14.12.55.47; Wed, 14 Jun 2023 12:56:00 -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=@gmail.com header.s=20221208 header.b=hhV5dkXm; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239824AbjFNToO (ORCPT + 99 others); Wed, 14 Jun 2023 15:44:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237237AbjFNToF (ORCPT ); Wed, 14 Jun 2023 15:44:05 -0400 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E03542702; Wed, 14 Jun 2023 12:43:36 -0700 (PDT) Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-976a0a1a92bso172733766b.1; Wed, 14 Jun 2023 12:43:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686771815; x=1689363815; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=wo2k8B7MGNyxmh3jaU19PWvWJJrdjMUIt4dfyXki7UM=; b=hhV5dkXmdZjOD+oCwVkjm+9276XiooihM6cbKdbPUe3KqBZfH9hX+fIL0LO9xZD1bB 0cb6PPHnur5fU2vRZ1jDHw/SrwFRdfL5PrUBc85QzwgfqHa8BQw+63yln12/bf2tCACQ cicqZPwDh0+t6LhqETb2+pabhlKhEiFqV5dhd8XDOaOAGYBrtv1X0WNns9hKBZKFh1Oz pignhGM7d5IOd3g1w/4WqY3ohWlvju0/ytScdGTjAcG42Vg2V3KrlFIGFTUy4IQHt2yk OmPVu7rhNN5qgRfdEVU7ihV7jHjH3v4DQlZQ/UdY8BbfE4ZKfgOuz2XvSyz9dCfFxuSj b1Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686771815; x=1689363815; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wo2k8B7MGNyxmh3jaU19PWvWJJrdjMUIt4dfyXki7UM=; b=IzhloRQvWM6C2k+0yi8g+pygcX222Zr7I66/jJrtx4pbvR1DFfnW6ZVena6zpgFbF1 Xhhvl9134Ye8462jVsH0zW1SSaCjKfU7VFkJ+U9+ou3XbGZC4mMH+tD2naruenqtDvd5 bhH93lh+tivn/vTU/CRiZf1Lqg9NGzeCEhOkArvKXT8xVo8rY4nqzq1G9YPQjMmSsQR/ YPomctjstPBWsAYTQc1MQZMxCAGOA4bzjugg4wsV7y/O/A9dZ4hLVRh/tXuhv9x/n97N qGl9MvzT4w5Dlzxr5kjeJCAXFFjuEvRyC5QcTodSUH/RjVSAmlVFkWgVbpI8vN/JxhO8 BMsA== X-Gm-Message-State: AC+VfDwFKthqPuau71AihvJZqw+HuOCow8ElzMAAA9RfN6pNZ2oLRLur rsg5NtYJDMh29EIUJMtDgmE= X-Received: by 2002:a17:907:2684:b0:96f:45cd:6c21 with SMTP id bn4-20020a170907268400b0096f45cd6c21mr17745808ejc.30.1686771815063; Wed, 14 Jun 2023 12:43:35 -0700 (PDT) Received: from skbuf ([188.27.184.189]) by smtp.gmail.com with ESMTPSA id rs15-20020a170907036f00b009823e62ca91sm2517430ejb.189.2023.06.14.12.43.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 12:43:34 -0700 (PDT) Date: Wed, 14 Jun 2023 22:43:30 +0300 From: Vladimir Oltean To: arinc9.unal@gmail.com Cc: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= , 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 Subject: Re: [PATCH net v4 1/7] net: dsa: mt7530: fix trapping frames with multiple CPU ports on MT7531 Message-ID: <20230614194330.qhhoxai7namrgczq@skbuf> References: <20230612075945.16330-1-arinc.unal@arinc9.com> <20230612075945.16330-1-arinc.unal@arinc9.com> <20230612075945.16330-2-arinc.unal@arinc9.com> <20230612075945.16330-2-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230612075945.16330-2-arinc.unal@arinc9.com> <20230612075945.16330-2-arinc.unal@arinc9.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Mon, Jun 12, 2023 at 10:59:39AM +0300, arinc9.unal@gmail.com wrote: > From: Arınç ÜNAL > > Every bit of the CPU port bitmap for MT7531 and the switch on the MT7988 > SoC represents a CPU port to trap frames to. These switches trap frames > received from a user port to the CPU port that is affine to the user port > from which the frames are received. > > Currently, only the bit that corresponds to the first found CPU port is set > on the bitmap. When multiple CPU ports are being used, the trapped frames > from the user ports not affine to the first CPU port will be dropped as the > other CPU port is not set on the bitmap. The switch on the MT7988 SoC is > not affected as there's only one port to be used as a CPU port. > > To fix this, introduce the MT7531_CPU_PMAP macro to individually set the > bits of the CPU port bitmap. Set the CPU port bitmap for MT7531 and the > switch on the MT7988 SoC on mt753x_cpu_port_enable() which runs on a loop > for each CPU port. > > Add a comment to explain frame trapping for these switches. > > According to the document MT7531 Reference Manual for Development Board > v1.0, the MT7531_CPU_PMAP bits are unset after reset so no need to clear it > beforehand. Since there's currently no public document for the switch on > the MT7988 SoC, I assume this is also the case for this switch. > > Fixes: c288575f7810 ("net: dsa: mt7530: Add the support of MT7531 switch") > Signed-off-by: Arınç ÜNAL > --- Would you agree that this is just preparatory work for change "net: dsa: introduce preferred_default_local_cpu_port and use on MT7530" and not a fix to an existing problem in the code base?