Message ID | 20210823212258.3190699-3-vladimir.oltean@nxp.com |
---|---|
State | Superseded |
Headers | show
Return-Path: <netdev-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1ED50C432BE for <netdev@archiver.kernel.org>; Mon, 23 Aug 2021 21:23:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0683E613A8 for <netdev@archiver.kernel.org>; Mon, 23 Aug 2021 21:23:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232963AbhHWVYO (ORCPT <rfc822;netdev@archiver.kernel.org>); Mon, 23 Aug 2021 17:24:14 -0400 Received: from mail-eopbgr30042.outbound.protection.outlook.com ([40.107.3.42]:5229 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232724AbhHWVYA (ORCPT <rfc822;netdev@vger.kernel.org>); Mon, 23 Aug 2021 17:24:00 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HeZGnL68QPSSEjCz1ajgJOCNGOQfXENVgwyqUwWGRPn67ST9p87+YeZKOsfCdIllDtPPmsKI0UOzCQnyR8WfIC6PtgztvNojjTooVT8WEQOf452NuRcT6L9Qj5TDLrgvhvZTZdGlu7mAAWz4rnYj/05woCH1txwb5DWbGcAUaRn5tBX9W0NLRotdK5oltcOcR5qIvpSTCIJvJaw7+dWA+d2i/sKVkf+F9aHu4IS/jiy1mxBZZdZTF5PmRmFIL4Ay+raqw6w6QiflpUj+WSnlno/NG80LmhqViuNe92/fFqNmxQarfD+anmns/YJtwh561rcecOsR6+bTfEEP/al0qQ== 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-SenderADCheck; bh=3jV3mPb8PPAsAc846U6PNc4Qha/nVyXRJKB+MO1YCBQ=; b=LppSwtnkRcJD2xXBM+5rC6GmpKLs7R9qb7oh3j4EQl910Fdn5ATjIKGiOcRW6qcEB2ui9CDaXooqvKvnSUaTg0Phq9xymbPRVjWmAEhC/DtaobhaBxM3eI/5Ekj9VrnXIs94/ncFuT98LpD67q631D3w1eEa3REGNBcmfeh1dsJObjKTooYmZgxOh+69zJ7Z6XEqIFZtUkmsS9U1ZLLwiNEYCgm4zYFpvWU0UNFT2piQuujxxaOiu6y1wwbmsXxBYOBv9C+iAtwtC0I896NvEkcamAkOXBLEldtE/mbUI5JXIHIFYhkkZBrYHgL9XTz1Djbnq1dACGbUr/BMCjVoXQ== 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=3jV3mPb8PPAsAc846U6PNc4Qha/nVyXRJKB+MO1YCBQ=; b=XGh0uCRKgpoGTnwu2/geHWupgdgrfdXvX8vgurso5svMrwa6kcNQ7nm41LfR49986vWLatWLDk776ttfcCu4UATYGEMkuHmvoU222E1wqKYluMZ4TEnXPdxEaHhoxJSPq+w2LsDTSHa3yynNrhiOpMAKupVWjcJQrkhhBs2zu04= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) by VI1PR0401MB2685.eurprd04.prod.outlook.com (2603:10a6:800:58::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Mon, 23 Aug 2021 21:23:15 +0000 Received: from VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::109:1995:3e6b:5bd0]) by VI1PR04MB5136.eurprd04.prod.outlook.com ([fe80::109:1995:3e6b:5bd0%2]) with mapi id 15.20.4436.025; Mon, 23 Aug 2021 21:23:15 +0000 From: Vladimir Oltean <vladimir.oltean@nxp.com> To: netdev@vger.kernel.org Cc: Florian Fainelli <f.fainelli@gmail.com>, Andrew Lunn <andrew@lunn.ch>, Vivien Didelot <vivien.didelot@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, Tobias Waldekranz <tobias@waldekranz.com>, Kurt Kanzenbach <kurt@linutronix.de>, =?utf-8?q?Alvin_=C5=A0ipraga?= <alsi@bang-olufsen.dk> Subject: [PATCH v2 net-next 2/4] net: dsa: properly fall back to software bridging Date: Tue, 24 Aug 2021 00:22:56 +0300 Message-Id: <20210823212258.3190699-3-vladimir.oltean@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210823212258.3190699-1-vladimir.oltean@nxp.com> References: <20210823212258.3190699-1-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AM3PR05CA0150.eurprd05.prod.outlook.com (2603:10a6:207:3::28) To VI1PR04MB5136.eurprd04.prod.outlook.com (2603:10a6:803:55::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (188.25.144.60) by AM3PR05CA0150.eurprd05.prod.outlook.com (2603:10a6:207:3::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.18 via Frontend Transport; Mon, 23 Aug 2021 21:23:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ffc078a3-070c-4472-32aa-08d9667c37e6 X-MS-TrafficTypeDiagnostic: VI1PR0401MB2685: X-Microsoft-Antispam-PRVS: <VI1PR0401MB2685FFBCD8309D50FDCC4374E0C49@VI1PR0401MB2685.eurprd04.prod.outlook.com> X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Lal147Ysg8OR7a4Q6QawQDEwhmZkjPytwZkG9PGhMATvMTeDmI5IfRawFUoavNwrmrYzAbCzQGHXoKwUbATAWrezO6/soK4nzTJo6OVN/JPgKd4X5CtZ2wz6jJ7PyUIZECMCkOsjZSqhhQ0W0YUsn5w01G38Twv2c3rUrlgwkj3xfl2O+7tnybkgHQ58a91Yq1XBj1zDzEORrrTK8hO+YPAFK+iP4qO5MNjGh194s0t/cYePR1vpaLK2CLg3NJD8fE2z7kjDD0IBRc4ym4QD7+r4LmEhuomfySdkmNpoqSu2f+rC18PZOzM7Rjv/sWNZFOXl3ENX/PPm8wd42kevbJkYTI0rXQFxDoofSMjqfUv3eo6FpnupvTBi10O2vi6EveKGE1nQANJmPuoxhR1Er6+9pn9BDITD81IGjgnOGY5Yc+5rQ4Rw5VRC6MD2/bWpQSMX1JIMc9olv2aE9dJolZQ9BfrLAMXrslHnuaAjJMkJc3t0sTh0dOAgtUNTMe8/ToKQAXKvBxKwXQkzy8MK7FiKIDgnGh9eT+EXWo7W4tlEpqUFsqx8R16TdNMejK13Wi/vaRNClEZxKaZsRD3atZaoY9UG7PispAg0GjnVdx1sMZP1fKeRhHZVuTzlFgan+UCa07ddxGxKRkovmjo0+M6KjYBf+DLWzibcW++WMP3w/z2G1pDvI0xaaN+sAOvaW8RhGmB7YuW7iggPzqz04g== 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:(4636009)(39850400004)(376002)(366004)(346002)(396003)(136003)(86362001)(66476007)(66946007)(66556008)(316002)(6916009)(54906003)(478600001)(83380400001)(66574015)(38100700002)(2906002)(38350700002)(186003)(36756003)(5660300002)(1076003)(6512007)(8936002)(6506007)(2616005)(956004)(6666004)(4326008)(44832011)(52116002)(6486002)(26005)(8676002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?udYIKM74tiHpz2IzJFZgwUu1i?= =?utf-8?q?88TOEgzFkQHndxP2x+WnAoRwrwsich7ltwSNw8luCNXM/4ZWbcDcxKoL?= =?utf-8?q?xhsUvr8XYysKVAABzTcEZCSc0MN912x4Oc72xtaWbfyghXt4PMFYvpX3?= =?utf-8?q?ji8lN71oe4IZY8SYWzS7xOd4oP3I6e8q2jq/gvPCebEpZPJoBvN7GRrD?= =?utf-8?q?q1kKh7OikN+vo2MA2UjVtgsejVfbcAiq5vLtWQnsjQ6Htu1W3oQYfRHM?= =?utf-8?q?NntwWc8Vqgmi6T6IhDQ0m5kumteYd4p2Ggr/12XnyMy5YKy1H6SG1dyF?= =?utf-8?q?eVtkVc2AJ9IFtQvTOg8/IuzMupSNeZ90j/zamTlJ9ooBE+0qUeNQvqXV?= =?utf-8?q?dmdE14pQ2cwQpCtlFMJY0pwTvz16HFUIMD8nJjx73+/Elsr/so+aOSmR?= =?utf-8?q?3zRx2jQQaTHxO5Qw3bcG2xISadUHp7uJWtrmWitOyyb8/oMm0Gl7rGJg?= =?utf-8?q?7JQE1RMjEBeKPKag8cPWObkiNLc6U/gVibCUdy+ENOn1M4Y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9667c37e6 X-MS-Exchange-CrossTenant-AuthSource: VI1PR04MB5136.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2021 21:23:15.1185 (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: oRSQYdTIjJp/zKjnG6R4AEzSXjmsGUWSg1jCny6YKn1K+Rg6u1GX+E6DK1MfPS24X5rXM10laHr08RlbJ2MM+A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2685 Precedence: bulk List-ID: <netdev.vger.kernel.org> X-Mailing-List: netdev@vger.kernel.org |
Series |
Plug holes in DSA's software bridging support
|
expand
|
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index eb9d9e53c536..f785d24fcf23 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -2009,6 +2009,11 @@ static int dsa_slave_changeupper(struct net_device *dev, err = dsa_port_bridge_join(dp, info->upper_dev, extack); if (!err) dsa_bridge_mtu_normalization(dp); + if (err == -EOPNOTSUPP) { + NL_SET_ERR_MSG_MOD(extack, + "Offloading not supported"); + err = 0; + } err = notifier_from_errno(err); } else { dsa_port_bridge_leave(dp, info->upper_dev); diff --git a/net/dsa/switch.c b/net/dsa/switch.c index fd1a1c6bf9cf..dd042fd7f800 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c @@ -92,8 +92,10 @@ static int dsa_switch_bridge_join(struct dsa_switch *ds, struct dsa_switch_tree *dst = ds->dst; int err; - if (dst->index == info->tree_index && ds->index == info->sw_index && - ds->ops->port_bridge_join) { + if (dst->index == info->tree_index && ds->index == info->sw_index) { + if (!ds->ops->port_bridge_join) + return -EOPNOTSUPP; + err = ds->ops->port_bridge_join(ds, info->port, info->br); if (err) return err;