From patchwork Wed May 11 09:50:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Oltean X-Patchwork-Id: 12846001 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4DB2C433F5 for ; Wed, 11 May 2022 09:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236182AbiEKJuu (ORCPT ); Wed, 11 May 2022 05:50:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233255AbiEKJuj (ORCPT ); Wed, 11 May 2022 05:50:39 -0400 Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20077.outbound.protection.outlook.com [40.107.2.77]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E3D154004 for ; Wed, 11 May 2022 02:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e5K+CGze+xTGIBbIC539fUV7IKyGdXuCWmwSlBY4+IBJnwS5sUqBQGut4SWKoX8FhEjAWecMxEcd8rKAlB5pTGNeOnz1e7xSRLXWEIoW6PzfTqbTbqKh3rxHxgosAEac8Fldic8ANuOXCHyyFXxJ9t1Z/QdZOr8IzIGmIdti45pB8VkDvlBecByiAZ/ZdDR9fYCodrg756ahAKrJ02wi4juS6GEZdrwsc4whxVcHYLCnK6eL5VCDvvoAGr+P+PCmjoDnPO9cZMnRhEbBNzMkwDalIpHXrJT8lgPlX0ZnE4Uaa9Pg/M6jj2NLBaJ/1Jtyt0b3sN//2df7IoZogHRQ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=irWVgOG0NwOYjjtKdRxvRVXxcmvd1vozq+NbJxq3DJU=; b=Z0iZkxwJ+sOW1cQ82R//4TCodzq5vdVoRO+FhlPXJxAnJK477HZQsMATjkM1Knv3AqiJFxDAAyrkcotbMaKnbFbdNhBSK9zzxrkrqvGhhsRvn0S9jTZVidRMNE3yR7wsZIomx0rY+20CpPyakCSsZWpyRrCwpBBF2YoyNzyzFlY1V5FddFk5BAnqLyfq7mDOtpP50itMVls1YpKAeqphr7spmeLNo+6tXi+z1FP0uuP71syi2VGOHHwiHkRaTe03fhIKHiq3uiZgTK5IPVP+nfUTTun2UxKUKO6MGHiR1jZCuRTHhN5zFQ1lqm7EFcgsp12QAYxas5ftLit8h5cRlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=irWVgOG0NwOYjjtKdRxvRVXxcmvd1vozq+NbJxq3DJU=; b=QfR88wh/Fv2XSJUwK0gQscEp6Is36Up8I3nz1j2Fj4NTYAWuqEx/DF7Amlxk5hbyZqR36u2SndRXxZ46cQ//vf87l4hejKqPvs3Bcb5CfKnFkvrMVvv+2uxMZkek2awdXjAP2u4YStNCpGU36lnh5ISqmbGVHyJ+fgwZeNbTDp4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by PAXPR04MB9155.eurprd04.prod.outlook.com (2603:10a6:102:22e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.27; Wed, 11 May 2022 09:50:36 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::fd1f:cc16:dafe:4bf5]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::fd1f:cc16:dafe:4bf5%5]) with mapi id 15.20.5250.013; Wed, 11 May 2022 09:50:36 +0000 From: Vladimir Oltean To: netdev@vger.kernel.org Cc: Jakub Kicinski , "David S. Miller" , Paolo Abeni , Eric Dumazet , Florian Fainelli , Vivien Didelot , Andrew Lunn , Vladimir Oltean , Tobias Waldekranz , =?utf-8?q?Marek_Beh=C3=BAn?= , Ansuel Smith , DENG Qingfang , =?utf-8?q?Alvin_=C5=A0ipraga?= , Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, Colin Foster , Linus Walleij , Luiz Angelo Daros de Luca Subject: [PATCH v2 net-next 2/8] net: dsa: felix: bring the NPI port indirection for host MDBs to surface Date: Wed, 11 May 2022 12:50:14 +0300 Message-Id: <20220511095020.562461-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220511095020.562461-1-vladimir.oltean@nxp.com> References: <20220511095020.562461-1-vladimir.oltean@nxp.com> X-ClientProxiedBy: AS9PR06CA0158.eurprd06.prod.outlook.com (2603:10a6:20b:45c::16) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f9694d03-fbfb-4c69-ab28-08da3333b2d7 X-MS-TrafficTypeDiagnostic: PAXPR04MB9155:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Tjs1JH44/1e7uVXLxpQa8+qA4fZPWrKwimp/EnkjnOLSLkFIcqAvp79/eURqz/UlEEsS7HnBz7OLnnkr3BKy4fl3dsVSHA5+0dUjteH6iN4V82zCBHkQiKBel0+iCzs1VXBhTQ/9Uo9k8pmwjAVjKj4CDz+7fIqkoxcM90cxTTKOJE9egL6rRHy4hOciXKMt07rcl4/GRc9zgasvTnbemL3uR0ELReH2ptHGwC4KXf2mpCgi68NORLTTPQOEueC0fPokaEwzSvPqB51qQPw3edVgjuVp2SSoORNzg07EZRyx9D0u/noDKzxjeUGBHiYp4hLIOtU7vQRM4ZlZobZePNU7j5pUdm3oryFNCuKghsA4inVU3D4QVlVyWuiOQkEQ8fg5MMKsLmKpjuxDfcRVT2G/aUgrQQAOwYhB9NUgxRnBwLqXEq7cweTZLVUlMrtZymq1Sk2Bw9nIx9NSuGNdS+AY1P9syisIuxmwmParMi0y7/NsNpejjMwwOYwSVSDWlvcc5n/6ZSa1814glXEJNn4UDtv85ilynkfpSazesCDm7b1RMNSi9/lzs/FPc4MQkwU3yUeu96/oqjYCBD2+uttaOIfX1g27oJD4xMFggAFbWKgCdlGiZLuRwU9w6gGxJ8zB71cytrDBK6Hm6GGcTroRtMbIuUcizLPXPwuQFSwtaq1Va+TyU9sA63KGtIxuzCh6W5XBodvIMLcTThvx0g== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR04MB5136.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(83380400001)(186003)(38100700002)(38350700002)(1076003)(7416002)(2906002)(44832011)(5660300002)(8936002)(36756003)(2616005)(8676002)(6506007)(6666004)(66556008)(66946007)(54906003)(4326008)(66476007)(6916009)(52116002)(316002)(26005)(6512007)(6486002)(508600001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fo0wsLDKarnEudleD8KZHXmxOu2C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x7UtYEnEUrRVoJ2pcCq4absCdVkmVLg41LvOBSlcnJXVxYBeYRQivkQ2Sj2wlo4P/n8Bx8L0aHRWOPwZfK4B+8+KupgHeJKyfVcAiaXqD475gLGm4Nw1FjlW4ymp497LOOExv3t6ZhsEC/72ay9tqDuURhTeMxJqyBQbM2kOrbHpBbFe/kyFojL2WKTfHVLUcGU0W2DsL8VBul2T9Kjouqe7GzsVyJ755Df7zMT+1bVV6aq5y7hPTTa5DwWE8PsbkcXAkwN3kheTI+yc5wsyWvXJ8PEjV54ZIKvDjGYPAkXcURfd3LAMf5Ocl+JhhdfLXfDuhY5Y+jFLBsvmUqC6s2QlpgyX0Jj9smLuNEdwG13UUF58pBwAyt8YbYtvbV+MQVOrLilP4EoLARU4Jrut74Etwm8fTq9vohK1TPj4CCfvrs9ZpcqV99S1K3DQ6SM7VikGV5CX5nqip1cIwwVYn5+5J7mImv0q6lDGUPyV+JMQAVYPWk3gfrJAg9Qm10etJZMTMshGILO8p+o+34qDVwNjTy4BmyYfBuHn/QQyn98G6SrrD9nc4CSsbZMIdbGnZOVR4tVFDZYtXf883EeB5MQHW4rwRObB2i0nekXLr7KL0sinMX/1UWo/YiWYCwlXqdxNnLonn8Pfqu5vuK7M= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f9694d03-fbfb-4c69-ab28-08da3333b2d7 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2022 09:50:36.4736 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: n79ePPxaK1+2Y9gu15vBlWnSJLsReog5ZvioTUJkGNHRv+9dOeOpTMRMogpvvv3yzS3O6XrLZYyK/XKcEuKwoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9155 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org For symmetry with host FDBs where the indirection is now handled outside the ocelot switch lib, do the same for host MDB entries. The only caller of the ocelot switch lib which uses the NPI port is the Felix DSA driver. Signed-off-by: Vladimir Oltean --- v1->v2: none drivers/net/dsa/ocelot/felix.c | 6 ++++++ drivers/net/ethernet/mscc/ocelot.c | 6 ------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/dsa/ocelot/felix.c b/drivers/net/dsa/ocelot/felix.c index 5af4f9b3ee32..f8a587ae9c6b 100644 --- a/drivers/net/dsa/ocelot/felix.c +++ b/drivers/net/dsa/ocelot/felix.c @@ -745,6 +745,9 @@ static int felix_mdb_add(struct dsa_switch *ds, int port, dsa_mdb_present_in_other_db(ds, port, mdb, db)) return 0; + if (port == ocelot->npi) + port = ocelot->num_phys_ports; + return ocelot_port_mdb_add(ocelot, port, mdb, bridge_dev); } @@ -762,6 +765,9 @@ static int felix_mdb_del(struct dsa_switch *ds, int port, dsa_mdb_present_in_other_db(ds, port, mdb, db)) return 0; + if (port == ocelot->npi) + port = ocelot->num_phys_ports; + return ocelot_port_mdb_del(ocelot, port, mdb, bridge_dev); } diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c index 7a9ee91c8427..29e8011e4a91 100644 --- a/drivers/net/ethernet/mscc/ocelot.c +++ b/drivers/net/ethernet/mscc/ocelot.c @@ -2339,9 +2339,6 @@ int ocelot_port_mdb_add(struct ocelot *ocelot, int port, struct ocelot_pgid *pgid; u16 vid = mdb->vid; - if (port == ocelot->npi) - port = ocelot->num_phys_ports; - if (!vid) vid = ocelot_vlan_unaware_pvid(ocelot, bridge); @@ -2399,9 +2396,6 @@ int ocelot_port_mdb_del(struct ocelot *ocelot, int port, struct ocelot_pgid *pgid; u16 vid = mdb->vid; - if (port == ocelot->npi) - port = ocelot->num_phys_ports; - if (!vid) vid = ocelot_vlan_unaware_pvid(ocelot, bridge);