From patchwork Fri May 29 20:46:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218167 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 BD93FC433E0 for ; Fri, 29 May 2020 20:46:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 95C9920810 for ; Fri, 29 May 2020 20:46:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="lJlx6Sey" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728311AbgE2Uqq (ORCPT ); Fri, 29 May 2020 16:46:46 -0400 Received: from mail-vi1eur05on2044.outbound.protection.outlook.com ([40.107.21.44]:6087 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727024AbgE2Uqp (ORCPT ); Fri, 29 May 2020 16:46:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=biF6lK15kNUvbNM8w5VTnR31Biyjo0y7XDSXk1vodi9e+59s255dP1MqkswiAyGPknmDoAE6jlNZ3xzd4BRFyheD08vjUxo+e9j0KGKzgE745MSq+PWpNtp2KeAwJSfEh57FsSVylJ19YptNQIrHZIQYLdTxDXWyh/e1XHj4ZWs0cUuWgDPr6mXB3+rCEhqdMDaDFZG6q8GFpuQfidU9xjJppwMkOo1Zm2zPbMWVXgsihrJGuS4FRjqemrVuhp7/uBcNyo2m61kCz5Uc6NqUh52UiyyTi/gzPPp7lF+72haaP26OpIeM3XYt5gJgVuC4pP6sFBKCrF815yjKznm/fg== 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=Bx+BrsDz9hr1TCdq7J2jSPh9lErbDMzKJlkwI7D2s2c=; b=RNNZBVcz2jIGtKtFv93IdAHw0+tmrEEjTmfD+XLOE8YIEmusB0QN9DVFlnxjPAWCcUL6LXUTrqrUw7gX3X4+RahPMi31dKKwYH0gonqggavF5HXY6E7EwGugIfFZXsqAAijN3uRXthzyao5UBwf3fFUgFATR5FF91ZdMJzglnGcqy1FC0Iv/TOfsZrFB2VmZ3UzPjUDTayGMG20l/z9NjBiS1aqkXlrDV7YWd72krchpJRH5u4L+2zXtnMMTqffS0nhe6sQCTFBGiiHWf0DoAzaLqydfXq6M+W+wVEzRdFGWOPPAcrjYw9XVxk32zdRzQHPq1eE/X+aD+Y7LxABwLw== 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=Bx+BrsDz9hr1TCdq7J2jSPh9lErbDMzKJlkwI7D2s2c=; b=lJlx6SeyOCzRqvtz+HrQvfO23QK4898XVn5Elrp0FKVoOgAQHyFnpIKIO2vgSq40Fz5Dhmhv+xmuRf9DC7axGZh7dOBlLMIRulJCaFZQ3V2ZU4jkJbAQuOghcX+tGPTCC3Ykxz0TKmEG/txx+rcxjQRaJwH1/0w8cYAAwQWl5a0= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3359.eurprd05.prod.outlook.com (2603:10a6:802:1c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.21; Fri, 29 May 2020 20:46:41 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Fri, 29 May 2020 20:46:41 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Mark Bloch , Dexuan Cui , Moshe Shemesh , Saeed Mahameed Subject: [net V2 1/7] net/mlx5: Fix crash upon suspend/resume Date: Fri, 29 May 2020 13:46:04 -0700 Message-Id: <20200529204610.253456-2-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200529204610.253456-1-saeedm@mellanox.com> References: <20200529204610.253456-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) 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 BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Fri, 29 May 2020 20:46:38 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 1ea2cb09-3294-418a-2d06-08d80411639a X-MS-TrafficTypeDiagnostic: VI1PR05MB3359: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +H/uElkUhpY+mJjlMI8dKKjqiOWCqcAQrrmL4Tg3BAMoc8/lmAw3EFMPjX2rou28xiufZ3FydjMKCXY3D/14bfz/UkIbhZBTXpVMFlhWSsfiOf79MejcRK6G8rCsLax7XJpVgQKmhvdm9IaQepuYTvNpd4Vqv/JvhzdcjudKsNmf1vMmhU3totIOh2QaUqkS1iday92sWgy47Oik0HIlZ3UnJM2oGj9L/060oRhORAVTeKWNamjN9mZbf0ohpG9fmprwltzygYRT4N3a7dKGlV6vhuvac0ktPVgmksDeVFjzPdo7paXMfaxl96KgfD8V9Y4qNzKsTwfHKtbTIRUhLdm2VGX1Up9PdEaEUQiLr7F43f3USBoi/a/FCs/fPEQX X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(2906002)(66556008)(86362001)(478600001)(956004)(2616005)(6486002)(54906003)(15650500001)(16526019)(6506007)(316002)(186003)(26005)(83380400001)(36756003)(66946007)(8676002)(1076003)(8936002)(66476007)(5660300002)(52116002)(6512007)(45080400002)(107886003)(4326008)(6666004)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SrGfmOFm73KJUPsVBBUrkeG4i1ED4tFyZdgEKbkUz9RhbNch8OPZHp8bTsXTCGY4+delnKTq2KD0VwQr60j5UcohqGAn8dFEhnkPkkj3bGxe4cITijW/tUFnkxYx9NiD7teSgV8xtHJh6e0lYrfEWKZclAbiKNsH29U4nluWgRfGrN9NG67uL9d3mdVIHT4ixklcw+Xgr4wPqlO4FRV7fVo/ZjizWHGG28f7jf+R4Kzpcjjlt00pKKxdNP1mwGoAdcEYBhEAHLRMM18T9vsQy2tDBwGLJqs7jhy6svKLXen5Hp3anTmM0tc4Ixd84/QFnPr/8OXDWgnqFgJiGPcqm2FjVQQt/pNfS29bDc1HzLqKAqPv+x3TsH8Zd3MgcpmUvfRASBPGMSAZEVvoDTcgDiPLAkYRPnqoeTYMHsfv/q6yo7BGwu0TSlQWzs4IzGaPTh55IcAY6Ka+G81BfYk/IY6B33b/wDHpx2QpFz5lEGs= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ea2cb09-3294-418a-2d06-08d80411639a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 20:46:41.1774 (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: rxKCKdx/mC1ts7HfHaFKbc1f9joV8H5QM+x+1J80nTYuEWq3Lk3KmFwl0l6Tg7OSOtBu6+KOWINEmkJYTsH9wg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3359 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mark Bloch Currently a Linux system with the mlx5 NIC always crashes upon hibernation - suspend/resume. Add basic callbacks so the NIC could be suspended and resumed. Fixes: 9603b61de1ee ("mlx5: Move pci device handling from mlx5_ib to mlx5_core") Tested-by: Dexuan Cui Signed-off-by: Mark Bloch Reviewed-by: Moshe Shemesh Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/main.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index c1618b818f3ab..17f818a540903 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -1549,6 +1549,22 @@ static void shutdown(struct pci_dev *pdev) mlx5_pci_disable_device(dev); } +static int mlx5_suspend(struct pci_dev *pdev, pm_message_t state) +{ + struct mlx5_core_dev *dev = pci_get_drvdata(pdev); + + mlx5_unload_one(dev, false); + + return 0; +} + +static int mlx5_resume(struct pci_dev *pdev) +{ + struct mlx5_core_dev *dev = pci_get_drvdata(pdev); + + return mlx5_load_one(dev, false); +} + static const struct pci_device_id mlx5_core_pci_table[] = { { PCI_VDEVICE(MELLANOX, PCI_DEVICE_ID_MELLANOX_CONNECTIB) }, { PCI_VDEVICE(MELLANOX, 0x1012), MLX5_PCI_DEV_IS_VF}, /* Connect-IB VF */ @@ -1592,6 +1608,8 @@ static struct pci_driver mlx5_core_driver = { .id_table = mlx5_core_pci_table, .probe = init_one, .remove = remove_one, + .suspend = mlx5_suspend, + .resume = mlx5_resume, .shutdown = shutdown, .err_handler = &mlx5_err_handler, .sriov_configure = mlx5_core_sriov_configure, From patchwork Fri May 29 20:46:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218166 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 B0408C433DF for ; Fri, 29 May 2020 20:46:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B35F207BC for ; Fri, 29 May 2020 20:46:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="ij6y/Os3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728324AbgE2Uqu (ORCPT ); Fri, 29 May 2020 16:46:50 -0400 Received: from mail-vi1eur05on2044.outbound.protection.outlook.com ([40.107.21.44]:6087 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727024AbgE2Uqt (ORCPT ); Fri, 29 May 2020 16:46:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Llf99k+T1pAxd+ot1uLPfPHsR5RMIj0ls2gcT3xDP1k0FO7U6q/N4uY0DCkPSxSXun4CYWss489YNM6XijEHhUjnSKQuMYl2vgNnDpVajwnENIxJiRRummwuGsojdOQL3LnN+UZYbJIVDYOyo5LSrT+5A65Ufdt2USjxkOwt81UBAeZ01iEiRRyZGD30TmseXR0HsNGSwZ4HsTIor2hKXa7ErmMhenVA0OkZT+8Xc9SzwcwVgFVupTU8PsBWV+uel8/kRm9N8SLmHN7c5zdzW6NZgn1f57X6U3pXofZRwKHgDs2cGCQDZmZrmt/S/QDQWqr04ljnmbq7GyFta/xifw== 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=hnat0Bq/4z/ViIn1HSsIFbry/t0hSasaGLExmVRQHpw=; b=Oj8JU3h+W6Rh2TFFlYVmBL2ykkBOeyH9AP3Xfi84umxtaAzRjiTu+OajmUBtMiwM3WM21Jl4Q9gSddvORl90TSAYiz/6SLCVVlVk/V4nP5khXhEQd060Tgyy//zRSPDvQ/ETtEu/uE4p6rbmQb2YbSYHTBUCiW3Bc2mZMS3Mpf0TMYKv53jn9MvvqmI4SgDh1EXm0PdTPCexrGxueN078hCVB6ocDxlk4CJJlWOXGa8mggVCxIVyKpKydbIT1yV+nSMd8SQVl9n73vAhW11iyeKRNwwQqqfJcYaTdiTq34GHYIFaL9ddFxuJh+gMHWZMbDCo8PNTiW+ypdZk0y50VA== 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=hnat0Bq/4z/ViIn1HSsIFbry/t0hSasaGLExmVRQHpw=; b=ij6y/Os344LLPAW3++BJs7//wsgN86pcD1qDp0zXBZLli0zDVrqNWFW2xgcpRjlTy09FzOSYGEAmpusUS4VyGq55KPj0lHmRk29dPsPOtx1129mhYS0mIUhdiRYLoVg73PNg7KdCdt8sRM9zHq0KJil0MLI4uOoOGAZnIFYnW8k= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3359.eurprd05.prod.outlook.com (2603:10a6:802:1c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.21; Fri, 29 May 2020 20:46:46 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Fri, 29 May 2020 20:46:46 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Maor Dickman , Roi Dayan , Saeed Mahameed Subject: [net V2 3/7] net/mlx5e: Remove warning "devices are not on same switch HW" Date: Fri, 29 May 2020 13:46:06 -0700 Message-Id: <20200529204610.253456-4-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200529204610.253456-1-saeedm@mellanox.com> References: <20200529204610.253456-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) 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 BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Fri, 29 May 2020 20:46:44 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: fb64b38f-fb0f-432b-8bc6-08d8041166c6 X-MS-TrafficTypeDiagnostic: VI1PR05MB3359: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1107; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WchjU9Z7PtExMnOKCpujVqvuUVaA6TKWVv1JVihq8ZPtxozx1SsJ7SJdCaCSBbjGR5z6APrbxoKOABeWsCBNrXFCK1GJGRmamtZ4EXoBWpkKfLewbdXjiQIz/XTZBG8gusenthxR0H7WjXUGpmWKWwuQnhsAeQaxV57TL28eRa3B5YMg+3ickF6/FJrvtXoRmKMIwNY/slDj2gzHKDm6qz4+iqJ30iW4u9//oCUg3kCzj7DmL2wmQ0meuPc4ASzfoIdIBTOE7evgcrYjDDOyTmDbYua9uCbebW8IfhIdMulVs4qmsXtqOcfeNjZPdzDFZZb3v8GATXFenJyXlBeKqHcXV/A9d5qlPGvGsZBWMWSpUgHiUXtbAtLyMoMcndqb X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(2906002)(66556008)(86362001)(478600001)(956004)(2616005)(6486002)(54906003)(16526019)(6506007)(316002)(186003)(26005)(83380400001)(36756003)(66946007)(8676002)(1076003)(8936002)(66476007)(5660300002)(52116002)(6512007)(107886003)(4326008)(6666004)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xKajZ+rTAXJQLrYCWS9WvxWVUnOTZMu/EWFphD8C6Ldf9FnVlfsa+Q2Iiv6X3uKO/t9KLWcIUfGQRl2X1QzFk8KHZR4fR68Vt8j269y7LZI8j2U9QgEuHdXSNdwESGUKe7r4mBGNr2nrMmd8XvmSzfm2cRXETcNaqoCyAOA7NhnJehHPVI1zDleAqCpZ3+UN+WedZ+Zmc7QTK1qtLS5LOXcOlhBAvHExpsXhUyJIZ8xm6Ew3PUDMsrgYgRoL1aB3CEW30Ed+uSRDahjiqY0WP22CaWx6gLdRWbV/oCpRu51Z5pDyN4++NH4J7lWY3QyiDMxKbRyOBH6+q40RTeEPS93L6QvLNbt7zhWJgzDWPJN6gN2ZOAxqU0uC90reRu1/ipoS/upFI5BMYtjHxVb/u9XIXWw/MPl/JJeAZFtSnZ5vLOk5EYEP3IvXc3fy/glGBxvfKUTZ2MsKO5oe/lZ0HEGri8TyKBvrPY8mcBXmjHo= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: fb64b38f-fb0f-432b-8bc6-08d8041166c6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 20:46:46.0167 (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: qv+ORZ4OGMWeS7pC1OHgOsjZT+yxbBziuAybyhEXDnIgaf1xjWOfcwIMJGMqFyGCA72lFQaJ3IjSKpOoBhSLRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3359 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Maor Dickman On tunnel decap rule insertion, the indirect mechanism will attempt to offload the rule on all uplink representors which will trigger the "devices are not on same switch HW, can't offload forwarding" message for the uplink which isn't on the same switch HW as the VF representor. The above flow is valid and shouldn't cause warning message, fix by removing the warning and only report this flow using extack. Fixes: 321348475d54 ("net/mlx5e: Fix allowed tc redirect merged eswitch offload cases") Signed-off-by: Maor Dickman Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index cac36c27c7fa4..6e7b2ce29d411 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -3849,10 +3849,6 @@ static int parse_tc_fdb_actions(struct mlx5e_priv *priv, if (!mlx5e_is_valid_eswitch_fwd_dev(priv, out_dev)) { NL_SET_ERR_MSG_MOD(extack, "devices are not on same switch HW, can't offload forwarding"); - netdev_warn(priv->netdev, - "devices %s %s not on same switch HW, can't offload forwarding\n", - priv->netdev->name, - out_dev->name); return -EOPNOTSUPP; } From patchwork Fri May 29 20:46:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218165 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 03E64C433E1 for ; Fri, 29 May 2020 20:47:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC85B207BC for ; Fri, 29 May 2020 20:46:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="XrcWOYWI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbgE2Uq7 (ORCPT ); Fri, 29 May 2020 16:46:59 -0400 Received: from mail-vi1eur05on2044.outbound.protection.outlook.com ([40.107.21.44]:6087 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727024AbgE2Uq5 (ORCPT ); Fri, 29 May 2020 16:46:57 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q2SmfXCux93pNrYsoMkQ+9bh5MSJhg2PJsO9kuznGHJ5WWVVTY8wCDWt/1c/NS8BZecXVwVLmF1MJDPK7T/53GG4dOkSqtad6fZNN/vHIB/gMmTTPO+3S/7jw+82Z/EUC3AclfNNthvkq2U1tA3bbwKhssXaTNmEZoiEcHi9uzujO4gvOSIM/7vCyGMHYs7PkYfoSUWwWeF5kzdq+KA7ARiOXjwWKKOBHS9V/grNHzbXWqEUo2Ie6BOzULNr8Soug6iK+LXV+/z/0LWlcCeT55VQh52hjBvk0x8wQMSIokn95odXK7hNEvQl2MPwYMLsk63s5QD5U45rfY2fZrtGNw== 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=mNYup6IqR+8EFxGFwAD+vQ0GtSjNnvUmtzCmn1aSd1s=; b=UOwntRIYA//YITJPIOXizxBTYpAeUUjjfzOpY+h24/Php/lYY2ybjZVTXFh+ZYsp/Cikrvzdgxcp6x07H0RdkZhDKzw9QO2YV+myAFW6Qwlz1+ILc8ggLkpECYEntXAq+DqIRPtScL5AXJ54Igdz2buZBy0Rdldtcm49s0+YcBtQK8zz/As9LVgZpc1/zL9oE+FHza8r04iC8harcTvjLWnXiaoD7vcPJQ7EIUglt7alPiCtTBJWc2KGCc67mBqoVw+aLMTEdDqOHpPQfMLjI0qiHDAzj+OobxeSXSNITo95Gd7ufw92/DqPxDsHIKD/hSLoocqXchgTyn4E6zCUmQ== 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=mNYup6IqR+8EFxGFwAD+vQ0GtSjNnvUmtzCmn1aSd1s=; b=XrcWOYWIj78ycG8otAm80RUejs7Z9MJoBzNZjroHg/tzzFN/K8fH0FEAcwCazLqPlhA9sNV3ewSSrR3JdLV9OFRbAlOUfo18y8EGxSCKv9Y43B7ftgTHBGUGh+ntQLDdot1RyJpEWQg+tFwwBA47fiiQypuDrIHFYIrxdMJdK2c= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3359.eurprd05.prod.outlook.com (2603:10a6:802:1c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.21; Fri, 29 May 2020 20:46:51 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Fri, 29 May 2020 20:46:51 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Tal Gilboa , Tariq Toukan , Saeed Mahameed Subject: [net V2 5/7] net/mlx5e: Properly set default values when disabling adaptive moderation Date: Fri, 29 May 2020 13:46:08 -0700 Message-Id: <20200529204610.253456-6-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200529204610.253456-1-saeedm@mellanox.com> References: <20200529204610.253456-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) 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 BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Fri, 29 May 2020 20:46:49 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c8d75146-67c5-46f4-cc7a-08d804116a2b X-MS-TrafficTypeDiagnostic: VI1PR05MB3359: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2657; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6TT7fL7TqHM9GMSplATI/vO2wEvwjwewHcn23eCL9hBCKoHjvuA2w/JYa3MeihoRfaJ8VGeIm4ABxOEIkI/G9lY9p4w4DNlgGkHPv/Bp6QXTOYObuTotsXZpYFmLR4R1D5ziN4k7f+j96jby7WX5Di13UKoY+hez5B93D2gEW8/y5nI+MugqJ5IXSQ8RY2HeVbRK5uX0UFHlSLSb4eDJ6ASoQ2glx6U+w2Wr/vXAQKJBmR3kxIDim6Xx6CffVI/WXEKaZopRXO5a4TPNpc5CN3ie0cF9MOKu/ERqUDpi/chr2cKnzphdu4rXePc40ghQ6i4YaiVDsEcegJJUZjlqVGtEBwCQwnVTGvF7YujOzcSOjPE/LMJU6L879W4lnIb+/MEEuZXIVF7yeJQNoGXgyT36nNoZcDWd2Azio7HiLwY= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(2906002)(66556008)(86362001)(478600001)(956004)(2616005)(6486002)(54906003)(16526019)(6506007)(316002)(186003)(26005)(83380400001)(36756003)(66946007)(8676002)(1076003)(8936002)(66476007)(5660300002)(52116002)(6512007)(107886003)(4326008)(6666004)(54420400002)(309714004); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: G/Hsm3+aztcYBF6o+bHtDiLxoRTy9pSuGJH71r+ZFsd4iAm/2aWJi9LosjpnSbgyBbJNf9NIaFoeMRGrKDGsE86In65t6sRwfvOyVULcm5/+Y6Ex2y7zacXqVU46UvAoFzZoF2enQK+utVfWMLYaJO1fcXfcQGTwiuKRKb7SsTd/5Eb4FASpvjxyC86Srs9wUr8IeZXGyESe6bVcYl/9km/8n0cu0qJFkxc5l63R2XUlhxBmoIvl70XjJlhXqfEo/pQZ8n4bDZDz72Sf1LScVrvTpVL8X+iwK/pMExAjmJIKNvy4oxu3HBQq7NjLLSYtSYYGvE8QQqoS49uDi2h6O4H6HomELJGC9v0VA0r9dchiFgAr5VQHPVm0Ihz0aiAqQ+SgX2sXKji4YfAV+KDZ+uhpKfBTSXiltA774JaffuGp7ZDcox010k7EzwA4wn0v9LacqXt+MiqdoszecRgynllnH4YivBmGVXGg6dPymF4= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8d75146-67c5-46f4-cc7a-08d804116a2b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 20:46:51.7284 (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: qXZHG9BQDkWW4k0Bn/IHPM18rHERLlYxjToLDGVcxgJedb/05mwqu55itgvMaUjiNlv5e0VNzs8DaRf0tjRclg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3359 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tal Gilboa Add a call to mlx5e_reset_rx/tx_moderation() when enabling/disabling adaptive moderation, in order to select the proper default values. In order to do so, we separate the logic of selecting the moderation values and setting moderion mode (CQE/EQE based). Fixes: 0088cbbc4b66 ("net/mlx5e: Enable CQE based moderation on TX CQ") Fixes: 9908aa292971 ("net/mlx5e: CQE based moderation") Signed-off-by: Tal Gilboa Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 10 +++++---- .../ethernet/mellanox/mlx5/core/en_ethtool.c | 21 +++++++++++++++---- .../net/ethernet/mellanox/mlx5/core/en_main.c | 20 ++++++++++++------ 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index 59745402747be..0a5aada0f50f9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -1068,10 +1068,12 @@ void mlx5e_deactivate_priv_channels(struct mlx5e_priv *priv); void mlx5e_build_default_indir_rqt(u32 *indirection_rqt, int len, int num_channels); -void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, - u8 cq_period_mode); -void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, - u8 cq_period_mode); + +void mlx5e_reset_tx_moderation(struct mlx5e_params *params, u8 cq_period_mode); +void mlx5e_reset_rx_moderation(struct mlx5e_params *params, u8 cq_period_mode); +void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode); +void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode); + void mlx5e_set_rq_type(struct mlx5_core_dev *mdev, struct mlx5e_params *params); void mlx5e_init_rq_type_params(struct mlx5_core_dev *mdev, struct mlx5e_params *params); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 6f582eb83e54f..bc290ae80a531 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -527,8 +527,8 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv, struct dim_cq_moder *rx_moder, *tx_moder; struct mlx5_core_dev *mdev = priv->mdev; struct mlx5e_channels new_channels = {}; + bool reset_rx, reset_tx; int err = 0; - bool reset; if (!MLX5_CAP_GEN(mdev, cq_moderation)) return -EOPNOTSUPP; @@ -566,15 +566,28 @@ int mlx5e_ethtool_set_coalesce(struct mlx5e_priv *priv, } /* we are opened */ - reset = (!!coal->use_adaptive_rx_coalesce != priv->channels.params.rx_dim_enabled) || - (!!coal->use_adaptive_tx_coalesce != priv->channels.params.tx_dim_enabled); + reset_rx = !!coal->use_adaptive_rx_coalesce != priv->channels.params.rx_dim_enabled; + reset_tx = !!coal->use_adaptive_tx_coalesce != priv->channels.params.tx_dim_enabled; - if (!reset) { + if (!reset_rx && !reset_tx) { mlx5e_set_priv_channels_coalesce(priv, coal); priv->channels.params = new_channels.params; goto out; } + if (reset_rx) { + u8 mode = MLX5E_GET_PFLAG(&new_channels.params, + MLX5E_PFLAG_RX_CQE_BASED_MODER); + + mlx5e_reset_rx_moderation(&new_channels.params, mode); + } + if (reset_tx) { + u8 mode = MLX5E_GET_PFLAG(&new_channels.params, + MLX5E_PFLAG_TX_CQE_BASED_MODER); + + mlx5e_reset_tx_moderation(&new_channels.params, mode); + } + err = mlx5e_safe_switch_channels(priv, &new_channels, NULL, NULL); out: diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index c6b83042d4318..bd8d0e0960857 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4716,7 +4716,7 @@ static u8 mlx5_to_net_dim_cq_period_mode(u8 cq_period_mode) DIM_CQ_PERIOD_MODE_START_FROM_EQE; } -void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode) +void mlx5e_reset_tx_moderation(struct mlx5e_params *params, u8 cq_period_mode) { if (params->tx_dim_enabled) { u8 dim_period_mode = mlx5_to_net_dim_cq_period_mode(cq_period_mode); @@ -4725,13 +4725,9 @@ void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode) } else { params->tx_cq_moderation = mlx5e_get_def_tx_moderation(cq_period_mode); } - - MLX5E_SET_PFLAG(params, MLX5E_PFLAG_TX_CQE_BASED_MODER, - params->tx_cq_moderation.cq_period_mode == - MLX5_CQ_PERIOD_MODE_START_FROM_CQE); } -void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode) +void mlx5e_reset_rx_moderation(struct mlx5e_params *params, u8 cq_period_mode) { if (params->rx_dim_enabled) { u8 dim_period_mode = mlx5_to_net_dim_cq_period_mode(cq_period_mode); @@ -4740,7 +4736,19 @@ void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode) } else { params->rx_cq_moderation = mlx5e_get_def_rx_moderation(cq_period_mode); } +} + +void mlx5e_set_tx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode) +{ + mlx5e_reset_tx_moderation(params, cq_period_mode); + MLX5E_SET_PFLAG(params, MLX5E_PFLAG_TX_CQE_BASED_MODER, + params->tx_cq_moderation.cq_period_mode == + MLX5_CQ_PERIOD_MODE_START_FROM_CQE); +} +void mlx5e_set_rx_cq_mode_params(struct mlx5e_params *params, u8 cq_period_mode) +{ + mlx5e_reset_rx_moderation(params, cq_period_mode); MLX5E_SET_PFLAG(params, MLX5E_PFLAG_RX_CQE_BASED_MODER, params->rx_cq_moderation.cq_period_mode == MLX5_CQ_PERIOD_MODE_START_FROM_CQE); From patchwork Fri May 29 20:46:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 218164 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, 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 9F06FC433DF for ; Fri, 29 May 2020 20:47:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 622E0207BC for ; Fri, 29 May 2020 20:47:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="GYtD4PeQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728348AbgE2UrF (ORCPT ); Fri, 29 May 2020 16:47:05 -0400 Received: from mail-vi1eur05on2044.outbound.protection.outlook.com ([40.107.21.44]:6087 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728342AbgE2UrD (ORCPT ); Fri, 29 May 2020 16:47:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S+h71+NB3mfO00edKLMQY42BSONQVAyzIXgRFEX79T1sVMVUNhTGlaiVx4lR4TwdX5UiqepVJ4NxVRPqAjaLT1cKE49h2UrOkvWNNND8/AaKWBe26u91XaCLvlidyV6eBSQQePgfqLLNgTI1OZ2crT3LY7qh1GBQaOHIHXKZFEAHeekSSdqGRsBwU/iEL32kK+h2WyNjeqKMXZtUyIiY6Er9cvwmKoRLGwuD2gkcC1a8Rc0g863OJwIAGi4BdenGuPkRSQhI3teHxvmceDe3Q2v4RIfoKOODtrNNMsvcWRpURVgbSEJG834gX6WOz6/WyEgYqqxk416ac5qlVXwUbA== 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=tSxTSEdmDcRUmTvr6UWLAfN0MYATb+ublykUwGyE7IA=; b=Kqi26P155/nJ2WFrZN7xtTwR/UVxWDSb3o0rQXYI9tDg6NhhOEONaQnHTPcDJ8+pkrKxQC2Pul/EEi3qjZZVX++1lCuXDbJTZsY6ZYQ0Q/f47WhJz70ONyc1VsfTfAWFp8PYzPHtFYz0yYwGIMVlTUL6hApVQ7VoN1dYjFjMr3Ppf0/yyy+iOgbp0zVXy55qWhIqAkV4ogQcRZvCaLB9PKJG7A5mFlIHND1+nmoAnkqJ/ex4ZoovrWk19JVPJny0HCpmUu7+eyNDgsTqZjRgfhzjMS0uRBA9KzOL9fyIGKaXkHcRk3knA7WvebJ1+swttEkMa+l21y3Mx8t7PTrRsg== 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=tSxTSEdmDcRUmTvr6UWLAfN0MYATb+ublykUwGyE7IA=; b=GYtD4PeQFiei8Z8fW3+K6Bgj6zQ3DtE8i+ZshrNnQVDtBnuKL6Gmnq4bLzITjabAo3xC+EVHXl7LqPuorRxozzNAGnkfG+Fq8knJnlHwlQl5xXc9N1CGWKC0pj5of7gO8IrGf47QkcdW2eX9amXFb3w5yFSPas0HgsGgyaldRK4= Authentication-Results: davemloft.net; dkim=none (message not signed) header.d=none; davemloft.net; dmarc=none action=none header.from=mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (2603:10a6:803:5e::23) by VI1PR05MB3359.eurprd05.prod.outlook.com (2603:10a6:802:1c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.21; Fri, 29 May 2020 20:46:56 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::2405:4594:97a:13c%2]) with mapi id 15.20.3045.018; Fri, 29 May 2020 20:46:56 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Pablo Neira Ayuso , Saeed Mahameed Subject: [net V2 7/7] net/mlx5e: replace EINVAL in mlx5e_flower_parse_meta() Date: Fri, 29 May 2020 13:46:10 -0700 Message-Id: <20200529204610.253456-8-saeedm@mellanox.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200529204610.253456-1-saeedm@mellanox.com> References: <20200529204610.253456-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) 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 BYAPR01CA0025.prod.exchangelabs.com (2603:10b6:a02:80::38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17 via Frontend Transport; Fri, 29 May 2020 20:46:54 +0000 X-Mailer: git-send-email 2.26.2 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: cdb4c70b-9c89-4849-74ba-08d804116ce0 X-MS-TrafficTypeDiagnostic: VI1PR05MB3359: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-Forefront-PRVS: 04180B6720 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u62ac+9B+x/milL0ZiHOc+zTH6MXtnUIE+mBiN/0mrhiO3SVcp6nXs4+FawxBGvZHCRAZwpk+n8/T12l8/7tzquIn3ARgAHQtOj0yC8d7XpIZS/1mfP7Le6ok1pgYHp6dtPCG5ukThOQ5NRX+TagEKMAaVgnbVwj6owm9lmzOiP/wQO8NKkIi/mKiORtRxMmp0M6xMNHFZD4z9fT1+CmjY0JyjV+3MsZg7TtIspjRH4gZchlPOrmT55MksQ9gN8HcYnYRyNLd98du/WAf+fjrtxzznWmNSfMntNLVBYposffxrquigFkGQ1JNTy85ZMgHOSSNijldRMv+w+acr855vY5GOmBO+Yl/iBdOW0okxSZ4bSQxOCcE15eCO89cqqx X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR05MB5102.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(366004)(346002)(376002)(396003)(2906002)(66556008)(86362001)(478600001)(956004)(2616005)(6486002)(54906003)(16526019)(6506007)(316002)(186003)(26005)(83380400001)(36756003)(66946007)(8676002)(1076003)(8936002)(66476007)(5660300002)(52116002)(6512007)(107886003)(4326008)(6666004)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: SeQZxR+ZOtmVnZ8Es0m61Mqi4V6EG9JFwvU6Mo7Vl2VJqvL9AxwPfoj6z29EvLUOv+GAeetjjhLwMyV32QZ1hS+0Vlc7sNsEpNWDv2ld/Ta8cnT8i9CH0xNPYD9jnI+z9BINiOPXrDU55GMBTbNGJveoQfY79FXEW7JTy6SJcbcs7X0cLofdGOvVMtOuzjmzzbvbrrZKlrN/Y8613Me7l5iDpjyknGX5kaTWtA0RXMG7Z5aCNGcjrm6cLbSkHXeIftMZDwzA38PScyyf8mBmV/P93nH901Cf5pnBKGskDjRg+jtY/UglZKwtbgjAUUegHLGzqONmSSeTnmidjACUmbHFVfMOQHeaK5vrBtyuw/i2jdRIZol19wCXpDPl1SZVMo5PL3eQjW9nmA/Cph5Aj7Qt4YMAo870y7cGiuvzZf3mDZwH/gBTgLJUsqq5ookSqVcmpcwr/a/fLzpONkNe0tlhi4LNCDcBxw1kT95YSOU= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdb4c70b-9c89-4849-74ba-08d804116ce0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 May 2020 20:46:56.3667 (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: 6uMZzSn2Wfa7Kv92tErAJQFUKVRnQ2MMzNjmLS6ZATa+TXarc6jiZd6gCZhYw2phba2oo6FU4thZ1H33NxZRmg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3359 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Pablo Neira Ayuso The drivers reports EINVAL to userspace through netlink on invalid meta match. This is confusing since EINVAL is usually reserved for malformed netlink messages. Replace it by more meaningful codes. Fixes: 6d65bc64e232 ("net/mlx5e: Add mlx5e_flower_parse_meta support") Signed-off-by: Pablo Neira Ayuso 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 6e7b2ce29d411..10f705761666b 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -2068,7 +2068,7 @@ static int mlx5e_flower_parse_meta(struct net_device *filter_dev, flow_rule_match_meta(rule, &match); if (match.mask->ingress_ifindex != 0xFFFFFFFF) { NL_SET_ERR_MSG_MOD(extack, "Unsupported ingress ifindex mask"); - return -EINVAL; + return -EOPNOTSUPP; } ingress_dev = __dev_get_by_index(dev_net(filter_dev), @@ -2076,13 +2076,13 @@ static int mlx5e_flower_parse_meta(struct net_device *filter_dev, if (!ingress_dev) { NL_SET_ERR_MSG_MOD(extack, "Can't find the ingress port to match on"); - return -EINVAL; + return -ENOENT; } if (ingress_dev != filter_dev) { NL_SET_ERR_MSG_MOD(extack, "Can't match on the ingress filter port"); - return -EINVAL; + return -EOPNOTSUPP; } return 0;