From patchwork Tue Mar 10 01:42:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222799 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 C39ABC10F29 for ; Tue, 10 Mar 2020 01:43:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 904CC20637 for ; Tue, 10 Mar 2020 01:43:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="Y10e6Qgn" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726558AbgCJBnW (ORCPT ); Mon, 9 Mar 2020 21:43:22 -0400 Received: from mail-vi1eur05on2057.outbound.protection.outlook.com ([40.107.21.57]:6098 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726368AbgCJBnV (ORCPT ); Mon, 9 Mar 2020 21:43:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jH91NqAFBbBU+UsS8rweSaXQodr7tHcvNgZc1slXs7C1rKHytUvWYAB487vrtLmwdmY4JfI1JPUmezUJIsE3i94UoVVfGMP9SFWdnwkwQBLba5rq80RgPR8j6XvaYbxx275/iTg35Zxn5iHWxpBdCrYpQh+PByREL2a+l2JANdFc6vuR05aRlPWHchRXymro2Ue4r3HjG4xCROIoSQNAuFbMW0WOwZBJgOCaqpjBTI5rHOqXt2TSA1XLd0S4DUoTe5N+63P3susPfnF8IfZ5JEaAI2jGsqt7+qBIeODy7Fs3OlF0vKIDlMhZs4G1+IHMAaAaf2wMaROXykCZTuqqeg== 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=MZRYnpyndJTtxjbmX2cBgf0E9a3N++uIPVuuZEYGB+g=; b=MGdWb9ePU3HqeHwvLidu9oq6gPRRk17YOmqoKo1Sow8V6j1CquQWIcAE+H2CC9MYFz/1zVt24mmacM51d8JnpY/wWZA5GeoWJpDOZAEYemR7HsQhxcHaDgHUbA5mC9VXY5Vz2h5bD7LaGQhtOsosZBKaUQirBwXMseP3XYd5YS9rwj6tme09nyvzMmFIBJZzsl/vCGxiKFHqLyHu85S+MWIK94xDmIBmo+VgBDr+8H8EKfHY2qk63szyjk3+7W6l6McwODN7Q718D+zSbo+5BcCUsNknosQ3sIQqAcMXyYgT032ILGJNdWbJ6xKH2lk7gjNCNGRGylANmaijV3ZBfw== 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=MZRYnpyndJTtxjbmX2cBgf0E9a3N++uIPVuuZEYGB+g=; b=Y10e6QgnLTTN0iwVNA5FbEEs/GF13O+JKx/4XT1kqhOgJP+KfgKhEYkeHI5w85x1VwMFXih7LKowaCPm9gThr6vCczYFv4a0mbcu8ppX1SMxMSx1TBt6MP/tNSFwuaTiyUbErsnW5VlB6TKNN9qna+YuAQW1Nzckxqf9MaWFjjM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB5533.eurprd05.prod.outlook.com (20.177.201.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 10 Mar 2020 01:43:06 +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.2793.013; Tue, 10 Mar 2020 01:43:06 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Mark Bloch , Saeed Mahameed Subject: [net-next 01/11] net/mlx5: Expose port speed when possible Date: Mon, 9 Mar 2020 18:42:36 -0700 Message-Id: <20200310014246.30830-2-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200310014246.30830-1-saeedm@mellanox.com> References: <20200310014246.30830-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) 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 BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Tue, 10 Mar 2020 01:43:04 +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: 549b5779-aae5-4b41-0deb-08d7c49460e1 X-MS-TrafficTypeDiagnostic: VI1PR05MB5533:|VI1PR05MB5533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1122; X-Forefront-PRVS: 033857D0BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(66476007)(16526019)(316002)(1076003)(66946007)(66556008)(8676002)(86362001)(6506007)(478600001)(107886003)(5660300002)(81166006)(81156014)(6486002)(956004)(36756003)(2906002)(6512007)(4326008)(54906003)(8936002)(26005)(2616005)(52116002)(6666004)(186003)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5533; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: 2sEZaVzk5KlcAg7mVIMaQ11tJjE2uigSTR4gFY9zjnt2v8B3VKQmVx8unDZMBHZD8eEsesVCZChrddF9AitRGH14Cwdmh+f9B9LQuaxziQnIzOvIY5JUWs08usMy3upj2tciR/rZXogyZ8h6FaVRlw+U2l3Z9BoaEKBe4HDlNlkilzMsTXoC0DTwaySPdopsJD8D7MUfUhD4sF6ejFIn7eWw+jNaDGjvZAOhVphLJ2D/IGYeO/IHU6HwbPQj9W0+NcRhYi0l46vX7Qc6MbdOMwQkw5zsPAUm35TwMNPusmn8hg8LS/bCjFIdlxpPpp9+8l9h1hyKvtLaaTNNVhV8GdZE5j7a3f5C8PxV/76Duk8uHJunXrVowlM0AvMmX/7KTM9omigpwizZlPkTp8ZeQt2ZyH2sP8aX60xbimSasidQFtC1YYM+2p33Abz4j+x/LNxcHYgMiM4o27orMuJF/wtfJnT/F880GpsxbRPmyNzMgwa7mxDq1wdQsU5m6hop5+4lfgA34MiQ5p4fVAQBhTJ4bxWXyRD20MMq5a9E3bM= X-MS-Exchange-AntiSpam-MessageData: 4BVjb5Y0mPJR/ICI7orB8YA54tzCLEakRHjyKprbxbaTITQiIaTsBRia+87QJPJ75Lq+KY/ZTIALzIy2NWL3y07BQ7LxjTR/JHmM9fHhy+KW+Cajku1PprYSL7QzTIJQbOyXsSbJ5KMfvTgpCMavxA== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 549b5779-aae5-4b41-0deb-08d7c49460e1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2020 01:43:05.9907 (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: +P8nPP+J3Daxz6FOO4PYV9vq7bWItgU+ZhkM+7ZBiVD9xyWjdZWuzilkj1qFLHPuX6Y6s0EECWqfq0FQV67ShA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5533 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mark Bloch When port speed can't be reported based on ext_eth_proto_capability or eth_proto_capability instead of reporting speed as unknown check if the port's speed can be inferred based on the data_rate_oper field. Signed-off-by: Mark Bloch Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 01539b874b5e..f4491fba14a0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -773,6 +773,7 @@ static void ptys2ethtool_supported_advertised_port(struct ethtool_link_ksettings static void get_speed_duplex(struct net_device *netdev, u32 eth_proto_oper, bool force_legacy, + u16 data_rate_oper, struct ethtool_link_ksettings *link_ksettings) { struct mlx5e_priv *priv = netdev_priv(netdev); @@ -784,7 +785,10 @@ static void get_speed_duplex(struct net_device *netdev, speed = mlx5e_port_ptys2speed(priv->mdev, eth_proto_oper, force_legacy); if (!speed) { - speed = SPEED_UNKNOWN; + if (data_rate_oper) + speed = 100 * data_rate_oper; + else + speed = SPEED_UNKNOWN; goto out; } @@ -874,6 +878,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, { struct mlx5_core_dev *mdev = priv->mdev; u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0}; + u16 data_rate_oper; u32 rx_pause = 0; u32 tx_pause = 0; u32 eth_proto_cap; @@ -917,6 +922,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, an_disable_admin = MLX5_GET(ptys_reg, out, an_disable_admin); an_status = MLX5_GET(ptys_reg, out, an_status); connector_type = MLX5_GET(ptys_reg, out, connector_type); + data_rate_oper = MLX5_GET(ptys_reg, out, data_rate_oper); mlx5_query_port_pause(mdev, &rx_pause, &tx_pause); @@ -927,7 +933,7 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, get_advertising(eth_proto_admin, tx_pause, rx_pause, link_ksettings, admin_ext); get_speed_duplex(priv->netdev, eth_proto_oper, !admin_ext, - link_ksettings); + data_rate_oper, link_ksettings); eth_proto_oper = eth_proto_oper ? eth_proto_oper : eth_proto_cap; From patchwork Tue Mar 10 01:42:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222800 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 97F27C10F25 for ; Tue, 10 Mar 2020 01:43:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6AE0420637 for ; Tue, 10 Mar 2020 01:43:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="HKbIfDSO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726523AbgCJBnU (ORCPT ); Mon, 9 Mar 2020 21:43:20 -0400 Received: from mail-vi1eur05on2047.outbound.protection.outlook.com ([40.107.21.47]:6053 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726284AbgCJBnU (ORCPT ); Mon, 9 Mar 2020 21:43:20 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hFpiZtL2kzS6STVCxExdcQE5qyiFStG84S4tRAuOfBi2PIXsjHwphGzfueuPT6gYcJev56o9fbC/fZsOuHEyHskms6q8XcdedzuAGX7vUFNSzxd+mNNlbcMzs2O3lb9PmsrG/cwmOXouUW2kho9+KTTYBzgppmVWIbuAQ/osxK9IPQGfTa43IkO070FP0yG7HyBw2MgjqhxEXj2KaZigBfoR0eTotNwGCkPkol5BT8gRRcGVzAtErA4c0WbiuxNemRmloLC1lAwvvjqVwhDztzN8aoArAjvdsX1RwRA1WrbJ8U4cLIRXpzUndkfJvMrdHNX7SZz7N3kulqaQbV0oHg== 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=0jIDVpBYRdHajtKUasT+63QmgmX184tx2zkg1MURp2k=; b=A6ECy9e+76NQtFLjlUm5URO2QJOlxaKNK/kNEje1G23xbOirCuLzQOTf00WqAp+uFie04cigOGtBMFQkB//M8m9LYlFsyyaQnKtiLHOJm3w+z1COjlY2KvptrFxadMeD9SRoE+j+3WenkcgdqzEh7eMeG8lQfnfQJPQmTA5Q9hPbwYqdSBTVfo5VR4edN/obcA+AoAd2wKJRDWROo8+rDwEoxaE9sRC15OQPxUvAtrIIvgOqelQIcr+78rkBGwrWc/kbPhg4XqvaZUrOVY5CMKd+abgDowMGPK0J9/JJdBNFrWsUDVINIZT16vePrD6e3LALaH4AUV6NQ/fGR96eqw== 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=0jIDVpBYRdHajtKUasT+63QmgmX184tx2zkg1MURp2k=; b=HKbIfDSOWqDwE3kmo3QEqhEzYNI4allkx3dbVJ3h8425oiVjBL3x+Coh13HijeGLT2UJ32Hi6kSTdft2iCpG3vt0kuP2bn7hIKJX5mvYbFODiEJBMpvmGoaZuJpellW4SS4wBJSrvXsnhlrv/9ROSpXMWXRZ7dm4FywfIqUtrgc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB5533.eurprd05.prod.outlook.com (20.177.201.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 10 Mar 2020 01:43:08 +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.2793.013; Tue, 10 Mar 2020 01:43:08 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Mark Bloch , Saeed Mahameed Subject: [net-next 02/11] net/mlx5: Tidy up and fix reverse christmas ordring Date: Mon, 9 Mar 2020 18:42:37 -0700 Message-Id: <20200310014246.30830-3-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200310014246.30830-1-saeedm@mellanox.com> References: <20200310014246.30830-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) 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 BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Tue, 10 Mar 2020 01:43:06 +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: b6a1afdc-6b6a-4e05-2eeb-08d7c494622f X-MS-TrafficTypeDiagnostic: VI1PR05MB5533:|VI1PR05MB5533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:296; X-Forefront-PRVS: 033857D0BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(66476007)(16526019)(316002)(1076003)(66946007)(66556008)(8676002)(86362001)(6506007)(478600001)(107886003)(5660300002)(81166006)(81156014)(6486002)(956004)(36756003)(2906002)(6512007)(4326008)(54906003)(8936002)(26005)(2616005)(52116002)(6666004)(186003)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5533; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: S+c6QeWl80A9v9SNnXhGfrq1DAOb2vGDJ9lwm9bGSUrOSl+UcXSfwRNZDatZeb+5Jm+5cmu29UGfV+SMEVegPqlJS8/0oEzsSc4ji4wyYFN/I34lnFQ4OQYV7qNZgxWTYtDYUMzxwPeePzzYfEQESj4+lFHz7rPdACigepRQuR36o8hGWNxnFGWMIgrpbLmVCvSzkj6YGz0Pz9OIt1Zsgay51RICR8IV2AGeRqvX3acx5q/+qrcr92bVF++Jl12F6O8SHpi62cTA+PkaSAGDwvsnk/VuDO39fhSMvmqzEJpHEa5vo0QS6V11OtLlf2fg3qL8glfqcb4RSR1YQbZOHC3Tku+OzjFPEgEdpX/WNiHUYgK0OmNuVinDkNgLgUyLBAlod5jW/cJyYnW3rALo0xLgDG16k+S1noMdbEYidMsJrOOgaucld1rdSpGmIk99Y2KOsV672WDGL0Pb4azquhUpCickvO89hGGeNFunm4QSGkoQgyhRp2iG0owVwMU1NfOeAC/F2MbfPnRcGQCPrV8T1hlUGQiszIgJ2OjJd6o= X-MS-Exchange-AntiSpam-MessageData: hHsJDO44iFBn5RW4IqjzH0Tj9roDj5Ye6y9kgAHXi/mF5MrHHxX8gGBqRhaYhY8svncH7JFI8ITYXdPYNJcgLc0fAnF7lb1t3D9xVk8N38x3YGlCYj7DKBkMPtefOdgHpjkzNQnXNVsh/+oPg3TozQ== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: b6a1afdc-6b6a-4e05-2eeb-08d7c494622f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2020 01:43:08.1295 (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: q2gU4t0QGVQ+HUphchbGi6jJ9sKhqteMpbLU/yvJO82P9yBtQyejQA4Adu6kKwx/slZ/aCPQIbvbbC85bb+9xA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5533 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mark Bloch Use reverse chirstmas tree inside mlx5e_ethtool_get_link_ksettings. Signed-off-by: Mark Bloch Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en_ethtool.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index f4491fba14a0..4e667608bffd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -877,18 +877,18 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, struct ethtool_link_ksettings *link_ksettings) { struct mlx5_core_dev *mdev = priv->mdev; - u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {0}; + u32 out[MLX5_ST_SZ_DW(ptys_reg)] = {}; + u32 eth_proto_admin; + u8 an_disable_admin; u16 data_rate_oper; + u32 eth_proto_oper; + u32 eth_proto_cap; + u8 connector_type; u32 rx_pause = 0; u32 tx_pause = 0; - u32 eth_proto_cap; - u32 eth_proto_admin; u32 eth_proto_lp; - u32 eth_proto_oper; - u8 an_disable_admin; - u8 an_status; - u8 connector_type; bool admin_ext; + u8 an_status; bool ext; int err; From patchwork Tue Mar 10 01:42:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222798 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 35007C10F25 for ; Tue, 10 Mar 2020 01:43:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 087E920637 for ; Tue, 10 Mar 2020 01:43:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="g8Tuj3BC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbgCJBn2 (ORCPT ); Mon, 9 Mar 2020 21:43:28 -0400 Received: from mail-vi1eur05on2047.outbound.protection.outlook.com ([40.107.21.47]:6053 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726569AbgCJBnY (ORCPT ); Mon, 9 Mar 2020 21:43:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q4mf45Kfs/lqHckMvzL52fMNY5QRAn41Uy7Ah9m2lsQHRy9LLZtatq1n4BVJA0995xYB103FPX3Rv3qxP5RtnDkAlmQCsD4oWX3h18p+t1Qyv+RxEzeXa4dvQiqRrSOCBrwZ9BrYYPruuTsaTp4VOx5ZDGoF4CKHCxINIgHwmP7Dm4U4rtt4xFSHISVzVa+6OF+n10QV6rfBQQ3cHY7YI4sEkGCMZwO3rP7PN9MYnNoIZiqQJmkqWaLCebvbfZNX4XKiPc2DoLid7bHD0EM0i8Su5FVqNA6b1hx6Aeb6HXVX+YTi2W2fM9fWXywXr1spVPiaSLUqJrg2EwqNwGlZ4g== 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=MhOHzYv/XZU+6AqcQwDHDVN+wFxMhcHFtLTt4UaqvNI=; b=UbvApO904Ql7HluH5cF0mI8AH7aw9UygJzzrRIaovHlxFaZVS2IjGGs3xCO83srOqCBenXLu+gOJP+NPsFwTCIKgda6FAJBWQFl8TK61G0wAzOaSxCl19Ta+A6oWNXmAaqkSr1WCwcHfKHDH7MXTUYZ4VY1b4AxNJDEBul8zsSTbPLan94dXGa3Tg/ZHVmsLSW/WC1R0lOCtVf3ta1hdyAyyr3xB8XNkAXEYTlGRUFx0S2aF3/HQP/P+73n++J7YuQg2bA89aXYFJt+Kpmk1u1fCCQDeY/TYG2uQnNU16tZ068yfiD4cCroPXjDT5J1/Hwq+/7Isuw1lj5//YF2hiA== 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=MhOHzYv/XZU+6AqcQwDHDVN+wFxMhcHFtLTt4UaqvNI=; b=g8Tuj3BC8a0AirXJysqFekwGJAi3a1qm/tOu2Rkn8SDd/ukf2iRKznlhKUSorf6j3jlNYTvue49iGhuqhyULks/8eDQWiLzm4SS0OjzsnN3h2V13TrF88SMTF8xp6pJx7uYW/S5GvKAyI61vPeZ4EmUjtX/wKfH1HOwfdLM46Lg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB5533.eurprd05.prod.outlook.com (20.177.201.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 10 Mar 2020 01:43:14 +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.2793.013; Tue, 10 Mar 2020 01:43:14 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Dan Carpenter , Saeed Mahameed Subject: [net-next 05/11] net/mlx5e: Fix an IS_ERR() vs NULL check Date: Mon, 9 Mar 2020 18:42:40 -0700 Message-Id: <20200310014246.30830-6-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200310014246.30830-1-saeedm@mellanox.com> References: <20200310014246.30830-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) 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 BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Tue, 10 Mar 2020 01:43:12 +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: 254aa407-3e07-4a3a-864b-08d7c49465c7 X-MS-TrafficTypeDiagnostic: VI1PR05MB5533:|VI1PR05MB5533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:369; X-Forefront-PRVS: 033857D0BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(66476007)(16526019)(316002)(1076003)(66946007)(66556008)(8676002)(86362001)(6506007)(478600001)(107886003)(5660300002)(81166006)(81156014)(6486002)(956004)(36756003)(2906002)(6512007)(4326008)(54906003)(8936002)(26005)(2616005)(52116002)(6666004)(4744005)(186003)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5533; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: 4gP1ridKikbL3o5V2f/yrWifoaU+zXBM7JtqzWJzgEEPt5dI7NSVcUQwYCARXU503Bwb3mzNs1WGt/BF8JjkqPvkR0wKSB6/d14QcuB6lfYAswFBNLSB5B+6a905p1FDkCz0iOnLuB7U49MMraNHbUfpoOIEUTvVf88Zg5jPOF9yDwRDRVMOQTmW4YKj5eEmh6MGPacGdOFWeYcK0Ah/R2ANZD47D2lCuow/TUvlm0pVHVRO9PmWOhLgmUWwHXtlgVhZv3I/Yw7NzQLhLk9JpErHT4f3XzSRg6II+BsNtrUjijRl8Ug64GeAWg1chNdxU2eg/6270m+BVHc2KLKFNtX66WOzxY/LTFUVy5fkCvFCmQYxuZBvZR1VIl5Z1dem97otKTyQbPszeNRXTTFErMhCzC5wo8pn6puUVXla9rZb5xbhQqZurufqeGeWxpphVwtmx0MmMJshNWoiVf7eAFG90rE68/PrxDPzEFclQDuqfkhkyavg03mBe2o320YLv2E1lbnOxRTV49lGbxVjR2sXIsvwU6Q/jix2OK6vOUU= X-MS-Exchange-AntiSpam-MessageData: vNjQaoz0bZ0pJop4dc6ex1Ib6Rf/24qq3Uy1TcoZKUx65EtCjob2dOTi+P+cfS8M72O03/gFtiDBJfShK/g1zm+zxFgu5jtJK3m8GRwLuJUuFJiYSNz//7hgdEmVjlPv4d0y5lA+lK/WtfM9TSoxQw== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 254aa407-3e07-4a3a-864b-08d7c49465c7 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2020 01:43:14.1481 (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: 24ta92LaFKVDAf1S3c+xT5OcwoW/z+i2aDwLDkjaJVgaTfTzx6HTG210vzWzS45Ca0BnuqYvW4M0j5bMtEmi3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5533 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Dan Carpenter The esw_vport_tbl_get() function returns error pointers on error. Fixes: 96e326878fa5 ("net/mlx5e: Eswitch, Use per vport tables for mirroring") Signed-off-by: Dan Carpenter Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index bd26a1891b42..3bed4f0f2f3d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -198,7 +198,7 @@ int mlx5_esw_vport_tbl_get(struct mlx5_eswitch *esw) mlx5_esw_for_all_vports(esw, i, vport) { attr.in_rep->vport = vport->vport; fdb = esw_vport_tbl_get(esw, &attr); - if (!fdb) + if (IS_ERR(fdb)) goto out; } return 0; From patchwork Tue Mar 10 01:42:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222797 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 73885C10F25 for ; Tue, 10 Mar 2020 01:43:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3D82620637 for ; Tue, 10 Mar 2020 01:43:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="rYlBjBaq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726650AbgCJBnb (ORCPT ); Mon, 9 Mar 2020 21:43:31 -0400 Received: from mail-vi1eur05on2047.outbound.protection.outlook.com ([40.107.21.47]:6053 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726284AbgCJBn2 (ORCPT ); Mon, 9 Mar 2020 21:43:28 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i5S2h0g9Xiz57YXvFwbwWqpM6fIxbj8pl+zS3oOurgtZNG8H5ohylNmUztDJNqNGevAWKhQBCtvwetQsVNSxJufg8SvnWUOA5S/ELK26idHIljOL5BoVn7aGVTUnBbPXVBiJi+WseoYQcaRtHNjoiJ/EkYZteOsxUoFr2I9IF4bX/n4vV7g47aRU/EJAKYZXGjP4BkV2cZn8/hl3N0cmRYIk9gSNkJ6HMuLxyKBLcepS/ox1GDjmsRAcgJ2pjpqmwj7BweCqUOMOVcilwT9yHKLRK+Jg/VPhZFCGkVEdlz48/sX33d7A+x2x+iEXtSMwsU+f7HQHS3DEfQIEDEMWsg== 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=/xtiso4lhCIf1/46vGCezQzZkHWVLw4RulPSDUIFcIY=; b=EyDtc5rjqXJxpTwYrW5c8janBloteSrwkBfrNqGyA7Ozf6CZuyk2CipIrx0e978uBlDwQcla8M38iRcCl7AA52im+lmCycSX1XrC2gi5L6iidEXoaU5Zwp2RAflexPYmvxtpsrlNgO2/EdMTy7nnxDxXpybZz9hyaPZ16VQSYRTryDeseK2/2aeHtCIGLxbzknOiuVF00549fqWY1CmCqY4mlkcfcWOYJr12JU2q6sc8W+G3QTFzEgqz+JRZhqNutDJopV0qcJFFHEuJt4aJQMswoQ3r6W0vuOdYhH7JxdX/0R+EBp/i7QkwgGPjT1aZVDpbie9pqWtDYOdZjxn/Yg== 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=/xtiso4lhCIf1/46vGCezQzZkHWVLw4RulPSDUIFcIY=; b=rYlBjBaq6YnkiCiOEhS1HWbEuWdoMp1xzj7/HhB68aDi7h/ZidHE5w/r4T9mrw5/2K/kE3Ghp7JJ52TPlz3nmi/AOIleL6p91N3AQwu8O5nTBT+HgfZcMULaE0Cam9v3YhDKFaRuYCatsJyjWcj36/3MqGhzPpSNxXEn2gMRmS8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB5533.eurprd05.prod.outlook.com (20.177.201.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 10 Mar 2020 01:43: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.2793.013; Tue, 10 Mar 2020 01:43:18 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Parav Pandit , Roi Dayan , Bodong Wang , Mark Bloch , Saeed Mahameed Subject: [net-next 07/11] net/mlx5: E-switch, make query inline mode a static function Date: Mon, 9 Mar 2020 18:42:42 -0700 Message-Id: <20200310014246.30830-8-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200310014246.30830-1-saeedm@mellanox.com> References: <20200310014246.30830-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) 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 BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Tue, 10 Mar 2020 01:43: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: c9119d5b-75d5-4fab-4002-08d7c494687d X-MS-TrafficTypeDiagnostic: VI1PR05MB5533:|VI1PR05MB5533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3513; X-Forefront-PRVS: 033857D0BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(66476007)(16526019)(316002)(1076003)(66946007)(66556008)(8676002)(86362001)(6506007)(478600001)(107886003)(5660300002)(81166006)(81156014)(6486002)(956004)(36756003)(2906002)(6512007)(4326008)(54906003)(8936002)(26005)(2616005)(52116002)(6666004)(186003)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5533; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: uGY8UC8thKWiYsbOO2XVnybJfp+/cffz0n62dzPrOkZM+LIXbalh4HvF2yJ+AhBOjSt00PTZvw5tuwSrZmxSFY52+OiBaIBm9wqMrhiA7xny8l5eVxVrg0b2g2wLSo8RnuZzicluwWzbpTq5o+pe6jlK81DjTX74pDCr6oSGfCgEwjp/FbynfL82fofzqbPSTf5MuFPGICLMob5dvej+uqekfdd1zh2laQLdcuksqDzI2UuL+pRJ2qMto9tSncpObGJhdTbcJn4f9YcLbELXQKTRYQJL9KndfwWBDwr76JxkKIdrr/vCB46TfHUNYz/VmCFgxq6gUBadTzJuQL7KbaTG0OQCWfHQOfHJjocWPK/7IZcGxfLczQmulBdjpVtX6gvcoKeZrxQwkj1lK5ceMWcCP7xiwDA7x8ac6nh+IWXuF+iS3ubQOaeZ7/qNtncwOJ189AXZ5RHNSphvaBAxLqnDCuzSKMNpwgwN17I0DmZfZnUXhZfSpi7TyZv3S2jqlaK3NbKF0bcH4goIrp4xvpIOOvZXZ8H2AOOoNvNlruU= X-MS-Exchange-AntiSpam-MessageData: tYnVF8RP+/p9qajt/vl0sl5tzOGL5EwXXOQI+VRhLevuHVvZJ+bWgqpnqP/IqOTZ8ryFJs6HkvNHk4L2IDoz7mDc64OR/r0o0WxKDVJyiKmsrQlWhCA7lLFWilEEuG5kzX/qIiavv8SxoU/auJBHUg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c9119d5b-75d5-4fab-4002-08d7c494687d X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2020 01:43:18.5426 (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: Hyyw0JEBtnVueuNV8QLg9yH9FT4+xBbqqcXpszp5NzKyJP4oeQqE5yq+SFtkLDSnpiK/1RlrcqbYvQekIfrmWw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5533 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Parav Pandit mlx5_eswitch_inline_mode_get() is used only in eswitch_offloads.c. Hence, make it static and adjacent to its caller function. Reviewed-by: Roi Dayan Reviewed-by: Bodong Wang Signed-off-by: Parav Pandit Reviewed-by: Mark Bloch Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/eswitch.h | 1 - .../mellanox/mlx5/core/eswitch_offloads.c | 74 +++++++++---------- 2 files changed, 37 insertions(+), 38 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h index d010657ce601..99073342b500 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h @@ -425,7 +425,6 @@ int mlx5_devlink_eswitch_mode_get(struct devlink *devlink, u16 *mode); int mlx5_devlink_eswitch_inline_mode_set(struct devlink *devlink, u8 mode, struct netlink_ext_ack *extack); int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8 *mode); -int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, u8 *mode); int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, enum devlink_eswitch_encap_mode encap, struct netlink_ext_ack *extack); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c index 3bed4f0f2f3d..1a909d47aee2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -1344,6 +1344,43 @@ mlx5_eswitch_create_vport_rx_rule(struct mlx5_eswitch *esw, u16 vport, return flow_rule; } +static int mlx5_eswitch_inline_mode_get(const struct mlx5_eswitch *esw, u8 *mode) +{ + u8 prev_mlx5_mode, mlx5_mode = MLX5_INLINE_MODE_L2; + struct mlx5_core_dev *dev = esw->dev; + int vport; + + if (!MLX5_CAP_GEN(dev, vport_group_manager)) + return -EOPNOTSUPP; + + if (esw->mode == MLX5_ESWITCH_NONE) + return -EOPNOTSUPP; + + switch (MLX5_CAP_ETH(dev, wqe_inline_mode)) { + case MLX5_CAP_INLINE_MODE_NOT_REQUIRED: + mlx5_mode = MLX5_INLINE_MODE_NONE; + goto out; + case MLX5_CAP_INLINE_MODE_L2: + mlx5_mode = MLX5_INLINE_MODE_L2; + goto out; + case MLX5_CAP_INLINE_MODE_VPORT_CONTEXT: + goto query_vports; + } + +query_vports: + mlx5_query_nic_vport_min_inline(dev, esw->first_host_vport, &prev_mlx5_mode); + mlx5_esw_for_each_host_func_vport(esw, vport, esw->esw_funcs.num_vfs) { + mlx5_query_nic_vport_min_inline(dev, vport, &mlx5_mode); + if (prev_mlx5_mode != mlx5_mode) + return -EINVAL; + prev_mlx5_mode = mlx5_mode; + } + +out: + *mode = mlx5_mode; + return 0; +} + static int esw_offloads_start(struct mlx5_eswitch *esw, struct netlink_ext_ack *extack) { @@ -2491,43 +2528,6 @@ int mlx5_devlink_eswitch_inline_mode_get(struct devlink *devlink, u8 *mode) return esw_inline_mode_to_devlink(esw->offloads.inline_mode, mode); } -int mlx5_eswitch_inline_mode_get(struct mlx5_eswitch *esw, u8 *mode) -{ - u8 prev_mlx5_mode, mlx5_mode = MLX5_INLINE_MODE_L2; - struct mlx5_core_dev *dev = esw->dev; - int vport; - - if (!MLX5_CAP_GEN(dev, vport_group_manager)) - return -EOPNOTSUPP; - - if (esw->mode == MLX5_ESWITCH_NONE) - return -EOPNOTSUPP; - - switch (MLX5_CAP_ETH(dev, wqe_inline_mode)) { - case MLX5_CAP_INLINE_MODE_NOT_REQUIRED: - mlx5_mode = MLX5_INLINE_MODE_NONE; - goto out; - case MLX5_CAP_INLINE_MODE_L2: - mlx5_mode = MLX5_INLINE_MODE_L2; - goto out; - case MLX5_CAP_INLINE_MODE_VPORT_CONTEXT: - goto query_vports; - } - -query_vports: - mlx5_query_nic_vport_min_inline(dev, esw->first_host_vport, &prev_mlx5_mode); - mlx5_esw_for_each_host_func_vport(esw, vport, esw->esw_funcs.num_vfs) { - mlx5_query_nic_vport_min_inline(dev, vport, &mlx5_mode); - if (prev_mlx5_mode != mlx5_mode) - return -EINVAL; - prev_mlx5_mode = mlx5_mode; - } - -out: - *mode = mlx5_mode; - return 0; -} - int mlx5_devlink_eswitch_encap_mode_set(struct devlink *devlink, enum devlink_eswitch_encap_mode encap, struct netlink_ext_ack *extack) From patchwork Tue Mar 10 01:42:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222796 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 F0A95C10F25 for ; Tue, 10 Mar 2020 01:43:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BD6B120637 for ; Tue, 10 Mar 2020 01:43:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="IFGJWKbh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726680AbgCJBnf (ORCPT ); Mon, 9 Mar 2020 21:43:35 -0400 Received: from mail-vi1eur05on2047.outbound.protection.outlook.com ([40.107.21.47]:6053 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726637AbgCJBna (ORCPT ); Mon, 9 Mar 2020 21:43:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ob0j9KCrszn+tk5VmXnibMDpkTF55t/tTeM5r0+jzlslWlFGuveCzTQFDm28XQwdtfLaz6Q3eV4SSnb1zJBTJGuNJYgirqLi1YXZZ1rXcyaq9POyuq9BAviCSu+NDDTZTryvtgZECHXhURLEdiC35CHmxCEjVCI6CFIFHZllJk/kI1AbxZpR1GY5mKnvrdYpAPzSfkEKjhi115pDC/91eJKNAKF6FNpaNEbKVlAvVmiewJEHs+HIJNGRMbGHbfmZk6IOGog8BmyNJeT7woRJB3BIC5IEgtnTQuke8wik2TYyp3OB8mUxmZkH7zcWKYt63ekTe3mHL8ymWLpm3/GkgQ== 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=TW8qwlRP3YspFv7XdwnLQYO2DeqWLgb2nMqc7VWxQnc=; b=QqAlSFhBCQ0k/KpCTofT+g/FfEhpzO5/A5dBX1WnIXV6YL7fArZSU3tRDXjifyinXQ8IGZUI3NjerPSxQ0aDisyMw7aYnP8XniH/Opi2mjeaEH+o7JI0p1b8+cdo3kgWkNn1xCxhGw7VHc1ZKST/ZarpeAjF3OwmIkQ71zbVAneuTWF5blCF6OZsLrZZRgKOUHTBryABC1roHxw1ENnzY1lbflaHg/tAY2M2/g7/qPWUCzJFFLoQz0nW1L2On9bd+vj9SlGVH8FJM4WXmKRZEJjwhJudr9PoW77dreqNI3dVRS3JX9ZNwisoGXDRnX/VIP2eKwtMBkNL4oL3cb5rYQ== 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=TW8qwlRP3YspFv7XdwnLQYO2DeqWLgb2nMqc7VWxQnc=; b=IFGJWKbhyNofk5otwhFY8/Wq8m9BNflJ3S0TSNczlO5HWJPkeyjKrW0B0ko0SWiUJ/gc3j0R+FGCpIT6Qgt0uTh2BBbAkVaGpFJYYro86DExNvB0mWXyird1yDw6A23T0/XzFaOih/1G9D+hXIb1nltSK1gcWhKZD3Ifk/d+SLQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB5533.eurprd05.prod.outlook.com (20.177.201.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 10 Mar 2020 01:43: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.2793.013; Tue, 10 Mar 2020 01:43:22 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Vlad Buslov , Roi Dayan , Saeed Mahameed Subject: [net-next 09/11] net/mlx5e: Show/set Rx flow indir table and RSS hash key on ul rep Date: Mon, 9 Mar 2020 18:42:44 -0700 Message-Id: <20200310014246.30830-10-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200310014246.30830-1-saeedm@mellanox.com> References: <20200310014246.30830-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) 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 BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Tue, 10 Mar 2020 01:43: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: d8188721-8a07-42f8-0e17-08d7c4946aca X-MS-TrafficTypeDiagnostic: VI1PR05MB5533:|VI1PR05MB5533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1751; X-Forefront-PRVS: 033857D0BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(66476007)(16526019)(316002)(1076003)(66946007)(66556008)(8676002)(86362001)(6506007)(478600001)(107886003)(5660300002)(81166006)(81156014)(6486002)(956004)(36756003)(2906002)(6512007)(4326008)(54906003)(8936002)(26005)(2616005)(52116002)(6666004)(186003)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5533; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: lnuLRPJK9fYZGyzE5AWrBGi3qQFI1JmQXFOWj0A/RKb1gqS2o8InP+nkXSnqyCfMMN9wdH1/wTbVugsdA/txKSausx+CT0ax1CLVYOlnzes7ZMqymA6ISErX6GNUAw1ImKEeKjIjbXPAg3d00eQWa6Ui5ciopBFuwA9BeaSynERf5VoBuCMS1X/TQqpmU3W20YQ/xvN3Io7AdQcVApbwpcApubL3mXWsktrs1APcQ2NZZ7CBSa9l/xb8HRCu3UMVjxQYPzUkmg23+bEnL62Ggygau6mPxqIrJLWb9GbRZN1C6VKGEeBaF6vFkshn8lM+5SceZJUUGdQ/4s0P5CUrLW7gkxHi4acB7grq/F5gw8SxCgdgUGxhnBPBkFj3nYwIjCa2oMAASZ6FWMjZ/itd558+UeuBu6hZUV0klBBnTmERajw+feUGcBLajH0s3nCXBae1Wi4RKMR+pBphX9HDhs9YLx44AmJP9N420Xhf+qkuWyj7mgm8edXDeZ8bGdKs4mzMvPTeCpmkdvEt8hFiiSdhX0d3N6E3cwnPJHpVMKs= X-MS-Exchange-AntiSpam-MessageData: umk4zqI1w+an39AsbFArguAQc1/G/m0aQac1neYLoKPAEmqhj8AI7xEyqttOdfBgi0z3R42qXHLF/3gsqxUu0RqDEmVXFApODKzsk2lHIk6ckQKGkw8CvHCiwAUeZThGsvMBXDzDSlCkv1cDPPrFZg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: d8188721-8a07-42f8-0e17-08d7c4946aca X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2020 01:43:22.4074 (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: fTqacpekp4Or4FUID7fwvyqDCgqV4DS4R0lxCnj+3hc9TmNgxg7YZGBzLN9qfkLuwRgIvqwFxEcWZBTR4CUfRw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5533 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vlad Buslov Reuse infrastructure that already exists for pf in legacy mode to show/set Rx flow hash indirection table and RSS hash key for uplink representors. Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en.h | 3 +++ drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c | 8 ++++---- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 ++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index 02b91aa896b0..0410cdaab475 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h @@ -1169,6 +1169,9 @@ int mlx5e_ethtool_get_link_ksettings(struct mlx5e_priv *priv, struct ethtool_link_ksettings *link_ksettings); int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv, const struct ethtool_link_ksettings *link_ksettings); +int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, u8 *hfunc); +int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir, const u8 *key, + const u8 hfunc); u32 mlx5e_ethtool_get_rxfh_key_size(struct mlx5e_priv *priv); u32 mlx5e_ethtool_get_rxfh_indir_size(struct mlx5e_priv *priv); int mlx5e_ethtool_get_ts_info(struct mlx5e_priv *priv, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c index 4e667608bffd..f28472471315 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c @@ -1132,8 +1132,8 @@ static u32 mlx5e_get_rxfh_indir_size(struct net_device *netdev) return mlx5e_ethtool_get_rxfh_indir_size(priv); } -static int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, - u8 *hfunc) +int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, + u8 *hfunc) { struct mlx5e_priv *priv = netdev_priv(netdev); struct mlx5e_rss_params *rss = &priv->rss_params; @@ -1152,8 +1152,8 @@ static int mlx5e_get_rxfh(struct net_device *netdev, u32 *indir, u8 *key, return 0; } -static int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir, - const u8 *key, const u8 hfunc) +int mlx5e_set_rxfh(struct net_device *dev, const u32 *indir, + const u8 *key, const u8 hfunc) { struct mlx5e_priv *priv = netdev_priv(dev); struct mlx5e_rss_params *rss = &priv->rss_params; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index cffb5f62c304..9ff0a8e6858e 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -369,6 +369,8 @@ static const struct ethtool_ops mlx5e_uplink_rep_ethtool_ops = { .set_link_ksettings = mlx5e_uplink_rep_set_link_ksettings, .get_rxfh_key_size = mlx5e_rep_get_rxfh_key_size, .get_rxfh_indir_size = mlx5e_rep_get_rxfh_indir_size, + .get_rxfh = mlx5e_get_rxfh, + .set_rxfh = mlx5e_set_rxfh, .get_pauseparam = mlx5e_uplink_rep_get_pauseparam, .set_pauseparam = mlx5e_uplink_rep_set_pauseparam, }; From patchwork Tue Mar 10 01:42:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 222795 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 66444C10F27 for ; Tue, 10 Mar 2020 01:43:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3AF0720637 for ; Tue, 10 Mar 2020 01:43:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="dzLrj360" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726715AbgCJBnk (ORCPT ); Mon, 9 Mar 2020 21:43:40 -0400 Received: from mail-vi1eur05on2057.outbound.protection.outlook.com ([40.107.21.57]:6098 "EHLO EUR05-VI1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726284AbgCJBnh (ORCPT ); Mon, 9 Mar 2020 21:43:37 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TDJwhA8YH1hKKUjCpcMqRYiZ+4q4XZiOTzncaeH6fIu+r9fuWWJ3UOz2O7XEbreH5Bm4mfu13XFp8Alup+A3HexmXrpnNMDxlaNBSxokCRRxPH4ReBPEe7OOvt1oP2BonkMyzcNDxK5DVqXl0iUH7lWCOyg6Vrx4QLqNk9dE6KOQSqZgXScyRJG0xuFVmj8hxA/DXxMuLB4BoYXvcWKgoqRxfnK/xv/+TYq4VnIGsAKrJtP/5VzPMQlaTvvDrnRQBiP8/v02oXzXQbjJ48JD1tdBnr/9a3XBLKZ2SnkI24y3rNc1irNtNv8VFdsi1sTFkcxb5tKtpsWxu0cBEHohXg== 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=F4/IVW2JOEdpuojk74IZccgSOjIl8WRPN4Po8lwAh5E=; b=SMNkuIRg7R3DMRTVi3OpQCxq5Syjb/GP64uAVMas7nP9TdIK1g/gxCvo6ZtT5kLiBQfjQBz7GTYWQ0rO2j6yiGHpnD0Yklxf2awHzKaB5K5XFxHulrfoJKLgZxtHB5yD7ubUBeHxnn+4KQ8r8cX0zGsuNyVt0kraCSuwlJ8znIDvEEcx+Gf9yBTCfFxGMooQ0Z+METc1m/XN4Ld9trbb5KWPz5tA/c0o+UkCh2P90PHdYQB3Cxxvvs59fq4Rdx3xXWUfwO83LRyH8z4KO1yNUOCYvLsEvTsmWv7JRwlYjo3v4gQoZQSxhx3Ema4pxoAAS3Q6aY4QqJ3piCnvL1mwSw== 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=F4/IVW2JOEdpuojk74IZccgSOjIl8WRPN4Po8lwAh5E=; b=dzLrj360ZqBR6CksmJn1m6JgUYSbSSTJ7HAXEhaAh0znZlsECVNHRyepj4qdYxQ/++MkE+OI4TbjC/eMrWZIBwSITkih0y312KFNKzMOePDkeJz1iR00Lpe4doId6E1DvMKRrE8Q5hcwUp6coLkr5LwiQNyrLPoIzyFcBwvMIIk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=saeedm@mellanox.com; Received: from VI1PR05MB5102.eurprd05.prod.outlook.com (20.177.51.151) by VI1PR05MB5533.eurprd05.prod.outlook.com (20.177.201.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.17; Tue, 10 Mar 2020 01:43:24 +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.2793.013; Tue, 10 Mar 2020 01:43:24 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Vlad Buslov , Roi Dayan , Saeed Mahameed Subject: [net-next 10/11] net/mlx5e: Init ethtool steering for representors Date: Mon, 9 Mar 2020 18:42:45 -0700 Message-Id: <20200310014246.30830-11-saeedm@mellanox.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200310014246.30830-1-saeedm@mellanox.com> References: <20200310014246.30830-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) 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 BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2793.15 via Frontend Transport; Tue, 10 Mar 2020 01:43:22 +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: be89a1a2-cbb4-4c2e-70fd-08d7c4946c0c X-MS-TrafficTypeDiagnostic: VI1PR05MB5533:|VI1PR05MB5533: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:192; X-Forefront-PRVS: 033857D0BD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(66476007)(16526019)(316002)(1076003)(66946007)(66556008)(8676002)(86362001)(6506007)(478600001)(107886003)(5660300002)(81166006)(81156014)(6486002)(956004)(36756003)(2906002)(6512007)(4326008)(54906003)(8936002)(26005)(2616005)(52116002)(6666004)(186003)(54420400002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB5533; H:VI1PR05MB5102.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: Lt3bFn83w7a5FvWwJ76d+SlXmCAwNuiyLQfCqSc+X1WeSsUhyKAiAD+eA7oYpEmrczgt04+RKu4MF6ygbhuaa7cGv5yyXLt5PRCzijJF2Sz3NFNXGtwsskGIR2H20K9IKaNvoC3VCpYKoKMAF6FWJUlWGygmfTcgKpLe+Lweo0YIPi/0EGbX4lgaZX7sxKmovOj/3HVESu9wmqOoFmPTWh4iybyOnaHuNgGrqAT+cMv3/i/q9GcRvihpuU1/W15njiRqY5CDg/iGOw32zQ/6wp4z4IQ5g15FEEmqhyA9F2GKOHO3cujC9KICImbk07m5slrXvWlLKYruoNw2hN2eVQl7Id3c2qE/bS1yE1xcwtQ7c8wdA7zQqughXCiNHjhtQM7TsDrQdeXs1zwzAAC/8MRIVfSD3gPxbCNNAIDAPUVT8GsCFdcor73kYzZffyg2lB2SZDcer2nGt0pIuyw0vBwtD3WjMDoU7cKgkHMVqEgsqu2kK3D9lyLLJVTZGdMU2R0Fmv6WxyrTMsE5mQ/ce9QpBntRRP+2W/6obBZelbo= X-MS-Exchange-AntiSpam-MessageData: iAUM0IqVGRUPU0gcDrMbzICwnxVprjiWQdakdXknLNAkYJROmTzt0YsgJF+QaUS/rxladLv0apwvIaaiDFKkKidxt0/gFWeLYBdJ+2+OzkE1T1jyjNsCrpLs8lMjVu6rLey+dltI9h1lr4pwntL+vg== X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: be89a1a2-cbb4-4c2e-70fd-08d7c4946c0c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2020 01:43:24.6691 (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: D/KwIwMXisZtFXOXXqRWUo52/sI3Wj23NpZkFxzGLf3sTcrqqHlOfMD9cWyobJ/+BPICMhfMD32AFj6+NEHuAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5533 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Vlad Buslov During transition to uplink representors the code responsible for initializing ethtool steering functionality wasn't added to representor init rx routine. This causes NULL pointer dereference during configuration of network flow classification rule with ethtool (only possible to reproduce with next commit in this series which registers necessary ethtool callbacks). Signed-off-by: Vlad Buslov Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 9ff0a8e6858e..5a7de0e93f8f 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -1685,6 +1685,8 @@ static int mlx5e_init_rep_rx(struct mlx5e_priv *priv) if (err) goto err_destroy_root_ft; + mlx5e_ethtool_init_steering(priv); + return 0; err_destroy_root_ft: