From patchwork Wed Mar 18 02:47:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222347 Return-Path: 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 7A942C1975A for ; Wed, 18 Mar 2020 02:48:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4C10A20753 for ; Wed, 18 Mar 2020 02:48:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="H9VOoiFE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgCRCsG (ORCPT ); Tue, 17 Mar 2020 22:48:06 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:20090 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726666AbgCRCsG (ORCPT ); Tue, 17 Mar 2020 22:48:06 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i29B+hHTbuV+n44H9OhNkTl3n6y2FPFpEJ/yMLpUgdcd5S03zcH4+jnAX/DAgwN46Ed6ZXewg9D/eeGjiuW/tUugW3lHAfIOunQHUsFXL2TQJqa+av+b+X2Ia77D5DrM2W5ojlBvKmNecyKBSilBl1+tL8ryGYFeB7D6CtHTGppnAMJwrzxL1sA2vDPT3JnECrEQ2AXhIZ2wvTVnUzALss4aOCfgDl5oTdmPazdP6VJqEGdHhBNTmd8dQcoWJuQyHioKKK/M4j8EPYwG4WaDF/1xzH1xvPVMqyuaTRquy9nxrMrrsWaIlyEEX0zM4Ft5wz9GuquN7dEKZ4XE/uKX4Q== 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=+s3TlkBkc/Xj65k/6uz8DO9eAGpdLwBIfgbD3Jwb7eY=; b=WxkG01ODnUXLVvrUJmz+A0ZFH540od8eBQe68ZC0c63sCUf4iYfx7TFS6wZvSGv9TE4Qajx1lzM8DKQQlUQDvOJQ8/+RLEeluwYuw09ZnfPgmfRf9cVPO/vBjoYgIBEB/jwCBCIpoX46ddG8uF8GxAUOIV20AG0ApgDEE430yL3psb2q7LtEFlnB2wYxfxkzfm0GrqfN0hqsemAxYkcKew9t1J9LBhmMS4SIyKttEq4cOBZGCHUtYj87T1vVQl5mjo5Ks9LZSdZV6hOt5dQGTk/bcrWBe4l+USWGE05SpOnMJ6I/jL2tOErQ1PvH5yl0ebYkAyXn1uKrVUDyd6i08Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+s3TlkBkc/Xj65k/6uz8DO9eAGpdLwBIfgbD3Jwb7eY=; b=H9VOoiFEBwN7tGCwpsxeul5+0Apjv+z3j00uJnZWBMYy8losiS6DkqVm4KqMG/xQzO7H/LlZ5gxn36R8O6WPZFUzIpY05GJKJVfeyfRqGV4iMd9AH/Xytj0X9YmssN4jvrStUpewuoTLNVLj8zcrbZmrGj6uJrW77ulxe0g8lcI= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB4109.eurprd05.prod.outlook.com (10.171.182.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Wed, 18 Mar 2020 02:47:58 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2%7]) with mapi id 15.20.2814.021; Wed, 18 Mar 2020 02:47:58 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Nathan Chancellor , Nick Desaulniers , Saeed Mahameed Subject: [net-next 01/14] net/mlx5: Add missing inline to stub esw_add_restore_rule Date: Tue, 17 Mar 2020 19:47:09 -0700 Message-Id: <20200318024722.26580-2-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318024722.26580-1-saeedm@mellanox.com> References: <20200318024722.26580-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12 via Frontend Transport; Wed, 18 Mar 2020 02:47:56 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 561ff051-8b8d-454e-bc33-08d7cae6c491 X-MS-TrafficTypeDiagnostic: VI1PR05MB4109:|VI1PR05MB4109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:23; X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(199004)(956004)(478600001)(2616005)(6486002)(2906002)(54906003)(5660300002)(52116002)(86362001)(81156014)(6506007)(81166006)(4326008)(107886003)(8676002)(8936002)(26005)(66946007)(186003)(16526019)(1076003)(6512007)(66556008)(6666004)(66476007)(36756003)(316002)(6916009)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4109; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ne2xIIgZ94YrvuImXygY7lqqL9d7qYKAHbYe0lT13L9rn7rmKUIbiWvW1culJSeHE4RICEiitJEVroAtRD/RccEiA67jtqER1n85SEDIA1m6b0W1muW9rtIHJL3IDS0GKYSxuXsVmO/vHIrD3Fz48sxXoBRJEJ2Nw3SJr+SQCr++1dilcarDgWaIJGEtdfjCnfp9CqUq+AsITuD5Mm+tVWXbUUjLSPFc10AsifX4JI+Z9+x9VdylC1l5p6LgvDeDlMZHCjHRh1HGqMdgWdIYJZC9nutFwhYdOoWl3MIJikKpUmw2PZ0LXwEiHPh3E/QTxPxQY/K4kpvNldNEwV7qoY5SBsaNTRjK8JaqzgaEvPy/Roh7i5hUauOBIAOkXjWTHbdKGuOTkDKFr3gPQ31tka9oo9z3EmsEvxPrfdk4enQhGvnkVSgPvzkF/Loh6e0eCUvuP33UEGpoNytIZ20RvwElJUmqkCf6i3VQnbcIzuQMxFseJa4fNGRMPdJh/yr9Az4gz87D8dS85xOlk41TBooLCYAwh8e+5cNXej5xm+Q= X-MS-Exchange-AntiSpam-MessageData: CnSH0SkhyZsJ+ydao1qmeLk53CS32DIgx6JeqyonGQh0/K0k6UTdOy+Se2jR13JXCn8S54RqbsRVQ5MvOS3+LeT1Fx/6+sZ46lv5D9/dpU0Ibn+/hkv2Y00fTitYTI/4EHFqaIY/tOjP7Suph158/Q== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 561ff051-8b8d-454e-bc33-08d7cae6c491 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2020 02:47:58.8386 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fE68E3L5ToLFRBWLbUiHxqjg+/wg1BLsdEMMxGf8iI0PYlO5fqZjSkTzjEvnYfwxeEUjgbkcQtdTO3Ll9TCW8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4109 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Nathan Chancellor When CONFIG_MLX5_ESWITCH is unset, clang warns: In file included from drivers/net/ethernet/mellanox/mlx5/core/main.c:58: drivers/net/ethernet/mellanox/mlx5/core/eswitch.h:670:1: warning: unused function 'esw_add_restore_rule' [-Wunused-function] esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag) ^ 1 warning generated. This stub function is missing inline; add it to suppress the warning. Fixes: 11b717d61526 ("net/mlx5: E-Switch, Get reg_c0 value on CQE") Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index 91b2aedcf52b..2318c1cfc434 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -677,7 +677,7 @@ static inline const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev) static inline void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs) {} -static struct mlx5_flow_handle * +static inline struct mlx5_flow_handle * esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag) { return ERR_PTR(-EOPNOTSUPP); From patchwork Wed Mar 18 02:47:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222346 Return-Path: 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=-9.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, 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 7906AC1975A for ; Wed, 18 Mar 2020 02:48:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 48F1E20752 for ; Wed, 18 Mar 2020 02:48:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="jWjspd9L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726858AbgCRCsL (ORCPT ); Tue, 17 Mar 2020 22:48:11 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:20090 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726666AbgCRCsK (ORCPT ); Tue, 17 Mar 2020 22:48:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ehvm/npErR6P9q62MK4h2AzVU+VKv6QHjgvLbqoaKJkGSLxdwSWcaJAZgzOm9ZpnZbm5fTNeUBHwPiBeayYdYm3haKb6pGtvuqgEJmfidGbxQ18npp3Ah/FxMvuRZGnwGSDxTF8+mXIp2F0tHhsa65tzWtYsFKEHHhROvtcEO4uwRj2miMKujV7G/Z4EWToY0B8QBsobXYLRCFpff0MV3WP4E2IiNgFj/yMPaxoGoZRru2Agm44cTsVfy8T3hGhTChOu8ftP1Hu8P1uJgpkRA31kkVes4IxO7fQoEP9op1y5/HchUubfivpGbmq0xi2/2azbjNSdXdrs0duxalyipg== 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=N/0JDZtwIt7Z09Uh3u1+DMfO2KQlwIWAB89RWPlrmhI=; b=a5BC0E2hRhQXDFSGiIebc6ho7HGSzzFLAC8aLbplmDXJaHYtm8/AGgRXA1tLmO79lHKtabTBni7xRZVXj+8f8QvjOZ2N1u7sVIN2S9EB/ZdUexlJN8PhdQ/0Wh/Q4tsNHacTFXzK8mFUUxIwk6VxW/EcYJ5AJ/jGxIlRGb0XmlGLuLs1oivFL5JmeS88KXNOgbPdWKxalvEGw+4GDVjdOQN/pr3bwMGxhGrLe5Dr5I2H9MrEtcu91mvMKPI2XFi5X7WX0lSJYaQJKWEgu1MDJCrUYBxGWeW8w+USCx/wVANZ4x+KmQc4i/USJ6fEuVTG2r33L0HeR8dACTdmvdfEDg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=N/0JDZtwIt7Z09Uh3u1+DMfO2KQlwIWAB89RWPlrmhI=; b=jWjspd9LRANNW4cTie2yUVJHyN/wTFU0KIz9X7M5YSV0L5aPFGkngplekGJXLr1ctC/jp8BkwC7CAorlT6B3BKeZuWRq8pqbYk8ug5oruxUahhEvY7eKWskwLf3BEew2WzRk8sHN29MfoNa81XSWPh1OdAsGW8teKwls8gUDfkQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB4109.eurprd05.prod.outlook.com (10.171.182.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Wed, 18 Mar 2020 02:48:03 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2%7]) with mapi id 15.20.2814.021; Wed, 18 Mar 2020 02:48:03 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Paul Blakey , Oz Shlomo , Saeed Mahameed Subject: [net-next 03/14] net/mlx5: E-Switch, Skip restore modify header between prios of same chain Date: Tue, 17 Mar 2020 19:47:11 -0700 Message-Id: <20200318024722.26580-4-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318024722.26580-1-saeedm@mellanox.com> References: <20200318024722.26580-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12 via Frontend Transport; Wed, 18 Mar 2020 02:48:01 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 3aeb8cce-acc8-4962-4a99-08d7cae6c740 X-MS-TrafficTypeDiagnostic: VI1PR05MB4109:|VI1PR05MB4109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5236; X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(199004)(956004)(478600001)(2616005)(6486002)(2906002)(54906003)(5660300002)(52116002)(86362001)(81156014)(6506007)(81166006)(4326008)(107886003)(8676002)(8936002)(26005)(66946007)(186003)(16526019)(1076003)(6512007)(66556008)(6666004)(66476007)(36756003)(316002)(6916009)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4109; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y8s/sN+dfIDwr4WD1obV9j47q0dUb31aAZzVsHnVOJXOqdm0QodLRVqyIR1SPtv0SoKeITS8sTtmm29gFVTrA+RDahLrmyS2VVfI6IzDkK//8NLhMQjzb5EUbLxLkJjGKYsfRj/38bMC5z18xMOtCqKMaQBr+X0Spb06iHn6UrRvlIRK6ypDYwW3KW47C84bAhyduvSF/j3/pDN+jhCRb12zvrZhVX9R3fBlWeB3m/2cDRnpLBb1aKdogg5OXdpq/INlZ6cJxgLGY8Su6oSAhLV83taQbhyXa3jaLwxINXwlJshpMa7YOnVIUAJESPn/k+cv1n3bGocuTkPQ+RikLeqWoEU4w4+ABNQv0ZX63YmI5VGzBxVdTnBMLgtq80zw98f1sIyzu3yPmA4UValfu9fyZduQN9zst1vddYOWhfpqMDefgHlalxkUx53FRko/ulCcOOjXWcd7MujAYCKdfOqfBwfBa8NUagT3yM8XheazEUxiEjf8Y6PobT0lafP1g8eC7Wh0bLPOpkE0SEAqfvCf0bwemuf+HQ9chLwDM5w= X-MS-Exchange-AntiSpam-MessageData: zALYTfe83kS2/DN6z3LUn/4P54DuYhMSBDXWj+t9hYg7YLrjIHDmTIaomKXLXxhfKg7gDeFOB17wknQFHX15xYUWGWHczbYa+WHsm+hQFyW/LptZ23PcwVc9eLQvEQFkLSGOKNm42dBbRMBW1eotgw== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3aeb8cce-acc8-4962-4a99-08d7cae6c740 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2020 02:48:03.2881 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: h8aXKp1NPz+ZAU4kgpGmVH+3BplnfhIuX/Qv0lHvOspdIhfCI6MM2bHkvVyUaxBPbXvkTTbPurJfgCrjaHQlug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4109 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Paul Blakey Restore modify header writes the chain mapping on the packet. This modify header and action is added on all prios connections, and gets overwritten with the same value consecutively in prios of the same chain. Use the chain's modify header only for the last prio of a given tc chain. Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c index e1d3dc31311a..1e275a8441de 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_chains.c @@ -422,7 +422,7 @@ mlx5_esw_chains_add_miss_rule(struct fdb_chain *fdb_chain, dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE; dest.ft = next_fdb; - if (fdb_chain->chain != mlx5_esw_chains_get_ft_chain(esw) && + if (next_fdb == tc_end_fdb(esw) && fdb_modify_header_fwd_to_table_supported(esw)) { act.modify_hdr = fdb_chain->miss_modify_hdr; act.action |= MLX5_FLOW_CONTEXT_ACTION_MOD_HDR; From patchwork Wed Mar 18 02:47:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222345 Return-Path: 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 7B2D1C2BB1D for ; Wed, 18 Mar 2020 02:48:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4346A20724 for ; Wed, 18 Mar 2020 02:48:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="PQ2tI0cq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726894AbgCRCsR (ORCPT ); Tue, 17 Mar 2020 22:48:17 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:20090 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726616AbgCRCsQ (ORCPT ); Tue, 17 Mar 2020 22:48:16 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YHr3Zoyytg/kLVkGJEX9wifUyMkxeX6FPs7zTW58gdPmtnbZfwu8h77UBNgMvoYMSWKcTq0JMKppu5jFXhjbjdbd3rv9MhxAkp7mKp8iofLNfDyNrO+2OvxElm0AkVKsIWt3vep6Ra7GxD6PTNo4f/P4pHvfJgPhsfyk+xBPoS7Y24sjqLfdYpLtuZMOYNOEr85Jlg+SQO2O9Gs+DY3+4ZvG5khhKcBmI1IZ3DXnoQKOjCv9jfJqyJdJ7gzK/1hl/FrmXjZmuQTo8YI28gn6XnPmBQ2aHuuqelEkXmKcd0aF4ivIAqawVMnmd3lovBZMgnN+dhIqPtGt9giayrECEA== 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=Qqw0KKJxvcNaYuFzc0U4W8nYxKuS0nKmkUSzrThxC44=; b=XcC/MwpTj8y8Txv8qTq3IrrYPB+8qQzV/HAFvBfYhNR6jb3EiCfVHYhMS0ZNIn2EbKU5fBpa4pMh4lQ6+Jx59dsZdfS6iUWftoEcbVQHDwNTtnUw8JJQQoK85LY1KXJzj313e4OcZk9S/I9bSQxTJlXXfyTu1lx7mEI434jid/F6WAsh93sOR9xR8y1CGB+LFoixnxlkQq68UFka2lD70Nk+iWBN3917EwOOEPW+VpK5po6BX96EeEzyEV1w0ZvoJYvl3p/rFKlcPMfKYfwRsKKS158gtEAV1EfSt5w50aXfv3w4WRCwC+WmhXxVAPgmLKz32x1RzJSs5udrDywk8Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Qqw0KKJxvcNaYuFzc0U4W8nYxKuS0nKmkUSzrThxC44=; b=PQ2tI0cqboBDDq9bjE3cYasFXlTORmBd5j+e8gR6az/if5MOzyF3hM/8N7JQ4dfIHOFdlg7zUvMn+gp8xUhE1a93++eugjZee+6JkRpTiINDgTzJnnwWn1SUg0qbLzr3rIR30mMuprYZsuRiJhRjkXiNUOtkIzk7n1PeB4hQBtA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB4109.eurprd05.prod.outlook.com (10.171.182.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Wed, 18 Mar 2020 02:48:07 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2%7]) with mapi id 15.20.2814.021; Wed, 18 Mar 2020 02:48:07 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Paul Blakey , Oz Shlomo , Saeed Mahameed Subject: [net-next 05/14] net/mlx5e: CT: Fix insert rules when TC_CT config isn't enabled Date: Tue, 17 Mar 2020 19:47:13 -0700 Message-Id: <20200318024722.26580-6-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318024722.26580-1-saeedm@mellanox.com> References: <20200318024722.26580-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12 via Frontend Transport; Wed, 18 Mar 2020 02:48:05 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 79c807b3-b4b8-4a5d-8f61-08d7cae6c9ec X-MS-TrafficTypeDiagnostic: VI1PR05MB4109:|VI1PR05MB4109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:513; X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(199004)(956004)(478600001)(2616005)(6486002)(2906002)(54906003)(5660300002)(52116002)(86362001)(81156014)(6506007)(81166006)(4326008)(107886003)(8676002)(8936002)(26005)(66946007)(186003)(16526019)(1076003)(6512007)(66556008)(6666004)(66476007)(36756003)(316002)(6916009)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4109; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AXtci4dA1LPuLkDiB4HMM3Q4rADlpkFNRs8KtAX3jCJORd6RrgS0MUJSzeF27BNaqHA/tdq1M90GL1wuzgXJEeyWFwu9332ZIk6FdZFUs9UT7nMEL3Teoc9/VUKmW5YppAhsQ54lEQHiQVpUjr3qzhLvs6TKsZR/BkZny9KJUa8fsJwaoiiM0Bpk6KQ9cvECu8+JsYRHdBLqge1i5YJkYsoKmkHos3zhYVUpcFHfvH/2r6qwJFQTnLeTCyKVWh4wG2odYw3+ZPpbsC85tQVKwxRH7NDkowZGatiOaguNPBfaDMIYWXNeAEanG/diQFk6ReHNKnAcAGqVlZwPjKRl8C8USCgwl3jU4PEnIeplxgArpc0Sw+VaM9MWNo/VTGwnFdZ1IKWIH8r6wZoCLTcbKKTDsNdLq2QPouW+9IhQRTDcu5P+wNUaCAt1GnWzzemRx3YU8HpKsq6ohbllZ90/5ceDO9NnF6uZmXwtPMiquosvPjTrfu8kXHyB8xT+JDepHQVxOOjpDQtfWV6jKAVFgFad+e+mVM6uwQEl/YnHAqg= X-MS-Exchange-AntiSpam-MessageData: uvy/Lze4iHQfcAThMzjCXEGa6Q+Pgha+6UYwlXDv1id/ECVIDSie53zhCb8ifWfsF9+GNiXtvGPTpDkzunwga7chsNVvgbUehkAxKGhVJ+wVBK1OI3pJIqqiCo8f7H0iqt1gzN20iIIpxCVbF2joDg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 79c807b3-b4b8-4a5d-8f61-08d7cae6c9ec X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2020 02:48:07.7685 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: u3Xor1UaGAuNnbN1UkS1PwcOQN4oBfMOxdXrh1G90bTXizhlYB8QuuAkLGGSuV2YJPXZZ+jWInmerduBDPqqIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4109 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Paul Blakey If CONFIG_MLX5_TC_CT isn't enabled, all offloading of eswitch tc rules fails on parsing ct match, even if there is no ct match. Return success if there is no ct match, regardless of config. Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking") Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h index 6b2c893372da..091d305b633e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.h @@ -8,6 +8,8 @@ #include #include +#include "en.h" + struct mlx5_esw_flow_attr; struct mlx5e_tc_mod_hdr_acts; struct mlx5_rep_uplink_priv; @@ -128,6 +130,11 @@ mlx5_tc_ct_parse_match(struct mlx5e_priv *priv, struct flow_cls_offload *f, struct netlink_ext_ack *extack) { + if (!flow_rule_match_key(f->rule, FLOW_DISSECTOR_KEY_CT)) + return 0; + + NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled."); + netdev_warn(priv->netdev, "mlx5 tc ct offload isn't enabled.\n"); return -EOPNOTSUPP; } @@ -137,6 +144,8 @@ mlx5_tc_ct_parse_action(struct mlx5e_priv *priv, const struct flow_action_entry *act, struct netlink_ext_ack *extack) { + NL_SET_ERR_MSG_MOD(extack, "mlx5 tc ct offload isn't enabled."); + netdev_warn(priv->netdev, "mlx5 tc ct offload isn't enabled.\n"); return -EOPNOTSUPP; } From patchwork Wed Mar 18 02:47:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222344 Return-Path: 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 2FB9BC2BB1D for ; Wed, 18 Mar 2020 02:48:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0426E20724 for ; Wed, 18 Mar 2020 02:48:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="KjRyikYh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727131AbgCRCsY (ORCPT ); Tue, 17 Mar 2020 22:48:24 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:20090 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726616AbgCRCsX (ORCPT ); Tue, 17 Mar 2020 22:48:23 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EBmXIAk32XP4TjTQIDEDO/UNHFAgcKr3b50e9C37EXCOmaE2PqNapaQSYFP164yRPUC9bbI8vpjPXv2AM1IyKSC3gkL6goS3q26KZoCaIjyVjCkeAKA5kWI8ajKdFLtCdfRGqftTbmeITgHEeqaCJWIw0xYZMrw2k5BLxsqg0DZRiDOVEJSijyszvk8L7TWsyBtDvzyBiCZWs6urikX54qoh+Yw4avwm1WgRPD1EdgOZMhEk9gHdzDl2htEciD9NHgcugGM7Otp2b+/PPmV2bsjRWK7zsH0Y033umGY7rQaT2oH3PDvDlu+VXcBwKropDoxQ7W/dIsbCHoekxMVlAQ== 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=7MpvtKVJsj7qy3hmUhizjQbx13PJZs9ta2VL2whYP/4=; b=Yd6lsxEowlJARxWybbj8AuA571OJEDO0kjLtycNOOPOV23Az1F1ZUFoAh7KDJ2lEyihGMfphQFeQ9I8Im5PFjEEIjSkBB3pWR6OY9ov+mxnfn/Oz1jJGKZRcfp41+wDHW5SrXtP7XF68OYLRWY6ZnqhYvQJYnE0AsmbmgGa15vgXRDp7WmgWzUYQNYkN1UMBcVnDWc7Jp/4qOqgfq7ynPV8m1giqYwdJD36IT+lEZ5mhjvYYP9sC5GVaBCB53fb4XvraO5Pr1wKYkbK9xDLtqnhBHdcoGPRBDEig65EYxED95pJogQrcvl5aHpfl/qDG3cO0jFtBHNnTg2e23a9RUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7MpvtKVJsj7qy3hmUhizjQbx13PJZs9ta2VL2whYP/4=; b=KjRyikYhieSKbCIoaHOkWH7cagbxYzEWj4WPR4Bcq4R5g/juPdRFZEJZ2Lfj0OCjuvQqG6W1H9K4fkUNOlnssLzeT+CJuBJMHBuEdpO1bNcGHoU+UdlvSrYHDSiAwDXSSN6VlAqKrFIe7aYn+Ug6jwcvqDH3T6ciC4GeEAiC7VE= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB4109.eurprd05.prod.outlook.com (10.171.182.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Wed, 18 Mar 2020 02:48:13 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2%7]) with mapi id 15.20.2814.021; Wed, 18 Mar 2020 02:48:13 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Paul Blakey , Oz Shlomo , Saeed Mahameed Subject: [net-next 07/14] net/mlx5e: en_tc: Rely just on register loopback for tunnel restoration Date: Tue, 17 Mar 2020 19:47:15 -0700 Message-Id: <20200318024722.26580-8-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318024722.26580-1-saeedm@mellanox.com> References: <20200318024722.26580-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12 via Frontend Transport; Wed, 18 Mar 2020 02:48:11 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 8edc8874-9dfa-4972-a962-08d7cae6cd48 X-MS-TrafficTypeDiagnostic: VI1PR05MB4109:|VI1PR05MB4109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(199004)(956004)(478600001)(2616005)(6486002)(2906002)(54906003)(5660300002)(52116002)(86362001)(81156014)(6506007)(81166006)(4326008)(107886003)(8676002)(8936002)(26005)(66946007)(186003)(16526019)(1076003)(6512007)(66556008)(66476007)(36756003)(316002)(6916009)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4109; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HiAR1M4FgfIYggcNSHbEAxROOvZ1txnV3Jwruf22qqsRT8OaznTQarm/mTBkfm+I69TtvUdSxBocWyJNtdOZsBt2MxoRq9kXzfplEMmBLbXikaYMvEchCa+EnDTpUF+DZEtwhwlMHUYuSN2T0w7ipv28ChttlkMAY0ECpvJ2UaygbUktCWhH+enpLV21Hs3hjEzTbNwL/oOmxSHleJxcIemowNhq5x0etNR3wlJNTAt4V72M0eorUN2qgafsJrZJ423MMcJfUDr5xMygdKUqc0tWj3BpOeQ3KloPrUW6zLKp9HE1ClMy9CBAZom9DTr/34NtE42VJZ4XaRDaWvd9FQhpuJGr9aPUB5UDwPu7jayqhHm0z7PfEXEFkeQJBJvzT9641DGm5PqZfgJ5qF1mPVgNdrs+vuWL/Cf/xxUiA77a2s4DQYJpordBrdOUV3RIFe0udfG2l8RW5+YKB8oyBYuShJSqoR4QD5P99MrUTeub98TQDSrBJwSbpbtlHMDcwI10Elj5BYNEKyBd914o3vWEm4KiYC/NZMo78C4tbJs= X-MS-Exchange-AntiSpam-MessageData: eW9bn2gQsCVLY6gzQLJDbz+MiGgZUdAkX54dMT/RJfgoc2kIgXrhN4yA97SDlX3MZh6x3TCPif2wQD4kPxfr5BMYsk3j1AQll06UfQXX0eipkzmBFAttYpDK4o7pj3vRUicxtj5anYek/DkGEY+1Fw== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8edc8874-9dfa-4972-a962-08d7cae6cd48 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2020 02:48:13.3423 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fJ4Nj1u0wRdftgBIgLKAWWvie4ZOK2za5qClGCPid1syd3bJ+TfNc5sFLZ2KG0eMnbusXpeWopnE2Zi47XZZ6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4109 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Paul Blakey Register loopback which is needed for tunnel restoration, is now always enabled if supported and not just with metadata enabled, check for that instead. Signed-off-by: Paul Blakey Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 044891a03be3..a2ff7df67b46 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -1985,11 +1985,11 @@ static int parse_tunnel_attr(struct mlx5e_priv *priv, *match_inner = !needs_mapping; if ((needs_mapping || sets_mapping) && - !mlx5_eswitch_vport_match_metadata_enabled(esw)) { + !mlx5_eswitch_reg_c1_loopback_enabled(esw)) { NL_SET_ERR_MSG(extack, - "Chains on tunnel devices isn't supported without register metadata support"); + "Chains on tunnel devices isn't supported without register loopback support"); netdev_warn(priv->netdev, - "Chains on tunnel devices isn't supported without register metadata support"); + "Chains on tunnel devices isn't supported without register loopback support"); return -EOPNOTSUPP; } From patchwork Wed Mar 18 02:47:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222343 Return-Path: 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 63E5CC2BB1D for ; Wed, 18 Mar 2020 02:48:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2DCF620752 for ; Wed, 18 Mar 2020 02:48:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="dcYcfwAX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727219AbgCRCsa (ORCPT ); Tue, 17 Mar 2020 22:48:30 -0400 Received: from mail-eopbgr130053.outbound.protection.outlook.com ([40.107.13.53]:20090 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727133AbgCRCs3 (ORCPT ); Tue, 17 Mar 2020 22:48:29 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WcDoAGtEVCAUGWWu1XZKcENlC3M7r9gskoLpYuTw5TJuydsmhp14IorsXukjvmQnYyLUxXliakx/7Q1JdHINJwjCW1tR2c/Gs3jruuIlnQOI8JF3h+TemyHfucHIRvpQUtWMvfF1wKsAQFRx04eL/eVbauppIQey9S46Ik9DhvZqB8OZiTrYprtzWSpA9ujlaZKfMUlWJRu9q3sPKbHbF/kQ5usq9UUOMRvJFvHHNRh6I0AqGb4Pis4M0V7bx0EpVNvsbyfAdBF32i0iuvXxe5IEVNU84q1QWOtlz5JqqhvbMAgbSrE+2wYYZfAEJjRyuJl1cbpDZuzRVrgLmv4W6Q== 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=E0oA59Lkb1+NvytZrNt1BFD51e7Qv3XsLm2IlVFSIsA=; b=NRJFvZplRGhEssTcTlc71bFdXBDNiaAXMn+mL5TVAxgO0h1Ya29mKW1ZVWXTZlFBKU7KWERhcOfe2OdYgQcz8jgNfdVvIzSyFRRkxhgbZI13upfQArE24S07olW2PkQQqIa9nerSA8uJkpB1jPGplAufszdvRxdShJMCGuTL1EWoVHLhRv1GcBLt2ZJpsa3UoinVhYBxTAyZUUH/9PqgzE+Ma+9WG/MmPbRccnRIEIvwYP5bLmEnY1zemWwrOac/NHZgLzncjf7ifcNSel3Koohl5kdAb762fTrI/854NTIYM+01w3u6mKEfgclUoQg+PjBimiSdl/lsEd1gGffVrQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=E0oA59Lkb1+NvytZrNt1BFD51e7Qv3XsLm2IlVFSIsA=; b=dcYcfwAXrZ7iKO0wfay7lRwyAUARJ5kClisLVs8eoWrfAL+GhoD4Klmf03DsJGLDMFDrY9mTjf5oaQm+eTArg4/t/e/ZhlaRSK7JOqhTzLEy9TXN+lvUFd5xojxe6OJfH9RqhU7JEu/6qKd4Hs9txM5ozUK/N2SuWuRHEHRzQWM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB4109.eurprd05.prod.outlook.com (10.171.182.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Wed, 18 Mar 2020 02:48:18 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2%7]) with mapi id 15.20.2814.021; Wed, 18 Mar 2020 02:48:18 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Vladyslav Tarasiuk , Maxim Mikityanskiy , Jiri Pirko , Saeed Mahameed Subject: [net-next 09/14] net/mlx5e: Fix devlink port register sequence Date: Tue, 17 Mar 2020 19:47:17 -0700 Message-Id: <20200318024722.26580-10-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318024722.26580-1-saeedm@mellanox.com> References: <20200318024722.26580-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12 via Frontend Transport; Wed, 18 Mar 2020 02:48:16 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e5cdf098-1883-43da-f7d1-08d7cae6d024 X-MS-TrafficTypeDiagnostic: VI1PR05MB4109:|VI1PR05MB4109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4502; X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(199004)(956004)(478600001)(2616005)(6486002)(2906002)(54906003)(5660300002)(52116002)(86362001)(81156014)(6506007)(81166006)(4326008)(107886003)(8676002)(8936002)(26005)(66946007)(186003)(16526019)(1076003)(6512007)(66556008)(66476007)(36756003)(316002)(6916009)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4109; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eM5YjDaLQRZhv/cFCetGGJwM1VHloJqdnHln+7bfCH+jmOJ+fN1BPRtRaPBCOGUDw6S7pBGxA/QnzBVxS79qbF7b8TDiBGqFIIqVgs8cz1hbGP9xwAheGk+HKhv3z6miLv/aJ24QNjwWfwpw7NK+m8d70T1wYo0QS82Sq5J9i5C/j7EEixwvsOKvMjnXRfm/oKcZZi7UJJGuqZ00LrSPXEy56DSGZcDvlCdRl5BPTPrnGxQsXyALin5f4ETjzkgy08QTCc0mHmKorZ7B6FDRztwnnWB/50bARbB4gw6h1493cn65SGJvRrBcymOD796kdIcycTH0v5ZqK6gIiiSOvqSegBrVtqYsrfyPk26O3iNzDkQr6uxlIw6EPEG7aEqgAtonIaAXynEcLxFa99uvEM3wHTTyVDAXJSxB+4VCg93TKZHTdTFMUMifc5ca/RWf339UbfCkB3c6HNNpSSHicBWazBIVGkJ73sTbzglEoEhLpgU4/KGmgMupDt++S7OjY7fX3KtcsjBPytvIdp9VW5usjfGhNMAcR5RFbXsARhc= X-MS-Exchange-AntiSpam-MessageData: 4oAsf/O84AuCv7DcgHDLgfiq+VCHBZ5aPdyes83GuO1MwF20e14ce+c0+uU2Q4X3rWPuofe6w4ksDcrKphm9cuHlJTjgUR9mRmyT+UZ9nwq3m5kFPEc8UZ60hZSWO+WKRv6wCZOznemMW0zPVLoFsA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: e5cdf098-1883-43da-f7d1-08d7cae6d024 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2020 02:48:18.2065 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XtSQRqHiVTRNyppopBtTS/t7PUvmkO9jN+UtblPbq0TGzS3GlSkxbDxSLvOVtTzWwInJZzCNruREVva3ijHx3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4109 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vladyslav Tarasiuk If udevd is configured to rename interfaces according to persistent naming rules and if a network interface has phys_port_name in sysfs, its contents will be appended to the interface name. However, register_netdev creates device in sysfs and if devlink_port_register is called after that, there is a timeframe in which udevd may read an empty phys_port_name value. The consequence is that the interface will lose this suffix and its name will not be really persistent. The solution is to register the port before registering a netdev. Fixes: c6acd629eec7 ("net/mlx5e: Add support for devlink-port in non-representors mode") Signed-off-by: Vladyslav Tarasiuk Reviewed-by: Maxim Mikityanskiy Reviewed-by: Jiri Pirko Signed-off-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/en/devlink.c | 26 +++++++------------ .../ethernet/mellanox/mlx5/core/en/devlink.h | 3 ++- .../net/ethernet/mellanox/mlx5/core/en_main.c | 16 +++++++----- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c index e38495e4aa42..f8b2de4b04be 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.c @@ -3,20 +3,14 @@ #include "en/devlink.h" -int mlx5e_devlink_port_register(struct net_device *netdev) +int mlx5e_devlink_port_register(struct mlx5e_priv *priv) { - struct mlx5_core_dev *dev; - struct mlx5e_priv *priv; - struct devlink *devlink; - int err; + struct devlink *devlink = priv_to_devlink(priv->mdev); - priv = netdev_priv(netdev); - dev = priv->mdev; - - if (mlx5_core_is_pf(dev)) + if (mlx5_core_is_pf(priv->mdev)) devlink_port_attrs_set(&priv->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL, - PCI_FUNC(dev->pdev->devfn), + PCI_FUNC(priv->mdev->pdev->devfn), false, 0, NULL, 0); else @@ -24,12 +18,12 @@ int mlx5e_devlink_port_register(struct net_device *netdev) DEVLINK_PORT_FLAVOUR_VIRTUAL, 0, false, 0, NULL, 0); - devlink = priv_to_devlink(dev); - err = devlink_port_register(devlink, &priv->dl_port, 1); - if (err) - return err; - devlink_port_type_eth_set(&priv->dl_port, netdev); - return 0; + return devlink_port_register(devlink, &priv->dl_port, 1); +} + +void mlx5e_devlink_port_type_eth_set(struct mlx5e_priv *priv) +{ + devlink_port_type_eth_set(&priv->dl_port, priv->netdev); } void mlx5e_devlink_port_unregister(struct mlx5e_priv *priv) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.h b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.h index 3e5393a0901f..83123a801adc 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/devlink.h @@ -7,8 +7,9 @@ #include #include "en.h" -int mlx5e_devlink_port_register(struct net_device *dev); +int mlx5e_devlink_port_register(struct mlx5e_priv *priv); void mlx5e_devlink_port_unregister(struct mlx5e_priv *priv); +void mlx5e_devlink_port_type_eth_set(struct mlx5e_priv *priv); struct devlink_port *mlx5e_get_devlink_port(struct net_device *dev); #endif diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index f9c928afec89..be20d2247594 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -5467,25 +5467,27 @@ static void *mlx5e_add(struct mlx5_core_dev *mdev) goto err_destroy_netdev; } - err = register_netdev(netdev); + err = mlx5e_devlink_port_register(priv); if (err) { - mlx5_core_err(mdev, "register_netdev failed, %d\n", err); + mlx5_core_err(mdev, "mlx5e_devlink_port_register failed, %d\n", err); goto err_detach; } - err = mlx5e_devlink_port_register(netdev); + err = register_netdev(netdev); if (err) { - mlx5_core_err(mdev, "mlx5e_devlink_phy_port_register failed, %d\n", err); - goto err_unregister_netdev; + mlx5_core_err(mdev, "register_netdev failed, %d\n", err); + goto err_devlink_port_unregister; } + mlx5e_devlink_port_type_eth_set(priv); + #ifdef CONFIG_MLX5_CORE_EN_DCB mlx5e_dcbnl_init_app(priv); #endif return priv; -err_unregister_netdev: - unregister_netdev(netdev); +err_devlink_port_unregister: + mlx5e_devlink_port_unregister(priv); err_detach: mlx5e_detach(mdev, priv); err_destroy_netdev: From patchwork Wed Mar 18 02:47:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222342 Return-Path: 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 DD195C1975A for ; Wed, 18 Mar 2020 02:48:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A646420724 for ; Wed, 18 Mar 2020 02:48:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="EmxL4YiJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727270AbgCRCsi (ORCPT ); Tue, 17 Mar 2020 22:48:38 -0400 Received: from mail-eopbgr130088.outbound.protection.outlook.com ([40.107.13.88]:62369 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726229AbgCRCsh (ORCPT ); Tue, 17 Mar 2020 22:48:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b+OdWlcemQ24BV0fiklwUnYKbPyhnwgWwzZQ/2MM9Je+B+jwpUDF0lJp2EMViFSXqWxc5yHrL2Dcx4QAEoNDrJHnJpdjvrAVdzmLH3irnFcrJJqc+RvYTadCu+0P+6D3pRmmlVNIeK+7TZAdijKnCqermZE4I/GuMLoCXwNtmDlreOEJj1YewXuvgia6MvEhJve0poZA8AcDvR75SveNF3KapFXWBMj4YBDUvH83L1TVxNUjdjMliDz5x1uZVmQro76W9XncMLlD9rLAjsNKvrn3Ze4qRfQCOHUY6S7fcaEO37MiAMu2sJlIOS2TNb87QpC4eS3Hiznd+/VGCpjVqA== 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=dlnaCr2aizRLPRw9YiN2Yu0TXt+R6gpaDtVTbq459a8=; b=PhftrNe19qbpZRsXs7eXnou4rTocYt+vp3gF8FNdlpr5gEYM9Qa38JCHX9QEZbGW27V8qI8ERhPWqBWPyuJGv3lx6zpqrU734E6KVT5Sg+yNdfZE0qMgOL3nFSh/iLVJKtwb0fdwW6+OoW5FX0HPle8GYmWJkpdIiOnoYv4A48K9E3BbT3MZoynuQw8eJpkc9BpmeMHcyjgqhx70s3aE43mtkMWo9qSkmOoCKGNtW9snPgAzSbst9RsQeAZ8apOHoiqOZ0rqrZCSUNmga5hpprucgaKxcOQ6tre7AvGkMSXWasGBIqinld/RQK5+/t01zShJj6bVypURs0eZ9nOcyg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dlnaCr2aizRLPRw9YiN2Yu0TXt+R6gpaDtVTbq459a8=; b=EmxL4YiJ+2yrFT14j8nEdRFxotlUh2bnr8Lyq/ZFaU18drLN2ArniGCIEV22QzgW0vHTq7C3zAIXEKcMm6l04uZ+NDZY/0GOmhKVvKaF42IKVq7ydxAco9nQIbajqsQtZAcnV99bkGlkF9pyCv5aLPZoe1GzMOzOkCI/XIwAgqQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB4109.eurprd05.prod.outlook.com (10.171.182.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Wed, 18 Mar 2020 02:48:22 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2%7]) with mapi id 15.20.2814.021; Wed, 18 Mar 2020 02:48:22 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Eli Cohen , Oz Shlomo , Saeed Mahameed Subject: [net-next 11/14] net/mlx5: Don't use termination tables in slow path Date: Tue, 17 Mar 2020 19:47:19 -0700 Message-Id: <20200318024722.26580-12-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318024722.26580-1-saeedm@mellanox.com> References: <20200318024722.26580-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12 via Frontend Transport; Wed, 18 Mar 2020 02:48:20 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 958bee0d-0ec7-4887-3bff-08d7cae6d2da X-MS-TrafficTypeDiagnostic: VI1PR05MB4109:|VI1PR05MB4109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2150; X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(199004)(956004)(478600001)(2616005)(6486002)(2906002)(54906003)(5660300002)(52116002)(86362001)(81156014)(6506007)(81166006)(4326008)(107886003)(8676002)(8936002)(26005)(66946007)(186003)(16526019)(1076003)(6512007)(66556008)(66476007)(36756003)(316002)(6916009)(334744003)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4109; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: A+NZ8EEeNaQYb/RiFHpJFNDpUBpQ3BBvmHqObJuOrLyzMTvFDhCfOFdp0HhIjfnxTCQFOGXtGqiv11aJURjH7SiUpNlwo6dqa1pe5GkECGMaRTsctouXNxFiipcPsJQpcbc1eFEXTmtD0s322lZ6Q+6nNjDjycYC9f0DzOsUZpn9tL4za9Q059k15PitVbLbuf6Oj9df+6QWReXDjQ981OHB1og2uey99PKVZ3KmRMcWLAnqHoi78697FYVGUZP3ry8N9/H3cxEqzxurvyi4zpY/+dV2rGOErmaQwzj9JtslVUuzDI3zU7P6FRBDsMPzLZyrZ4ASV5zQIMmAcLcI9oN7GwppL/9Zl6XHuDwzhix9/j8R/oKluXp/UwqC+nFn1M6ZtTeNbh0o5u4wGpOt6jAW+ycgcvSyvpCodXQyeU2hu80vt4SbcVEgYRGvoOgM6j4gyaIcHKnDd+gR598lzSrWTU5boovhJrwkZQUWj+2uoqx08hkuhehJX/yj6D4+nd0zQUJ2OPYr+y6UvM4yylB4mIkpmq7sMlT/e9pOH6KcI0TCuFOLrEtbBlJIub3v X-MS-Exchange-AntiSpam-MessageData: RWIf7SMnzA7Om7ihFd2XayDp9c8CMesjlJ8METi1/HmCWQ+JByYRGd52pikSOA+wrVW5WuPNWJ71JoEdlHdw6WCoEh9v2yxFZnYryayFpMfJH+P7LrvcpYPhON8/7jy5R6V+y4tUD0yHpl8XbGJxVw== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 958bee0d-0ec7-4887-3bff-08d7cae6d2da X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2020 02:48:22.6969 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: wkBMCHtSPgNqUISxqt0kBPGy2o2QQQiHV0qDwy17cdY/ywmO0SPY1+nGxtJQjFaTZKqKbJSjq3rz2e2cmbkTcg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4109 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eli Cohen Don't use termination tables for packets that are steered to the slow path, as a pre-step for supporting packet encap (packet reformat) action on termination tables. Packet encap (reformat action) actions steer the packet to the slow path until outer arp entries are resolved. Signed-off-by: Eli Cohen Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/eswitch.h | 2 ++ .../mellanox/mlx5/core/eswitch_offloads.c | 20 +++++++++++++------ .../mlx5/core/eswitch_offloads_termtbl.c | 4 +++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index c18de018c675..95532b258c2b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -332,6 +332,7 @@ struct mlx5_termtbl_handle; bool mlx5_eswitch_termtbl_required(struct mlx5_eswitch *esw, + struct mlx5_esw_flow_attr *attr, struct mlx5_flow_act *flow_act, struct mlx5_flow_spec *spec); @@ -393,6 +394,7 @@ enum { MLX5_ESW_ATTR_FLAG_VLAN_HANDLED = BIT(0), MLX5_ESW_ATTR_FLAG_SLOW_PATH = BIT(1), MLX5_ESW_ATTR_FLAG_NO_IN_PORT = BIT(2), + MLX5_ESW_ATTR_FLAG_HAIRPIN = BIT(3), }; struct mlx5_esw_flow_attr { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index e2a906085a98..0b4b43ebae9a 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -300,6 +300,7 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, bool split = !!(attr->split_count); struct mlx5_flow_handle *rule; struct mlx5_flow_table *fdb; + bool hairpin = false; int j, i = 0; if (esw->mode != MLX5_ESWITCH_OFFLOADS) @@ -397,16 +398,21 @@ mlx5_eswitch_add_offloaded_rule(struct mlx5_eswitch *esw, goto err_esw_get; } - if (mlx5_eswitch_termtbl_required(esw, &flow_act, spec)) + if (mlx5_eswitch_termtbl_required(esw, attr, &flow_act, spec)) { rule = mlx5_eswitch_add_termtbl_rule(esw, fdb, spec, attr, &flow_act, dest, i); - else + hairpin = true; + } else { rule = mlx5_add_flow_rules(fdb, spec, &flow_act, dest, i); + } if (IS_ERR(rule)) goto err_add_rule; else atomic64_inc(&esw->offloads.num_flows); + if (hairpin) + attr->flags |= MLX5_ESW_ATTR_FLAG_HAIRPIN; + return rule; err_add_rule: @@ -495,10 +501,12 @@ __mlx5_eswitch_del_rule(struct mlx5_eswitch *esw, mlx5_del_flow_rules(rule); - /* unref the term table */ - for (i = 0; i < MLX5_MAX_FLOW_FWD_VPORTS; i++) { - if (attr->dests[i].termtbl) - mlx5_eswitch_termtbl_put(esw, attr->dests[i].termtbl); + if (attr->flags & MLX5_ESW_ATTR_FLAG_HAIRPIN) { + /* unref the term table */ + for (i = 0; i < MLX5_MAX_FLOW_FWD_VPORTS; i++) { + if (attr->dests[i].termtbl) + mlx5_eswitch_termtbl_put(esw, attr->dests[i].termtbl); + } } atomic64_dec(&esw->offloads.num_flows); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c index 269eddc3d38b..4e76ddc4ef87 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads_termtbl.c @@ -195,10 +195,12 @@ static bool mlx5_eswitch_offload_is_uplink_port(const struct mlx5_eswitch *esw, bool mlx5_eswitch_termtbl_required(struct mlx5_eswitch *esw, + struct mlx5_esw_flow_attr *attr, struct mlx5_flow_act *flow_act, struct mlx5_flow_spec *spec) { - if (!MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, termination_table)) + if (!MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, termination_table) || + attr->flags & MLX5_ESW_ATTR_FLAG_SLOW_PATH) return false; /* push vlan on RX */ From patchwork Wed Mar 18 02:47:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222341 Return-Path: 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, 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 EC634C1975A for ; Wed, 18 Mar 2020 02:48:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8B1B20724 for ; Wed, 18 Mar 2020 02:48:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="cxcIsyOw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727301AbgCRCsr (ORCPT ); Tue, 17 Mar 2020 22:48:47 -0400 Received: from mail-eopbgr130088.outbound.protection.outlook.com ([40.107.13.88]:62369 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726229AbgCRCsq (ORCPT ); Tue, 17 Mar 2020 22:48:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DSKYz89gqYQ+O9fJrUYTENHFXD9vPR122IHEA7xuYpZrpbrwfm4FtFmw1oEmlBUtiFQuZtKbBMJWfr+gMc3Xkv+6AQFJvJReHZ/OQRrdrqARxDGBpqT8rMf1OBN9AZpshSK+4/h+hpU0dqdR+WdGoKQL7OwN0G8a9pb7DdDiJq2ZbnaRJO+OYhZSVppITFM6PXwm5NsKJKeBorwJNoQ1L6uniwo+o0F6JfXCYhuaUbc3ejy23EaC2SCNc9mFpaBd2prXIViCFJZ+qOukEmqOfm3tN3nhG7TwnjwWoo7NYp7dilE3w88mG+1CiZGGdx04elXaHj09uQAvX9Q1uY9pBw== 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=BPmI65yBOQWHgfwyNAoVsI/qOEDJlTdp8ylS1cyhg8k=; b=W6vstfZOqCXjNp5CT4rRTIID8Q7kjdE6sJGUQWCf7bcJ7PTQL7iU29NCeIO26uUUHQOj+gG9TcRJTzyImYHZ5L6zdSPVXw+3NftidxtpkkK6u16PSTKwSdr/VVMH59ngmabSm83ofI1T4BTkdCv9UQ6/GGECox3/fxB6atpnP4h8Gk4Vha+ZGJhVi04KOf7dgDHRSEHZ24V3srX79I2/N9O4ZKaxOerWtsjpYe8vuseDR7LgWFyhhT1Mq3tieVbg7kX1kfEDVv6tcwPJml/dZ54ssvzK22gb2EYCRpaYJ1BAXqRD1XVRMAFpZzGir6uGeXvXbg6VU0Uicb9nzBndTw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BPmI65yBOQWHgfwyNAoVsI/qOEDJlTdp8ylS1cyhg8k=; b=cxcIsyOwfuVwF6RZAUtrVwsPjaFq2fFGSAnRgLV+9wSjO3vzp6pLWAmsnXj0SHItFjjwUJPJp3kHgKd8M8M00M08ihxGI3Tdpb+BSzi3qn8tKuA2W0HcuuuAVmmEVThQulbc147sfgcxEnN1Rczm/2WGeIRSFiqnftaj54n99S0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB4109.eurprd05.prod.outlook.com (10.171.182.30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.14; Wed, 18 Mar 2020 02:48:27 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::8cea:6c66:19fe:fbc2%7]) with mapi id 15.20.2814.021; Wed, 18 Mar 2020 02:48:27 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Eli Cohen , Oz Shlomo , Saeed Mahameed Subject: [net-next 13/14] net/mlx5: Eswitch, enable forwarding back to uplink port Date: Tue, 17 Mar 2020 19:47:21 -0700 Message-Id: <20200318024722.26580-14-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318024722.26580-1-saeedm@mellanox.com> References: <20200318024722.26580-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) To VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from smtp.office365.com (73.15.39.150) by BY5PR13CA0027.namprd13.prod.outlook.com (2603:10b6:a03:180::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2835.12 via Frontend Transport; Wed, 18 Mar 2020 02:48:25 +0000 X-Mailer: git-send-email 2.24.1 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5c59ad20-592d-4995-0da1-08d7cae6d5a8 X-MS-TrafficTypeDiagnostic: VI1PR05MB4109:|VI1PR05MB4109: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 03468CBA43 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(396003)(346002)(39860400002)(376002)(136003)(199004)(956004)(478600001)(2616005)(6486002)(2906002)(54906003)(5660300002)(52116002)(86362001)(81156014)(6506007)(81166006)(4326008)(107886003)(8676002)(8936002)(26005)(66946007)(186003)(16526019)(1076003)(6512007)(66556008)(6666004)(66476007)(36756003)(316002)(6916009)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB4109; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ynoeWisOtc/DqWloviD2U1aqTFCZ4bdbSBfvzOscwq5ztTpO9jynSov1m0y3/icSdNRYVfdVloXl3Gbij3eQPHbDTgMXKMyM6QE4AgvqYhgm79bs9SSApCSeHNshCa8MwdIeqPZdiw2cny3HqJRbdl3QvyU3VLILVXen4RafCJj6QcxHerjppyq81vFs4UFBmATTbXeCUcWxZSFk5V7xeCUhmpulP71tpZc83zMQt9c9xgUTNMf3LzDjALQUfvleWUF2dN1E6dzTi28FK+3asbHLqHA82EfwspIN4sZqS5CjWJr3ZN7szne9oRd/vm1aB3HdopEq1GBdedYMKO9nPcwMdPgh60nOLAgFWar7/zthQH5VaYIK+QXC9fBx5KMJfViq5N2ecAC53lT5DfdfseQrDCmn2muAQCidYrRQeD+pUkBbWwyvKR0aX3UocY0ioH69wtnRBBHdr/KW8t1wnxCoMC6ulvsY5YUrGkyi98CfVrCORypTCiYzgljywpMcOMTv7I4cIO4CG62ol2LoI8PELPc6HLzVY4nbNrX+1tA= X-MS-Exchange-AntiSpam-MessageData: c+1DRLmDuDCocY+oPM7C0Ivf+jYASV9Y0p6H0MV1ArJbWGXmnNQpJ8lj711P/ma7Cp5EX9Z46BWNW7/Pit/90GpmpL8Kk0hFn3RYdyB77itqHsSiFAbRQM8z8P2u3i2GMdHBwIFFtgrrLmSsLHiSYg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c59ad20-592d-4995-0da1-08d7cae6d5a8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Mar 2020 02:48:27.5981 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: bbLPj5Q3QOCy7sOgT5qVuh0OXIlph11fkVWiTm6xWsBcv8h9jE9qwqND8sbHs6MxVqtlVlfE3dxe4Ns8rBqh6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB4109 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eli Cohen Add dependencny on cap termination_table_raw_traffic to allow non encapsulated packets received from uplink to be forwarded back to the received uplink port. Refactor the conditions into a separate function. Signed-off-by: Eli Cohen Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en_tc.c | 59 ++++++++++++++----- include/linux/mlx5/mlx5_ifc.h | 3 +- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index ddb933aa8d59..ebf60ff30295 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3641,6 +3641,46 @@ static int mlx5_validate_goto_chain(struct mlx5_eswitch *esw, return 0; } +static int verify_uplink_forwarding(struct mlx5e_priv *priv, + struct mlx5e_tc_flow *flow, + struct net_device *out_dev, + struct netlink_ext_ack *extack) +{ + struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; + struct mlx5_esw_flow_attr *attr = flow->esw_attr; + struct mlx5e_rep_priv *rep_priv; + + /* Forwarding non encapsulated traffic between + * uplink ports is allowed only if + * termination_table_raw_traffic cap is set. + * + * Input vport was stored esw_attr->in_rep. + * In LAG case, *priv* is the private data of + * uplink which may be not the input vport. + */ + rep_priv = mlx5e_rep_to_rep_priv(attr->in_rep); + + if (!(mlx5e_eswitch_uplink_rep(rep_priv->netdev) && + mlx5e_eswitch_uplink_rep(out_dev))) + return 0; + + if (!MLX5_CAP_ESW_FLOWTABLE_FDB(esw->dev, + termination_table_raw_traffic)) { + NL_SET_ERR_MSG_MOD(extack, + "devices are both uplink, can't offload forwarding"); + pr_err("devices %s %s are both uplink, can't offload forwarding\n", + priv->netdev->name, out_dev->name); + return -EOPNOTSUPP; + } else if (out_dev != rep_priv->netdev) { + NL_SET_ERR_MSG_MOD(extack, + "devices are not the same uplink, can't offload forwarding"); + pr_err("devices %s %s are both uplink but not the same, can't offload forwarding\n", + priv->netdev->name, out_dev->name); + return -EOPNOTSUPP; + } + return 0; +} + static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct flow_action *flow_action, struct mlx5e_tc_flow *flow, @@ -3738,7 +3778,6 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, struct mlx5_eswitch *esw = priv->mdev->priv.eswitch; struct net_device *uplink_dev = mlx5_eswitch_uplink_get_proto_dev(esw, REP_ETH); struct net_device *uplink_upper; - struct mlx5e_rep_priv *rep_priv; if (is_duplicated_output_device(priv->netdev, out_dev, @@ -3774,21 +3813,9 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, return err; } - /* Don't allow forwarding between uplink. - * - * Input vport was stored esw_attr->in_rep. - * In LAG case, *priv* is the private data of - * uplink which may be not the input vport. - */ - rep_priv = mlx5e_rep_to_rep_priv(attr->in_rep); - if (mlx5e_eswitch_uplink_rep(rep_priv->netdev) && - mlx5e_eswitch_uplink_rep(out_dev)) { - NL_SET_ERR_MSG_MOD(extack, - "devices are both uplink, can't offload forwarding"); - pr_err("devices %s %s are both uplink, can't offload forwarding\n", - priv->netdev->name, out_dev->name); - return -EOPNOTSUPP; - } + err = verify_uplink_forwarding(priv, flow, out_dev, extack); + if (err) + return err; if (!mlx5e_is_valid_eswitch_fwd_dev(priv, out_dev)) { NL_SET_ERR_MSG_MOD(extack, diff --git a/include/linux/mlx5/mlx5_ifc.h b/include/linux/mlx5/mlx5_ifc.h index 2bd920965bd3..cc55cee3b53c 100644 --- a/include/linux/mlx5/mlx5_ifc.h +++ b/include/linux/mlx5/mlx5_ifc.h @@ -416,7 +416,8 @@ struct mlx5_ifc_flow_table_prop_layout_bits { u8 termination_table[0x1]; u8 reformat_and_fwd_to_table[0x1]; u8 reserved_at_1a[0x6]; - u8 reserved_at_20[0x2]; + u8 termination_table_raw_traffic[0x1]; + u8 reserved_at_21[0x1]; u8 log_max_ft_size[0x6]; u8 log_max_modify_header_context[0x8]; u8 max_modify_header_actions[0x8];