Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp241755imn; Wed, 27 Jul 2022 05:08:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uM+rJvlIeHECDbVZsWmIJ9bIlxULgmlBv1MUeMmW/iScxFuzhsL+DXMYsqmZFq8Rk+Maji X-Received: by 2002:a05:6402:3302:b0:43c:33eb:79fb with SMTP id e2-20020a056402330200b0043c33eb79fbmr10717169eda.281.1658923701776; Wed, 27 Jul 2022 05:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658923701; cv=none; d=google.com; s=arc-20160816; b=oXydu2aHjY54vWPUqWUunm2IfXFswHahYaggXYepedZvqcg8ctuuxlhiUNswaNEKMR g20M4xjbqpN3M8r61IeZqpbSVE8WXTBsiKXEELtbyc7evYTJ0QqlnxRIaITpHHrPShXp sMn7pGscdLmtRWc3KLn5DPm+yifEGOlDFvFY7Y1s/TgjDkzQyMW1dfeLG/gBUUy1s6kh dExu0c96fePE4UYETQ8zkCEo1kuw2es9RsRXgevzZlaiBW3swYR9FePXfJ+R0TSLUYjS QUVjp1itzszjToCIPXRJH8/NZ+gw6+Y7/U9A7xkwATBdg4UI9edPkYZflvNSSWQHllT1 4fqg== 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 :message-id:date:subject:to:from:dkim-signature; bh=UV/mMyTMs0eKuU5zSJfJOR5cXJNS19F5GWColL/C+9o=; b=M2Xdx3nqiYHeSYcdEJFkBKjO1KCXN4TMySrZrPcBvx43DWZyOL3gCwGhN/HWLi0b0J 6x6ana/FTmZIT1xnhXIwOyoevW/e2AgMjG9bdPrBF06mrl5P8DXkTLrbao22qlmHxE/j 4gmwCN4JRqo/k4RLyb1B5An6UNJj3c70tKZB83ZpeFDMK1bihJFGwsFdf6G8xv7w9Oob 7RiaNMEYveW17m4zO7yX8vyHR9MchshffM483RD4ALaAz5X4zJZb72VKkpYGxjjG/ITx XCmpQAd215+O1Sb/G7Z/Fhqi+2I4Tt5ebMIZI41DED8+nfS6M5Tq3d6DsrWgeNF8bxXe th7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gbMyepVI; 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 qw42-20020a1709066a2a00b00707ad2d64edsi5546074ejc.98.2022.07.27.05.07.56; Wed, 27 Jul 2022 05:08:21 -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=20210112 header.b=gbMyepVI; 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 S231573AbiG0Lfo (ORCPT + 99 others); Wed, 27 Jul 2022 07:35:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229604AbiG0Lfl (ORCPT ); Wed, 27 Jul 2022 07:35:41 -0400 Received: from mail-ej1-x634.google.com (mail-ej1-x634.google.com [IPv6:2a00:1450:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C675922BF6; Wed, 27 Jul 2022 04:35:40 -0700 (PDT) Received: by mail-ej1-x634.google.com with SMTP id l23so31000022ejr.5; Wed, 27 Jul 2022 04:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=UV/mMyTMs0eKuU5zSJfJOR5cXJNS19F5GWColL/C+9o=; b=gbMyepVIxYkgJ6C4UkAOdEEtHLTBRzIPPmGouJ8T8x1U9KfoFU0G1V/3SNvlShjWuq iGFfLmQAMFaUmrhZ3Ufg7SH0dyy/Xq5CL9VKQnLKraKN+6QGqaFyyah6jC/wWMKjgcYT UnLnRqUyJnjBfU+g+lwDHg7ffT3rjoFPKBWPuGYLRTjjCPUsiL1bjLOsxM6w1vyat43R c6mDDXe/ql/JqwDk2cBZkVT049VW/dLBG3sMChsek785R7DYOMuQRX89+T+wJjtFGJP6 ISrTMAoZ6wSjOuEZqS0iLewdkrmuo13XhC4G5kxrQ/XWffuPzsZM8ICMx+uhYJL9HQZt yjUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=UV/mMyTMs0eKuU5zSJfJOR5cXJNS19F5GWColL/C+9o=; b=1jhF5ONMmF3Jsl5bAY5Lxls/bT0pqnAqQJlxMFNwMwb7Ozv0vuUODyXYrxVdH+UbgM GNOEysvmE8K5sIecqbGklPnxHRPiDmIwegNIngRXzothZlwNOmZbAyKdPBFND30Ou73/ +ATTc8+sfpne6iNH72I+7Pk9ehtkvQRukwAllM5COAJM8iXQtHqCpmzxcRRqIL1tIchO IR4RbmPS2sz6qJWLZGB3DDbLjlpAcGbf6RR+TKFLkdfpUEcLyvF98zVbk4gbJQoLJty4 9124K/bSvTe+L90IT2oFNt4h9Sbub7X8uNEMZ0Bd1VHiUUwhOFp86M5B4vmzKt/Q8QqO w87w== X-Gm-Message-State: AJIora/SLRQ88QRVPAyqCOMta0heVYuLdJqEHi+j/R80Id+hROwBLi/y 8p/x2Y/o5SOrXg6RjZVgVYQ= X-Received: by 2002:a17:907:7da6:b0:72f:136d:dba4 with SMTP id oz38-20020a1709077da600b0072f136ddba4mr17325350ejc.472.1658921738962; Wed, 27 Jul 2022 04:35:38 -0700 (PDT) Received: from localhost.localdomain (c105-182.i13-27.melita.com. [94.17.105.182]) by smtp.googlemail.com with ESMTPSA id p25-20020aa7cc99000000b0043ca6fb7e7dsm1334056edt.68.2022.07.27.04.35.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jul 2022 04:35:38 -0700 (PDT) From: Christian Marangi To: Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Greg Kroah-Hartman , Jens Axboe , Christian Marangi , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [net-next PATCH v5 00/14] net: dsa: qca8k: code split for qca8k Date: Wed, 27 Jul 2022 13:35:09 +0200 Message-Id: <20220727113523.19742-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.36.1 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 This is needed ad ipq4019 SoC have an internal switch that is based on qca8k with very minor changes. The general function is equal. Because of this we split the driver to common and specific code. As the common function needs to be moved to a different file to be reused, we had to convert every remaining user of qca8k_read/write/rmw to regmap variant. We had also to generilized the special handling for the ethtool_stats function that makes use of the autocast mib. (ipq4019 will have a different tagger and use mmio so it could be quicker to use mmio instead of automib feature) And we had to convert the regmap read/write to bulk implementation to drop the special function that makes use of it. This will be compatible with ipq4019 and at the same time permits normal switch to use the eth mgmt way to send the entire ATU table read/write in one go. v5: - Wrap function to single line/80 char - Cache match data even for read_switch function - Add additional review tag v4: - Fix compilation error with clang compiler reported by kernel test bot v3: - Squash more patch to skip even more "migration patch" - Add new patch to cache match data in priv struct - Fix extra space - Drop unnecessary cast to qca8k_priv from void pointers v2: - Rework patch to drop dependency with bulk regmap (will be converted later) - Split the split patch to additional patch - Rework autocast_mib function and move it to match data Christian Marangi (14): net: dsa: qca8k: cache match data to speed up access net: dsa: qca8k: make mib autocast feature optional net: dsa: qca8k: move mib struct to common code net: dsa: qca8k: move qca8k read/write/rmw and reg table to common code net: dsa: qca8k: move qca8k bulk read/write helper to common code net: dsa: qca8k: move mib init function to common code net: dsa: qca8k: move port set status/eee/ethtool stats function to common code net: dsa: qca8k: move bridge functions to common code net: dsa: qca8k: move set age/MTU/port enable/disable functions to common code net: dsa: qca8k: move port FDB/MDB function to common code net: dsa: qca8k: move port mirror functions to common code net: dsa: qca8k: move port VLAN functions to common code net: dsa: qca8k: move port LAG functions to common code net: dsa: qca8k: move read_switch_id function to common code drivers/net/dsa/qca/Makefile | 1 + drivers/net/dsa/qca/{qca8k.c => qca8k-8xxx.c} | 1711 +++-------------- drivers/net/dsa/qca/qca8k-common.c | 1210 ++++++++++++ drivers/net/dsa/qca/qca8k.h | 100 + 4 files changed, 1549 insertions(+), 1473 deletions(-) rename drivers/net/dsa/qca/{qca8k.c => qca8k-8xxx.c} (63%) create mode 100644 drivers/net/dsa/qca/qca8k-common.c -- 2.36.1