From patchwork Thu Apr 30 17:18:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220174 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 69522C4724C for ; Thu, 30 Apr 2020 17:21:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 447E520787 for ; Thu, 30 Apr 2020 17:21:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="tIwLoNc1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726789AbgD3RVE (ORCPT ); Thu, 30 Apr 2020 13:21:04 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:6237 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726355AbgD3RVD (ORCPT ); Thu, 30 Apr 2020 13:21:03 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=evE39AlZJ7zqaE5hOMeDGbKmf+5bqSMwIBtEtSi9qjhhwMt57eQCPy4vX52YcRfoDSQkDfGszYSjXD+W476QQF6+9FZxDnuHfjTzw11LmVJbdecCRYIiFpbjoTy5kdjCAJ3bSlkHwkE+ogT8w/wfEraF7mYJM0eVe9/efeGQZ8eAeyo+XuhnQ+es6b3FUugbXWwAvwZ02SVCSwrU7QlrB5nRUp2hKaL1dI91OtcLAweb6TGbmch/m4hRllClRACtzeWfbKBGe6dqPueSs/GC88IuJxwkyZXP2Pc+FwXZzv/ZdwGLMlnGtNvJKFHfbzEh63S3HWPqRYMY+TfqPfVD3A== 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=6qHvTJhiFeX1z0nFs4BIfD05xYycC+GEEvFiL0uyQ5A=; b=KGGLJOxSKlYoPrS2W3SE8d5lnczFQz/4ansLdmTmKlSlpcn+QA4Q5JuCOerpwj7x6A7+b2iazpzCVjFTa/2KS75ji8QjS+WVVKV+A12t6AmYLi5d7+rXEBBb4Edrs+ZT2b6E42qrnT8REdoD3tne5rF2NbunPxYsSs6AFPy4Pnps8GIrlr0IEXEzkoESPnPffso4JBqjJ9sI5NUdBH3LFuQ8iIDn0rPIxuqsr63XL0DCC0WkFORxKJIHdme+4Zi4WhiJ2V/nFeB4IJqqfOCmL4f60u+BF8FX7KFlvChVuN8bZxAcIOdyyncYwuqdoSkixXk2Zr6riCapahP8N35vZA== 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=6qHvTJhiFeX1z0nFs4BIfD05xYycC+GEEvFiL0uyQ5A=; b=tIwLoNc1TTVCGqtMOqlM8zQ8fj87qhNDuqnwDV4l+5h5hH74v6bbe0IBnq5GtFlabnTc+dpw+7Y2L65QycUMHon6lmqQvtBsVHd/Mkkq+rMAInxnXfDlMzaSDxkuI4PRBwcB0BmP1JIcztTC7pYsZBT32jtGt9rRblyZtx7dCeE= 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 VI1PR05MB3296.eurprd05.prod.outlook.com (2603:10a6:802:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:20:59 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 17:20:59 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Parav Pandit , Jiri Pirko , Saeed Mahameed Subject: [net-next 02/15] net/mlx5e: Use helper API to get devlink port index for all port flavours Date: Thu, 30 Apr 2020 10:18:22 -0700 Message-Id: <20200430171835.20812-3-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430171835.20812-1-saeedm@mellanox.com> References: <20200430171835.20812-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) 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 BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:20:56 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7f1116fc-503f-4143-0ed0-08d7ed2ad8fc X-MS-TrafficTypeDiagnostic: VI1PR05MB3296:|VI1PR05MB3296: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2331; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nTQYvk32FftuO3QpfjBA+oR6jTOtNeeyvLwAfhcuFk/SB8jnvzKaHyn+/ru71mDaw08Ap1BIAKPksdGORUNhvz8rBu7WdjuON3gKX81ZKhtlN6YROOnl5qocQlSd4KyRISGTy+qrQPMC8HXetGlRXVNNHjy8Y3XiaoqDkEJZPo7jPyadZfNkPF2jntBJBNkJVmNFGhkRFjcaIFZnxFDFkQZfl5vocOkbUy+NTh/zZGizVApXQpO3P3OKcAJxmWuK9mwqpaVzaduHrnDI02AvaQfPO0yph7b/ihtxAVR6CqqbN6TBC54gilrV8vlG8m6+ABbd3WXHXIgJRC+yWtSHDeXZjEIJElz32yksNB93Mr03Ri9PNojs7gNfgFAUrZE0wplOMsHu/Rgg+CiuM/x9N6K0VqoqUdwgntqlgEJ090AibKxf02ihVi23AgzDlITE1fnNX6KxrqNmJSV1+4/fDjkpW1fj+vBIvxGZ6Q0JTZRLap3/S3n/HxSPxZ9LnQ3Y 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)(396003)(376002)(39860400002)(366004)(136003)(346002)(52116002)(6666004)(54906003)(2616005)(956004)(316002)(2906002)(478600001)(107886003)(4326008)(66946007)(86362001)(66476007)(66556008)(36756003)(6486002)(16526019)(186003)(26005)(8936002)(6512007)(8676002)(6506007)(1076003)(5660300002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: xD0ymtdqhtNJxEGHL2uLU3W/yLOGTtKvnRFHnV/hYKi7mThiHttIEudjCLhePVK7LslGmdkTnFp5FHtsUgzC/ZG9bKLZTAo0hlh8vbYKqXyxJIKW6H3VVYXqCvhYB8+WFLg5CSTr36YFss7iCt9ecWw8o8venxGbQnBKcMNWrjCFZSMmPAdNYPKOpU6g4DcVfn9QyFvn2XLPbqJ/g9eUixoZIbLnDaf3GWFsiUA1mDaF67rlgyfACtqymZ/1kSJ4AGosfZ0L5wXuy7F9ykicxpYuZXSpFwDnNbLs7T+JXOec2b2MLrDUwGIH3YOmnubcg52peF4W5FLcnsS8GzoJ+AJkEAR7s4tQhh+8vNRiItPIBhSwI2ED9mRoumpR+njGr2tP8RdqSOVRG4uBcsxl2Nvs/ZeQWQMcxhk9t5D021Qh7g1dFWi9a9yhqwRtdVvZoiorWBqjPMhhNOlSEXPZdDsrHM/qeEzb5qk/go9eGYCxpEMK84ad0azHX/Fpm/B/PpwbErDKYMcxk5JzUH5zORYNYnKZw75xG1Cnlo3HAVYsgJ2iUvivq/hNNswysRgAP1bR8E5wmVxeyJfcnNekttCCtTdMDW6kXPbcUWwHy6PUFy9rr/UGrl/3d/MVQFO3nPS7YEwGIJ2xnCz+kPA5eT6XrOFl4nj0CCnJ7RgIWsGLKyGGH+N2E+gkaRw9Cog7C56pge+gSVaBFrkirE0EkvcxzMY0dJYTi9JbHMWUq2EmeY8YuIKqF5WlOWCBfuI/IXprKTMcs1Te0h9cQB1sjqnF/rsyTfRzRhmLYDEk6xk= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f1116fc-503f-4143-0ed0-08d7ed2ad8fc X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:20:58.5189 (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: RFIpC8e72E2aWUWvzC+anTugZ8Mwu99fee0fKIIIC00JPro9vuE/1QRFwvi2Ls2EGa1SHJCSlP/hlagz9BhuXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3296 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Parav Pandit Use existing helper API to get unique devlink port index for all devlink port flavours. Reviewed-by: Jiri Pirko Signed-off-by: Parav Pandit Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_rep.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c index 55457f268495..2de54d865dc8 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rep.c @@ -2056,26 +2056,22 @@ static int register_devlink_port(struct mlx5_core_dev *dev, return 0; mlx5e_rep_get_port_parent_id(rpriv->netdev, &ppid); + dl_port_index = vport_to_devlink_port_index(dev, rep->vport); pfnum = PCI_FUNC(dev->pdev->devfn); - if (rep->vport == MLX5_VPORT_UPLINK) { + if (rep->vport == MLX5_VPORT_UPLINK) devlink_port_attrs_set(&rpriv->dl_port, DEVLINK_PORT_FLAVOUR_PHYSICAL, pfnum, false, 0, &ppid.id[0], ppid.id_len); - dl_port_index = vport_to_devlink_port_index(dev, rep->vport); - } else if (rep->vport == MLX5_VPORT_PF) { + else if (rep->vport == MLX5_VPORT_PF) devlink_port_attrs_pci_pf_set(&rpriv->dl_port, &ppid.id[0], ppid.id_len, pfnum); - dl_port_index = rep->vport; - } else if (mlx5_eswitch_is_vf_vport(dev->priv.eswitch, - rpriv->rep->vport)) { + else if (mlx5_eswitch_is_vf_vport(dev->priv.eswitch, rpriv->rep->vport)) devlink_port_attrs_pci_vf_set(&rpriv->dl_port, &ppid.id[0], ppid.id_len, pfnum, rep->vport - 1); - dl_port_index = vport_to_devlink_port_index(dev, rep->vport); - } return devlink_port_register(devlink, &rpriv->dl_port, dl_port_index); } From patchwork Thu Apr 30 17:18:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220173 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 CA288C47247 for ; Thu, 30 Apr 2020 17:21:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3ED320787 for ; Thu, 30 Apr 2020 17:21:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="m3md5OUh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726877AbgD3RVK (ORCPT ); Thu, 30 Apr 2020 13:21:10 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:6237 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726355AbgD3RVJ (ORCPT ); Thu, 30 Apr 2020 13:21:09 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KGwRfZhLxemXn1+fJzMkuVv8MHk73oNAPM1cRRD/gSyU+TaFoFUNg8O+GaMwSS4ETQC8mYwvQZ7jK5oRk9swfT5c6VrkvSmUuqRY3HiWEy2m3seexTjn9JJ/tRWW5HcMxThXtbP6BfW6R063J1Nne1U9meeYCi8tJ5Q1JlXTKXuvYvPB2+Z7sAyQ1wxdPpzLso2rxc/WTdbTtTZTrG6eLvYQt7/GWoPysI0XDY08ahe1Yv+qoLWzmUq4ghhGNa66yuErNIethTPbv16Q7RrueL2vagybfDwlHuxYXjDyjKPYARAxvCyrUPAtJI3dIh8zFZ6i5Du+7yeFwP/ChEf31g== 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=38agFz43c1lcWebIUJ401ta8lHb3mEONUeHc1P7iX4g=; b=Pqlk/tGqqDP2jM7b8opjo4ajigEDbRt28xIQ9BIlFvtBhJWhCRChKQXCSrfDM46OXGgpRr+3xGaAl/B7PGZQspbYfHBjb3RImyxLhpzCkEJa8I+jvF7/7SWI8fSocURUzMmOONJvbe3usPMGjtzz6OI3+qAgXa4/UChRYh/9amu5k1N8//oQ2UDAqTA/Wt2egoQi54wwo2bZzgmhm33bE5J2cRBWfv+hVmLc08YlH6Y/onMT3o+5k/7tYYwugyhX+Os+uVIWDB+k0xntUhW6y7PKhBYYA/hME94IaemaW8hN0en/xDbCkNwdMbTD2BNOlX/cfq4I8Dy3Sdks34yfog== 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=38agFz43c1lcWebIUJ401ta8lHb3mEONUeHc1P7iX4g=; b=m3md5OUhR50vevrYcbom9R4q86+8mwSSycAE3WZko6igoZHoxRP/qE8CM+5HR+j9ljdV/ARGgQYX9eV7aB4rcVAQgtfi0JbURYI0uJdQkjXNGAXp/86Ry1z73nsp3Vi97f4VZz3v0ZdAJva6Xc5+6TDUJpbN0NoufRuk5Lu6fvk= 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 VI1PR05MB3296.eurprd05.prod.outlook.com (2603:10a6:802:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:21:04 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 17:21:04 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Roi Dayan , Saeed Mahameed Subject: [net-next 04/15] net/mlx5e: CT: Avoid false warning about rule may be used uninitialized Date: Thu, 30 Apr 2020 10:18:24 -0700 Message-Id: <20200430171835.20812-5-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430171835.20812-1-saeedm@mellanox.com> References: <20200430171835.20812-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) 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 BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:21:02 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: dc01d8f3-2b89-4121-39c5-08d7ed2adc62 X-MS-TrafficTypeDiagnostic: VI1PR05MB3296:|VI1PR05MB3296: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:431; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uvmz634s+UoAs54rMu5NaNmzeZsAQBCxh5B8bcYfmfhizCB+5hu9nOgyF7VE6eEXiVM6M5eTlZwelNhekrpxSI6msfrTWUKz2YQv60hvbOcrZ0lLCYZ6CXpbQbhijZlwN48bbB+636c9lDoHrWIL1sIKvCNJDOud3LGkylVIkvmkobN4lhNuY4ZNB9LuIgQRQbRFFl6lWSj1EYmfzeMVcHHaRzq7pQBUyrPay6PVaagygC/163eByB1fXBBcRao/JCvnD8rdJ/QqH85r5+2FBVzj58HJqfZWNzxnjnrRHVISBkbhuHMoN106hVzy+pFuyFn7Sw07LjiRvN83oSPEs45Nhku1MdqqkoK7JME8JXW7gq4IFR18zdjcrUIaujOmhYrnra+fn8GI0X0lVuzKKmQW6ZJ/x7AGeZRsNUmJvmIbbwq/9mettK7gdp7GI0vLL5DR1X7cQ7/L56VC/AFTeXv/wozQjHwyWYdcbWh6LcBy3GpVzIJ379sAhu511MkS 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)(396003)(376002)(39860400002)(366004)(136003)(346002)(52116002)(6666004)(54906003)(2616005)(956004)(316002)(2906002)(478600001)(107886003)(4326008)(66946007)(86362001)(66476007)(66556008)(36756003)(6486002)(16526019)(186003)(26005)(8936002)(6512007)(8676002)(6506007)(1076003)(4744005)(5660300002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 5Uc6yalkHRzSDgzqF3M9kkTytFq1VT+eXJ24uJJT2jbTBxcY0g/M12hAKi0ocvgv+WciNlT3p6gYdEHvXYlYCe+GnZlEEGN0rWogUhxrBzS1F/d7XFr5CyqHeWaIxLds2u9cPgzAtwm6ZsTXg5f7+iJiUm1GrgHsbM7fqmpMFBLVSlGA1L1njYr7Ns0zMb6xHon9Mat7R5ArVOOxV23Pp3KM/bLbFSH65B45MXMSzIupYXojfe+3NJrxbCmPHvf3K6ljiu71wKSY2SH0DTUxgHKQE76VRLrpBJLLrFsnAcQwfiU635ShZhFAU6kSlVm5/aduRIvqVAYJHZoU8nCe13Y/b/BS8XVLYtaKMW4j5LuWPnYmfE1qbIFPa6zpjr1JVPC2Z2QqBM/HEmIJ9xe52ij/qHq+tCcPmgGSB7jJ46MzUhM8QTHRNoI8dWrubAWcDCAPiXNeZiu4S8ZaMK3Tu8nG6AAz4A9xL2rFR7fNLFlTISALQc/ECV0Anjs5c9vXyJaTtCg9jBKAVCNq+C0YZNKhS0yEyTc/TCyY49lDa5jfwbJBlqjs/MZDXzPaNf2nLukzMhddS7a/5K/KhQCeVpNqoVmLSZw+qazuNLAica6Imxxi9SYfoi9s8FUuimG/zeEw3BC/KWmnQxdfbZXuouBVWOmQgTz1x+gqQjS/RbquMRjXlBbtlV9Z73RK38gJqezZj249H7+Q83d8x2ijO/VihkFyjE258s2hFhe5sVE0L/DYQr7lwjw5hCC7R71wKU0XcaLNvWr+F5vp56Wb/pR67HEXJnxIFrlyyuohRlA= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc01d8f3-2b89-4121-39c5-08d7ed2adc62 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:21:04.1766 (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: sBYEB23RYg90rsdUelqjBtlT7dNQW/J4UTLJhtkcqO3CcONV/Pi9EwOkunAFpGr4oeg+di5UewL2aTCdlMpelQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3296 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Roi Dayan Avoid gcc warning by preset rule to invalid ptr. Fixes: 4c3844d9e97e ("net/mlx5e: CT: Introduce connection tracking") Signed-off-by: Roi Dayan Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c index 77b3f372e831..44f806e79e8d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c @@ -1131,7 +1131,7 @@ mlx5_tc_ct_flow_offload(struct mlx5e_priv *priv, { bool clear_action = attr->ct_attr.ct_action & TCA_CT_ACT_CLEAR; struct mlx5_tc_ct_priv *ct_priv = mlx5_tc_ct_get_ct_priv(priv); - struct mlx5_flow_handle *rule; + struct mlx5_flow_handle *rule = ERR_PTR(-EINVAL); int err; if (!ct_priv) From patchwork Thu Apr 30 17:18:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220172 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 65BFBC4724C for ; Thu, 30 Apr 2020 17:21:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E41E20787 for ; Thu, 30 Apr 2020 17:21:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="QH9NOwKb" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726906AbgD3RVR (ORCPT ); Thu, 30 Apr 2020 13:21:17 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:6237 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726355AbgD3RVP (ORCPT ); Thu, 30 Apr 2020 13:21:15 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SgiHtfHAWt/chHfR+I15FhhxYH6DT2rMEygkHTRGsL3eG98g2Ln4ZkbwTy5y6AfBIiQWoBzkQ59AmTOiXg/3JyBIa7zlnm35GN8JihhcAzKmjVXtGrPw47ezU/Nl9W6ReiRNKMvnihkiOMrylDRTS2Okxr8vlVsU3AZgzSD9HUYEw1Vde4PsSQhMMv0VZT7BKM9Xp6H7/m5BW+QuGLjZOtBOMLf8NzvcI/+6RgFKpJ0pSfmm/2sq/5GzKwQbgTXxorCdyBj7Wd4JmDUcG1UlHa+WfBL7pyUG62+8nhFWoObPB5YtO0zuA+HNHiMP7yLwSCgKP/SreNjB66pQv68Yjw== 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=iDP2bjbpUQnzq7GHXBTPn6hSvWxMCgs+Z1Cru7QtM6o=; b=ZQt8SO85vUjynbdt+5eDGuBGNorK99QdA5c3FtE/GplHnWBjHHGPA1QLSJ00wV1ADDv/ebuU+14YwV/5u+X++yXH6a7Z9hxFZJW3C383gE2BBkgQrFL42RCd/3wt8pyfzjtQGfA81kJ6eFIKAl7joZhX4Hj/bAg+OH2T0Yr3qP7szj3efF2nEDny5fxnSxsaYUg/gNYlurWQJtfcqmsE06Q5tmKCCI+p41VyTq1XeHgpbrC1x0GXMBelFPZB0VqhNtKJwvxmcho7l7sn+VplexjdvNNHdBHQIfPl8FfxLvrsumsufWpvAbXyFCbnl9liSNEwk9IR67XisFU3d7r+AQ== 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=iDP2bjbpUQnzq7GHXBTPn6hSvWxMCgs+Z1Cru7QtM6o=; b=QH9NOwKb5PcZiFlUkJCNq6isBKw0YqbpKw+2b4cykXG1OKOssOEKQmd61ASmwK+vQ2jfzQ9xahtDziyvmbsZaxiHdhCoO9jWA1J2G5Zv1yEaVdaQveqyHcKho54Oy8tMGQcEMn4q89IcTwRlv+XXt49D5K1zNMSR3/cVKV332x0= 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 VI1PR05MB3296.eurprd05.prod.outlook.com (2603:10a6:802:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:21:09 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 17:21:09 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Tariq Toukan , Tal Gilboa , Saeed Mahameed Subject: [net-next 06/15] net/mlx5: Remove unused field in EQ Date: Thu, 30 Apr 2020 10:18:26 -0700 Message-Id: <20200430171835.20812-7-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430171835.20812-1-saeedm@mellanox.com> References: <20200430171835.20812-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) 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 BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:21:07 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 33e14195-e38c-409c-2e44-08d7ed2adf6f X-MS-TrafficTypeDiagnostic: VI1PR05MB3296:|VI1PR05MB3296: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2803; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ymCDjHHjB257qsf+V4BRueZnq9djpabSAEGGAypVNhIjgMTHq8fxj5yHAX2PlhhtojQMZPzbf/Hwbq4rv/YZXuaAyLgLTETZHZZd/4rUkJZKdNi5QJf7B59lFUx5Xli9jOPdoUNd0dh2vYWSWISecReNIc4cylwj8s3j0RI/uX/NmxaM//vXxcnB9gMM+WLYIvzo1Vm0APk+SR2+AcxJa0Lsw/7R4VdSC7TOh2/MqqLlyZUwS6AfGF8xU5ciBha7ISZQdwIdn/z+lqWDxEkHKUX29KtTB41+Co9/UJJp0k4Lowc6IgrvYxTZBA0gPnqHyKHENOUD2C8+0/6vR+zJPeUywdJlOSlsC11C61OFIZCS33VOZZZ+T1NaPaRGBuWpKcT2gxMDLp+R/aLb4GgjZ06XGMOE7RbiAGYK8ZxECb4fPgZw7XdjpJxiVSU0Aq5kaxR2a6KNscOnph8VvgtoMb+h4Z8+omdidKul8zYv6Yhtm9qZ3WC7rZ7ZV9t+S/qb 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)(396003)(376002)(39860400002)(366004)(136003)(346002)(52116002)(6666004)(54906003)(2616005)(956004)(316002)(2906002)(478600001)(107886003)(4326008)(66946007)(86362001)(66476007)(66556008)(36756003)(6486002)(16526019)(186003)(26005)(8936002)(6512007)(8676002)(6506007)(1076003)(4744005)(5660300002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 4I1AaTP3u0KvEXHXr59TW6FGHVAvSStZjb7kKrjbRgmnoDWyGqVudeoSTIVf19HMTgF4dn805PByW3zhL+ISZ2cRDUWqfbUrPRjSYOTQdpp2Qot/BEbGOb2DGDyS/FYrahX58+1iD/GmvcVbp+zGenhzEIAcI4YeEjrlOoBRVp/wX3gnHCCTAiYo4/Xz1zJyfaGEp5rAipd/w9WURP3pD9lXcXZvD6US28GKlL9eMU2I5bVcqtBM1h3kNLn6hXArMg3xd5vNfN684VaayzxnKnMXvbHiq94vFT+mdMFB9CiWGRkcrJqnSeufdgyzH07ScncD94vriQ5X1KMnXxyWlnk+O1c26CXAmDenGXBQnXGZVdY8Cn9TiM2UBxp0/vZvQsqCqntAikJti0/j9xRI3l1MV7Dc1ztAme5PPz23/kW6ZDEZfGECA6R4Wdyu1mqKE9gg5waLz9gEuuSaGd2p0Tm4cfuamBbCVcE+gr+NDR8c/4YAb1EqAdAd1o019AqpolAfc0LGMVoxkaLhUT61Hm6jRe0rKvXS2yjf7qawEUa6rqTq+bRqtOrCzXVYNBzD2M1I7vVGHkFgLOpU30wRwN9yjU0izSM5Eh85LZQznLXxT1Cv9Q/MjhE4VX2QTW6KFPQCjgeoFkzt1CD0stURcHuhTK56cuOk7TqJr06M3SrPCnXqm8/jqy1gvgHtXemmN9guSYp420MBH5fdUUtNaqde3h7VqkyiJX5+01BqaqiDqVb6JhMXO/aRAG/EYv7qQPaM6do1ga3Fljxqh/fDZz5AYj3p38FnkaqE9ZOVNXc= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33e14195-e38c-409c-2e44-08d7ed2adf6f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:21:09.6205 (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: Ud+w0igL+ZTjEDUONuQbi/agG9dVd5+lzWjD8JLNg4ZvOSamJPYAEX/pfrU0RMOT+mkPR23M1BE8X6NKr/qqcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3296 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tariq Toukan The size field in EQ is not in use. Remove it. Signed-off-by: Tariq Toukan Reviewed-by: Tal Gilboa Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h b/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h index 4be4d2d36218..4aaca7400fb2 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/eq.h @@ -27,7 +27,6 @@ struct mlx5_eq { __be32 __iomem *doorbell; u32 cons_index; struct mlx5_frag_buf buf; - int size; unsigned int vecidx; unsigned int irqn; u8 eqn; From patchwork Thu Apr 30 17:18:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220171 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 A2157C4724C for ; Thu, 30 Apr 2020 17:21:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7ECED20787 for ; Thu, 30 Apr 2020 17:21:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="fOJxjXVZ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726928AbgD3RVX (ORCPT ); Thu, 30 Apr 2020 13:21:23 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:6237 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726355AbgD3RVV (ORCPT ); Thu, 30 Apr 2020 13:21:21 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iwI0dc7w2x+njAxVkPKmaLguBg5qFfuTyG4aWEdG2A61OY6wYHl6WSVXSL6izjmkzaaFCgj9U8QKo+gGkrZxerASm6VR9UBfuQk3CR9zVbTW7jmW/jl32K2+/RGMbj1RHvCsy/JgKN8fvkodO0Nm4ffxD+j1GuejLjnFOI7YBJu2Qb3+6rDS65c6X1kSuF23RD4BM86N/WqnWZqX6m77GRVnGS60lhJhBz+Wkh5W0JQVF/BBwMXGQmsf+PD6fo8P0KAj2f2eWxSDAWEBm/ao8fMvzvMEix5TfXrt4NcvqTo5E9OgfXaO65rZwjIQXWhQsckgTPI0zSj9G0TlktRsyg== 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=pjcbVXsiOGdAoF/LPxqkkn126veB53sZvBezn9nxx/0=; b=cIs/Su8xU4MLHJQykT6OeCHAhaxJv+KJ1CU6xlx5UjopCyJn8WYKiiZcE9fvrPCksWrRfLiaI5nGWVMFKxeVF+F2SuqWC+E9t2zaAtXQGYT9S9hOpVZLWjwx6A88grq3yjuXjkA8+JllUCqrqCnp/D9hfGom0FiuJK70FlvDJ5SahMv2GASXmnn0ZtNLhY8V7UNHRDLjPM+cr8mCR3GRHMeIfrRHB43evf8v7yFa159M9oAt4GlUtWY8hloX2dVws2dF8cIn93cfJdjoKhHdo5gziJATIPRGy50/xP3lva7T5LBKn0B4UcTVGsyLhF3rkARenGIyq1AJaJTvFW2CwA== 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=pjcbVXsiOGdAoF/LPxqkkn126veB53sZvBezn9nxx/0=; b=fOJxjXVZgh6mlT5Jc+pzATvaudcmaau402dVnlZfCXowxvvB76hzSImqjCUyzq9VTM9WIkLl7pE16XTqlAPQEp/w+95TZ/Fo864ehlE8vUO41DFXXQF1LM8u3yNN1wa+i1UZC3UQ4nUHGhi4S6uHrnnFuC2Qd1kXtcVKtpTDkR4= 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 VI1PR05MB3296.eurprd05.prod.outlook.com (2603:10a6:802:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:21:14 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 17:21:14 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Eran Ben Elisha , Saeed Mahameed Subject: [net-next 08/15] net/mlx5: Rate limit page not found error messages Date: Thu, 30 Apr 2020 10:18:28 -0700 Message-Id: <20200430171835.20812-9-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430171835.20812-1-saeedm@mellanox.com> References: <20200430171835.20812-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) 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 BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:21:12 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ef699242-44b1-4c88-434e-08d7ed2ae21f X-MS-TrafficTypeDiagnostic: VI1PR05MB3296:|VI1PR05MB3296: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1284; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AbXIttonpBsCkv7GuH0D9sasOVwf36V6f9rB7ajv4YOmP3+zGvCMRNVH+9Y2+U3ax88pYycWMMTrRCWMYGcitMkbVEeEl+q0FlgtT6TcX4T4pVL/RKEUlC++K63thze7NF9QyaTfUWIrub0QPgTjb/YQwemviGvyx0hMnyN6ssesnDpipcG/kER1LrN1cEYMcW+cXBzPJ1475lxLlzxydTaU98QtqdqAtBp6JNy+uMTkDJv0NDlN0UBfkMfBojvkRm2kA1hX+md3AS9rJELQ8KU/VL5Hj9ZM91amhAOEPOYyibeTO2N1fv/Vi3ngW7KHKReDg3WNObxmCS83q4er1MmqnIGh+tGXoWAhci3ZULlobyPa2BYvG15VqsQjcsRHZgmMECpLCEZFgJqwnJrS+B1xTZw/BipTL6UudugKsfQv1mjNa25P2MDB1g2I0GihammierheS+qKrcOlMNqy6rWnBVq98e61xSxQVvlnyrYuX+paGiNTctRtv6ntrdi3 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)(396003)(376002)(39860400002)(366004)(136003)(346002)(52116002)(6666004)(54906003)(2616005)(956004)(316002)(2906002)(478600001)(107886003)(4326008)(15650500001)(66946007)(86362001)(66476007)(66556008)(36756003)(6486002)(16526019)(186003)(26005)(8936002)(6512007)(8676002)(6506007)(1076003)(5660300002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 83f3io+89uzHT//qWbKPW9c/LqU0fZWOEcgY3SnT0QBpXB+t/C5eIzWWBB/d1Ak3yLDZsTz+OP+E5oYkaYte2y/pwOmN1cKE0G47h0JBjXobTRE1HBXXN4TOwFwDhH3l4wtkv5PXRPzvdVC5IlwfnghLT0+WZbjr3j3D5bjb++4g8gCWXmnWecqgvP/OdBbyzMgKchJ6UWI6iJwPgSiUotQe5SCjmiZBwK4u0Ja7+5VqTxeW39YbHgfOZlE3cO4RpkPEbBfUdLAkVJcQbvCTaNh186ximBTNHp0i2pKiC4fZC827PM+cxAdsv+VaxZHS1Gc5YayRvTmD7x9irFXSWAvW5hQ+1YxWl5BS8lv7TjATw9H5aLjKT9YTPAvQsqWz6DIH0+x8z+COx7680bdkOYdACne6CSGytVuhG+rmSkW8NHiasPVgn5zKh+T6raBrWzCdZfC/I3qSRwIyWxlA3u4+KObH9p7tbxtRsOcWjn8i7tNQbkNYkb1ekg4WMMcPpnR/dsu7hNurvaKwtMuNiu+s/mPEUhPxOYbGuZyzvci/fnHV8FRXYvd+MJbi70H7cdzviiSHi/I4GTB+3x5HBFzBpXx5DxJydlcSq8OQpi7+GkMhZyWziwMpBpTD+s0UxOonpFnBQq0uq4ZkfQGCd8HisNbLV/Dq8rmqPmigKVNEN8vNMOv00CrFctuPR9WBoqTkJpIcSUPvKqcngmDRDZybvi9MhrcB5/xvBbsdnSot809jUbpElPjTCkEfHkOCwNzesA+x8nck7ePlRyK6cy0nM10FpyXIPK+M21OlaFc= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef699242-44b1-4c88-434e-08d7ed2ae21f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:21:14.1909 (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: IvTxOifumw/ejI6mdeyFP0IdI3BRGbsKYhcBFYwXWyfc/s8qRtMcEJl6XcknuepRNa0furje8P71Knisj1J/Uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3296 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eran Ben Elisha Thousands of pages are released with free_addr() function. In case of buggy sync between FW and driver on released address, the log will be flooded with error messages. Use mlx5_core_warn_rl() to limit it. Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c index c39907c641a0..c790d6e3d204 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c @@ -206,7 +206,7 @@ static void free_addr(struct mlx5_core_dev *dev, u64 addr) fwp = find_fw_page(dev, addr & MLX5_U64_4K_PAGE_MASK); if (!fwp) { - mlx5_core_warn(dev, "page not found\n"); + mlx5_core_warn_rl(dev, "page not found\n"); return; } free_fwp(dev, fwp); From patchwork Thu Apr 30 17:18:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220170 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 B5F4FC4724C for ; Thu, 30 Apr 2020 17:21:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 937F220787 for ; Thu, 30 Apr 2020 17:21:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="gDmadrDt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbgD3RVa (ORCPT ); Thu, 30 Apr 2020 13:21:30 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:6237 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726355AbgD3RV2 (ORCPT ); Thu, 30 Apr 2020 13:21:28 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LTUrwbt7qTCr0WIgUI48Ca8rCLCAYIqiuJrp/o8JZeKZ5zyz7mQmZMO1fxt8YCGJoVcsku3O33UCnH+eP6GM1Q3qz2EVCqJQFC9PNpVcL7uYFZTsH4FRa20zIrf//fYldaqXfodloVp/DSYtYjr3hdTzXUmDw6ODq1NvT5VjXQ7H1eUytcKuSn2A9ffR4kGULXzzVI8+qEFOu4cNBL8Vcgz9GzVzB3bSujUSNER2WGm1GdmlEoW2GO+lA2fajIf7oLfC38heiL1GsCeNJSubSeSjHsB6RZ/dAwdgyGtBunDnwLR/AM9+O+B9MJqYABvvymHfxrx9VfWuaYOgdg/jjg== 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=RQFrRT6kRr5BGj6OXXqR/0Lkdh8qeDl45jgeNGVHQcw=; b=Km9Ew9YLL2qYs+KezXN9ePaL9eLx7wJQuO9VZk49ARnr2hEVUPkaa9Zkr46FPPpWvIAoNlN2HcCdSdLwg7eUA6lLmRqbWG7lk/Xi3TqZyWkKcwDBgV8EaU/BDHQpw1tH8kNtrCw8sNL6NDshco09H54hS4TEbHWHhe7WNMcCq0hi8Itrt1SO6VfLMPW0Jb/Git4cHVHdmGyxf3cQtk33BDdP93ysTyn3ly9KgfgpAXySlUZxyfwBK8C7Ol4OV24nXbHgsSQOqK6mnSzL3qjum1nzc8I2NYMypAOpjtD2zgV8vKyLqTjEbXMGv+BKJC7Xe973o6WUEyTUzFDkCSxFJQ== 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=RQFrRT6kRr5BGj6OXXqR/0Lkdh8qeDl45jgeNGVHQcw=; b=gDmadrDt7iLP6oik1Ou3I28CGxOqPbeVt9regdIApkFQCEBvRbz1VBvNpdlf2EYQBc8mkB1X8oueVzS7f8jfQBRsmBhSLy74VKvzMENUEO2kyXKY/qcl84TNejZO1sm4WjYuRsfwwneQlWm7qkgtmaHTY5MXFcEUzV4yIAvUhXA= 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 VI1PR05MB3296.eurprd05.prod.outlook.com (2603:10a6:802:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:21:19 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 17:21:19 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Tariq Toukan , Maxim Mikityanskiy , Saeed Mahameed Subject: [net-next 10/15] net/mlx5e: Use proper name field for the UMR key Date: Thu, 30 Apr 2020 10:18:30 -0700 Message-Id: <20200430171835.20812-11-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430171835.20812-1-saeedm@mellanox.com> References: <20200430171835.20812-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) 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 BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:21:17 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 7da36791-9322-45c0-a210-08d7ed2ae54b X-MS-TrafficTypeDiagnostic: VI1PR05MB3296:|VI1PR05MB3296: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4714; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VrbMUv9DXZP+i+cCatsDC8C+T1jvrFkUPU+62gydd1DodMPozcUnU0aF97hvPjCwwlFVBoX7sPwXMyQv9AHSFH3Vo54FI6oujNBPdNXArNiLsXvR4C0p6NabWYULhTlzMYsTwFYFQi8gAeFEAgSFmocV6YvOosdM+dOuERI2XhEnFnytGm72llMTr82/3Fojshd54XeqxvcypOZpZ6Kxm/rWbZXxK1HVIWeYIhFt9b7KyJkboZQhRHZufa7dFawVdXVoBJkTPc164pNjI2mMg74e7vIbnHqciKC8N2I5KXtb6g+LWURs6VpOqj4mNjJqwLG2orSbAd7yQklNjtaLx7+Xu/xBW0nJq2wIg1tgHsydYr3Glys4TdujiRTVT3CIU6T8ypyi51y5DNwiEL5kWk9cC1XWKkJ9wENvl+tXHUn8EDhYI/TuGqlKl9AlPr7oN9qu+7xLCfKxdb7qW30tY8+EuadzqrVDiylKRzUVrHNNWgotzNaIC8pk1z/TpV8E 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)(396003)(376002)(39860400002)(366004)(136003)(346002)(52116002)(6666004)(54906003)(2616005)(956004)(316002)(2906002)(478600001)(107886003)(4326008)(66946007)(86362001)(66476007)(66556008)(36756003)(6486002)(16526019)(186003)(26005)(8936002)(6512007)(8676002)(6506007)(1076003)(5660300002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: hCbZm/QlshOk5LwUHgUFs25eil/Ktgkhl7fcR7oP1QC3NUpHRV4kDJiwuz79JL88xJUsGH5U/H6G7N4tCGPt5RgBAerSnvYf5DRPy4fe6tgTI0t0HJTYgPkO3XO6ixa8ISUo7QxrXQJ+I02VMS/pA2q0mRgTG36iy8+GE9EbaTXOisZJpd1ZUWjufyqmCDvAqJl5VnRX0OW+mt2SSCa2XBlzSkre9tJUfcZukUqtkTRgs7sNpguSrYIQCmzYT+LtUy0/ozK2xEmGTkfKZIdX7NWaldGSjz+i/vsT6FnTMYWWkLUnvkoEvjLSuvJ4QoOPuO8HIfCtvpbyCjYK9Y46DhODo3gmSWBk05d3QQzvRFeCY3srOSKozA+B34xbViCDebjgxCFq735i17Rd+OxsZEUkfOwdSHzjtGOr59ktfCFnZoEKGR7v1jzGKtjOtpfrOkeDpc+IuFgoDRQbbcaDdW5u+qMGKxQPm3QjZspR3R29NszUFyKL/3IFZstvJBo3pmKtjQttk8Yooh9Ke+B0vuSA8TyKVmzP3Lrn7xc3hrw02frCdhHXsYdG3hoQmcoMu5aOVcUfnGgZnyj/TN1VWf1zSEcpnFzDC3IFboRKV4zxpb8SuTRw2YPmRyoOUYIb0GgBRW2soSgS7sPpPXikOyRZ21NZqlj+iYAUCcVPSJlqOYEePTVEPpQ5MoVdNnyRXIMjSznAieFgGI8jJ+rW7okUlV/lWvvwgyM0hYzpuSvZLjx/bt03GhAuXnc5Tw0zmONrKKQ3jW2rsU4jHQX/eisJmg13uuIQA6rs+Qs0AdA= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7da36791-9322-45c0-a210-08d7ed2ae54b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:21:19.5798 (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: kz9AnXiNHUDZ7j2Qh8m6r8VBXVahOTAXeAZuNnhDpj1KQQV3uyX0fQ74bwhjAs4i4EJpgzgBiaA2TNM9mRHJVw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3296 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tariq Toukan Even though some of the WQE control segment's field share the same memory bits (a union of fields), prefer having the right field name for every different usage. Signed-off-by: Tariq Toukan Reviewed-by: Maxim Mikityanskiy Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c index 10c933e5da9a..bf3fdbea1074 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -233,7 +233,7 @@ static inline void mlx5e_build_umr_wqe(struct mlx5e_rq *rq, cseg->qpn_ds = cpu_to_be32((sq->sqn << MLX5_WQE_CTRL_QPN_SHIFT) | ds_cnt); cseg->fm_ce_se = MLX5_WQE_CTRL_CQ_UPDATE; - cseg->imm = rq->mkey_be; + cseg->umr_mkey = rq->mkey_be; ucseg->flags = MLX5_UMR_TRANSLATION_OFFSET_EN | MLX5_UMR_INLINE; ucseg->xlt_octowords = From patchwork Thu Apr 30 17:18:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220169 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 CC315C47253 for ; Thu, 30 Apr 2020 17:22:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4BB020787 for ; Thu, 30 Apr 2020 17:22:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="j4HgFbSi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727067AbgD3RWI (ORCPT ); Thu, 30 Apr 2020 13:22:08 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:6237 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726950AbgD3RWH (ORCPT ); Thu, 30 Apr 2020 13:22:07 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oZxLwJmv6REiqoksBiGhoyFo2GLZUR+TBgGN3bFG2wbfAMX9/mf7HDwZLyc5dGUYjDk03+3CAHVIQKTO2vkUWpCpCmX8EWynL3XJNMHIFdTeMI+pPlmK7HiumCaLEuRptnXD+8re8HDKHzQDdEPUJwG4WeiM+9eGSKeFGSuNCwgXJMcH5KD2JfX25HmhAq2h+Q29lN1p0gMJLsQeGECMcX1OAQF94R44oLMOwGlwGO97NZjJ12/HDLOH3ecPq9TZkwzHH0PVs3hWDZ9AS3/tddAkQkP24dNIEmefHTeK94hgMVGqbhur6UIshuPrwOZVec6BSVZVQR5XFwLGrmZ3iw== 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=aCcJ8+8Sq1LsaAa4ZyLUNxHHcsXxxaOjHU9rIBH2zwI=; b=NbxpR9CbY5VWyeRTv04Jap0PG3oAy8hOU422GVJ8F6ZJHKw8Oihqw/D2Vu413JU94LVLF6iFNQaaxcBQza+iq1GTGRkpTLNrnDYQay9NPX7RobIxc6Yr/Ffiqml9gfVL5lxodOBGwhGGeg9TIOfP4OLgJc9WwTzvoBYDiqM+SFuTbyedrjKTn8Jhav55TPw9bYuO2syJ/DQ8w5zolaOpylwK80mIrKvLiSNuDJNToOxaLSnU6D7V9fABKIe2p/FIfWDxbdBX8P+PlpJBRS7vbA/anlb0t9KxhIaBjRd0/3/f/bFZv27Hgj4/X4L2okX1CuINLqFoRw11TnEacRcvcA== 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=aCcJ8+8Sq1LsaAa4ZyLUNxHHcsXxxaOjHU9rIBH2zwI=; b=j4HgFbSi1x/WUDGeulIeHQI79bNberdp0HRBZzzD8rhF8KN4vtVolS9Ru8SN76zH+Nh73W2YKseLI+u9BbpqDZdVeTdIp0bFmN3gw96MoqFrv9AhPDke0lHXuRHHg36e/AoECDGPTD65NAhU7ltmRu0+4p8s83Otn41em5qGmHQ= 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 VI1PR05MB3296.eurprd05.prod.outlook.com (2603:10a6:802:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:21:21 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 17:21:21 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Tariq Toukan , Aya Levin , Saeed Mahameed Subject: [net-next 11/15] net/mlx5e: TX, Generalise code and usage of error CQE dump Date: Thu, 30 Apr 2020 10:18:31 -0700 Message-Id: <20200430171835.20812-12-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430171835.20812-1-saeedm@mellanox.com> References: <20200430171835.20812-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) 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 BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:21:19 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 28c87d05-9b87-4734-4bff-08d7ed2ae6f1 X-MS-TrafficTypeDiagnostic: VI1PR05MB3296:|VI1PR05MB3296: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3826; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: udRc2opXT/Rzq6s6zJcTDFbkH+RmtxFcasxjm9tAhZ2Q5tbaU4KZTFw6klOzVU9eHyCKRMWQtalwmuSWdTlQ9xRYziymEg+9KGgjCfHNIcW5hCYNW6Xj+4KDU/Mrd80ZmHeHOw8A9xmtNm7QR8ruUp+jbLKbEfYEWeZIc8sOWhpzrD4Jj3DNyOYhZU2R5fdmY3aY7qIltDocrYvBPKiVtgGeUq8HB+6+ctDsBi/OZ7s/nVOpxM2wKAUS3Pj0UwGeTgIQ7YlZP2pUqckTTMeQ502GhqXnyRbMGc0XhvREAXaQY1TbRf4kuyJv7UInyhbp+2qiFNazBJtpTXHUWwm6arEaN6AwOoRqd5Nt71cs9yCaHoVOudNXZsBCLqUIE6V+aGjRkIyyzcAlCmS6oYrT+36xle01VPuCyZejdef01YM7AIkFcxV+WmJ+HgwnbU7sD8wKxEskForKYxJ+PTh1EhOOwhGNccD/CUCaLgF2Fct6Gi+RSsSJ3DbcTT2+Twpk 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)(396003)(376002)(39860400002)(366004)(136003)(346002)(52116002)(6666004)(54906003)(2616005)(956004)(316002)(2906002)(478600001)(107886003)(4326008)(66946007)(86362001)(66476007)(66556008)(36756003)(6486002)(16526019)(186003)(26005)(8936002)(6512007)(8676002)(6506007)(1076003)(5660300002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: aP+5EJyOLOAa9Bz52FCTKKFTkGpq13Y96xjDDUY4E3WDoHgaGk7O0zuSiRdeXOthS5XZe6OceylyBoXgy6z4AN1ensz1cKPmPP4zNpVOcq6WYeEIVsxLQ2lmpP8mi4k5jIRVHft/pH0/HaA0jhl6kN0ofafDopaQBtblI2C+f6Ajv+6RyZCadipa+pbjT4c+XSkjK4mdR0XMV8VI0Z4jP9AYi7gG1dh8HndvQd1IwO2lCoMZuWuGBaWlKE2MSgjXxjpKFuh8kwa7k0AzzeIcYYq0zAZukHBB/yx1Kt1J9Wmid77sWScffHNQvw0fzBQMKZ7lepmKOjOP2ENXdWMY1/1AAaSWip7afVr6KmzHEnVjjQ/xAdrngThC3Dd7boYgKl0Z3g1db+r+0U21i98Z88wzr8kj+mynyGZzDe3eRsSHehQHU0IwKDoYbX+CcdLdGLoOklel/RJ9OtdSEsPcMA0/NzbOsAYtbIw0BFH3fErtxXp8V7shIJ8w/0+uZi7qwVt5ktI1otRbcVnGOeW8QoXE0OvGQGvIbmQidZulisdN+H+puoRq8fOJJkKGC4I8ZtZJD1/U2qjJ4lIDfOjLojO7i0pRJXIinBAV69fVDxnVbXqocGw4nznm7Jd2pFQU5Uzjmj0qiynFB0k84MM9fuTJfFFxMQfGvp5aG4ySMv3N0Lz+QoFYudg3Yl7jDGXV0DHpCZBH+eQhkTSbzz1rUICVdxozL4bXYRLO9PHTz8vSKCNQT4OnjpkHVh5co2PmEjbF+zt0ZjSbmBSYLmRaTolWwdTT08y8IKdBaOtqQP8= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 28c87d05-9b87-4734-4bff-08d7ed2ae6f1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:21:21.8135 (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: 8cFf7faj0kswqI4PTsQKZOVnkO2GJe4SrqRSaEBdPrkgUI6qyRi4l0goUxJcHkEnkorE327E+rpFUImnir2n/A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3296 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Tariq Toukan Error CQE was dumped only for TXQ SQs. Generalise the function, and add usage for error completions on ICO SQs and XDP SQs. Signed-off-by: Tariq Toukan Reviewed-by: Aya Levin Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en/txrx.h | 16 ++++++++++++++++ .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 13 ++++++++----- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 2 ++ .../net/ethernet/mellanox/mlx5/core/en_tx.c | 18 +----------------- 4 files changed, 27 insertions(+), 22 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h index 9f6967d76053..c0249fc77eaa 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h @@ -189,6 +189,22 @@ static inline void mlx5e_rqwq_reset(struct mlx5e_rq *rq) } } +static inline void mlx5e_dump_error_cqe(struct mlx5e_cq *cq, u32 sqn, + struct mlx5_err_cqe *err_cqe) +{ + struct mlx5_cqwq *wq = &cq->wq; + u32 ci; + + ci = mlx5_cqwq_ctr2ix(wq, wq->cc - 1); + + netdev_err(cq->channel->netdev, + "Error cqe on cqn 0x%x, ci 0x%x, sqn 0x%x, opcode 0x%x, syndrome 0x%x, vendor syndrome 0x%x\n", + cq->mcq.cqn, ci, sqn, + get_cqe_opcode((struct mlx5_cqe64 *)err_cqe), + err_cqe->syndrome, err_cqe->vendor_err_synd); + mlx5_dump_err_cqe(cq->mdev, err_cqe); +} + /* SW parser related functions */ struct mlx5e_swp_spec { diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c index f049e0ac308a..f9dad2639061 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c @@ -415,11 +415,6 @@ bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq) wqe_counter = be16_to_cpu(cqe->wqe_counter); - if (unlikely(get_cqe_opcode(cqe) != MLX5_CQE_REQ)) - netdev_WARN_ONCE(sq->channel->netdev, - "Bad OP in XDPSQ CQE: 0x%x\n", - get_cqe_opcode(cqe)); - do { struct mlx5e_xdp_wqe_info *wi; u16 ci; @@ -432,6 +427,14 @@ bool mlx5e_poll_xdpsq_cq(struct mlx5e_cq *cq) mlx5e_free_xdpsq_desc(sq, wi, &xsk_frames, true); } while (!last_wqe); + + if (unlikely(get_cqe_opcode(cqe) != MLX5_CQE_REQ)) { + netdev_WARN_ONCE(sq->channel->netdev, + "Bad OP in XDPSQ CQE: 0x%x\n", + get_cqe_opcode(cqe)); + mlx5e_dump_error_cqe(&sq->cq, sq->sqn, + (struct mlx5_err_cqe *)cqe); + } } while ((++i < MLX5E_TX_CQ_POLL_BUDGET) && (cqe = mlx5_cqwq_get_cqe(&cq->wq))); if (xsk_frames) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index e2beb89c1832..4db1c92f0019 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -631,6 +631,8 @@ int mlx5e_poll_ico_cq(struct mlx5e_cq *cq) netdev_WARN_ONCE(cq->channel->netdev, "Bad OP in ICOSQ CQE: 0x%x\n", get_cqe_opcode(cqe)); + mlx5e_dump_error_cqe(&sq->cq, sq->sqn, + (struct mlx5_err_cqe *)cqe); if (!test_and_set_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) queue_work(cq->channel->priv->wq, &sq->recover_work); break; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index fd6b2a1898c5..1679557f34c0 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -399,22 +399,6 @@ netdev_tx_t mlx5e_xmit(struct sk_buff *skb, struct net_device *dev) return mlx5e_sq_xmit(sq, skb, wqe, pi, netdev_xmit_more()); } -static void mlx5e_dump_error_cqe(struct mlx5e_txqsq *sq, - struct mlx5_err_cqe *err_cqe) -{ - struct mlx5_cqwq *wq = &sq->cq.wq; - u32 ci; - - ci = mlx5_cqwq_ctr2ix(wq, wq->cc - 1); - - netdev_err(sq->channel->netdev, - "Error cqe on cqn 0x%x, ci 0x%x, sqn 0x%x, opcode 0x%x, syndrome 0x%x, vendor syndrome 0x%x\n", - sq->cq.mcq.cqn, ci, sq->sqn, - get_cqe_opcode((struct mlx5_cqe64 *)err_cqe), - err_cqe->syndrome, err_cqe->vendor_err_synd); - mlx5_dump_err_cqe(sq->cq.mdev, err_cqe); -} - bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget) { struct mlx5e_sq_stats *stats; @@ -501,7 +485,7 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget) if (unlikely(get_cqe_opcode(cqe) == MLX5_CQE_REQ_ERR)) { if (!test_and_set_bit(MLX5E_SQ_STATE_RECOVERING, &sq->state)) { - mlx5e_dump_error_cqe(sq, + mlx5e_dump_error_cqe(&sq->cq, sq->sqn, (struct mlx5_err_cqe *)cqe); mlx5_wq_cyc_wqe_dump(&sq->wq, ci, wi->num_wqebbs); queue_work(cq->channel->priv->wq, From patchwork Thu Apr 30 17:18:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220168 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 2C406C47247 for ; Thu, 30 Apr 2020 17:22:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF31020787 for ; Thu, 30 Apr 2020 17:22:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="fEQrOvBr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727082AbgD3RWS (ORCPT ); Thu, 30 Apr 2020 13:22:18 -0400 Received: from mail-eopbgr70055.outbound.protection.outlook.com ([40.107.7.55]:6237 "EHLO EUR04-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727064AbgD3RWR (ORCPT ); Thu, 30 Apr 2020 13:22:17 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SRt+rIqKpSV/MpwJtrFF/ZrCc1DmXnGOCQ5/lCNKqDJ1edokX/UlQlS/nsGAJ3EnCTkcWFPZrpc8eEGEahKaFH8RJLHSQMAfagFrAFJUtI92u1oLh+UNq4fPlWRvmpvq6U1K0TSZARlFHrndG7fPztaQAL5D3/Ro2z14/pfJMSwUYEgJ6dANOibJ7lNkk8FfPInkcgPIdJDAvENDpp40O7E8UiOEneov0R+HEYmFgBqAR/BuVMyJQ97eLT3Pj3a+yrtZtLL5NEkeF0rr7/apNMaJ0SqFicvLPq9GZYQQjWo+6uXd2KkTJu0k0BXvTLkfkhz4myCkORnnYvZ/7gRxhA== 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=FF91mLH2rQAQqijbay2T/TtTqHC+FHjbLPHD13OCcj8=; b=iZWpaGxkRx5aUJHvOtAzPvbOLdxv8hmKPtoMFcGcS9sSLTAptkVnSKky4BpaqDY1VLCCkARplOZPFWwnYhpMe1EGWEjYD1e1NcY0IUgZftOwjuB6ywJY6g+H13CMPin9RT9LbIFY1aAxMjYKgBZEKjhfDQvamaP75jwMjFjCJddZfxq6GvNMgEyU01KrkAYtMi0JdJjRNdoLfkNyTNcfc97xNdWRycbq1OgWDNb6fotO0Ex5HDOG/Tsp2XbG/4N4lqSSU6VZ7HEKle0uikGsomp7A3tLV26lO8HJxlW7VgIuri1zXXfrQ67LqF4SIsIQs1euboTgRJbkEc0zEpw5Xg== 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=FF91mLH2rQAQqijbay2T/TtTqHC+FHjbLPHD13OCcj8=; b=fEQrOvBr28I0YvuU1s4r08kx38+3rvSqHAgm7tfBTUzMbVUKFWDbtzuGwSaCXVNQBhKmkUjSiq/tX0p8OpVEZBSgYxb9Zb3aKrpvZ8RHOQdH4ZSLUixwUBK1FA4qKOmp6bFeziTPgBMTzIVnn9Mm7gefnTrqmwHHvApSjFz8X6c= 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 VI1PR05MB3296.eurprd05.prod.outlook.com (2603:10a6:802:1c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20; Thu, 30 Apr 2020 17:21:30 +0000 Received: from VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19]) by VI1PR05MB5102.eurprd05.prod.outlook.com ([fe80::9d19:a564:b84e:7c19%7]) with mapi id 15.20.2937.028; Thu, 30 Apr 2020 17:21:30 +0000 From: Saeed Mahameed To: "David S. Miller" , kuba@kernel.org Cc: netdev@vger.kernel.org, Maxim Mikityanskiy , Tariq Toukan , Saeed Mahameed Subject: [net-next 15/15] net/mlx5e: Unify reserving space for WQEs Date: Thu, 30 Apr 2020 10:18:35 -0700 Message-Id: <20200430171835.20812-16-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430171835.20812-1-saeedm@mellanox.com> References: <20200430171835.20812-1-saeedm@mellanox.com> X-ClientProxiedBy: BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) 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 BY5PR17CA0030.namprd17.prod.outlook.com (2603:10b6:a03:1b8::43) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.20 via Frontend Transport; Thu, 30 Apr 2020 17:21:28 +0000 X-Mailer: git-send-email 2.25.4 X-Originating-IP: [73.15.39.150] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: a9196076-35db-4a3e-ed1c-08d7ed2aec36 X-MS-TrafficTypeDiagnostic: VI1PR05MB3296:|VI1PR05MB3296: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4125; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: prICEw7Cswqr0z4LO28tOMpz7ZfE7AlfprTXFPAajlA456y9FFti97hh2sNf+vKjPzy28rjdcReD1ascJ2Pa/Ub8ag+jdI4B3iCDjos/qlkvG2Gw0h+Z8wPa5lscFUWoE2vt38TReW2hjzwp4LMpTm3Rd5I7rharcjuKXaNXOLk3uSZqpGR3aSjlZ2+mIHQDDbeVJJF6uZ8YxNJeozFJxfqzhE82Vl7DWbmdaNmbuOOnuc4EuZvNwORZwcAD5ZFTq0Y5aRD5sjh+68sx/itic6TYHnjBRlTnrdl6TrJt+f0d+Zy+I0sPLpVN252PglCVzbmtVw0Yp8m0avL1XES9ZC2AmKWMoM96VCQoLnwQDISIDKUo2kL0SE9CTIaqUdopQsWfBymTDvNV2robl300cV8knNdeTIuSzBotOX239L9tzRmreHXyjuLBt/QBFvIxA3+qIuZF3BN2sZXK6K1bdtZq759+3yyfLBEIS9zxl6n5lF3HgRI9VdCQA/Dzwg7u 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)(396003)(376002)(39860400002)(366004)(136003)(346002)(52116002)(6666004)(54906003)(2616005)(956004)(316002)(2906002)(478600001)(107886003)(4326008)(66946007)(86362001)(66476007)(66556008)(36756003)(6486002)(16526019)(186003)(26005)(8936002)(6512007)(8676002)(6506007)(1076003)(30864003)(5660300002)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 7gQzqVLZfHopUMFsw6eRlGBb9inKMP/WszmOKCE2f3FEScP7A8kxafZz/P4WfDXw0ZRiCE7eBNSIb9OQf+UqRByHgjAldBJs4ivDZ8xVqCp9u0FpklGcJonIc5TWAJRMHeYlE0MCTI7qyZf368MR8+DnEHk27iRDvARN3fwH3RYD/HPARJJMgbQ0dyepTNKZvdhHc5CAYvzYDMOhdGmMIVe16KF6TJ4XfNXS13KcUpUcaRchVCIFNNWlCPaP3a1VwG2kelEacgCNTIdlxe2ctr4saKSnKlPP4pVWy/9oBYCPLImshb+Bekk9A34Ig/zJTMOnPylIyfSHEnzVGtENTgoLZkcuGDPeVrhImP4A3Y36cA4QBimXhQDIbtgCTvk1Pik9S1HcaV/Gzyoa6M3PTD8th8jsq9ENltnITR8CNWZKV41L/mE+C0HV4oRqt6Fu8sKcJQpG3mf/U0YzvDVfNaqfv5jXe5J73xhywcGyYea0FvpAmVXXgBhFrZqkUBTeGp9XjmaUL9P3xu6FOM35MmjeQCdo8WxrRFChCd2YvqnZqvelsd+2571XdjLpQPC+F8qI4j9ZCLULAedaBxl9mLNpflRXGxJRZHPULi1qqOHIwuQ1VbWsrdhA9s+fKViHovFhDzQYF42LIEq85zdKtgYVvb6tNNp9J3fwz3GbBPX5Xrw800hx87GMeTqfw8dFL7KIudm0dHGr31zMIKd2SOo5+YyFE1V/uBcVhICKL5VBjNdJQuSFsWk7NfufX7ABvM+conkFwJSS0U34Tdl9UHZBUY4hqk0vRiQYHLy1z9I= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: a9196076-35db-4a3e-ed1c-08d7ed2aec36 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 17:21:30.7094 (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: RcBK1C/6wcDLsyeeA/S160RGpf+Q8vIBvXb99R+aYLrSypZ64Xuz3oUFtsSw/O/juH6XHCUh5woLdgbmi1SA2A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3296 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Maxim Mikityanskiy In our fast-path design, a WQE (Work Queue Element) must not cross the page boundary. To enforce that, for WQEs consisting of more than one BB (Basic Block), the driver checks the available contiguous space in the WQ in advance, and if it's not enough, it pads it with NOPs. This patch modifies the code that calculates the position of next WQE, considering the padding, and prepares the WQE. This code is common for all SQ types. In this patch it's reorganized in a way that makes the usage pattern unified for all SQ types, and makes the implementations self-contained and look almost the same, preparing the repeating code to further attempts to deduplicate it. One place is left as is: mlx5e_sq_xmit and mlx5e_fill_sq_frag_edge call inside, because it is special in a way that it may also copy WQE's cseg and eseg when reserving space. This will be eliminated in one of the following patches, and this place will be converted to the new approach, too. Signed-off-by: Maxim Mikityanskiy Reviewed-by: Tariq Toukan Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/en/txrx.h | 56 +++++++++++++++++++ .../net/ethernet/mellanox/mlx5/core/en/xdp.c | 31 ++++++++-- .../net/ethernet/mellanox/mlx5/core/en/xdp.h | 17 ------ .../mellanox/mlx5/core/en_accel/ktls_tx.c | 16 +----- .../net/ethernet/mellanox/mlx5/core/en_rx.c | 26 +-------- .../net/ethernet/mellanox/mlx5/core/en_tx.c | 11 +--- 6 files changed, 88 insertions(+), 69 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h index 8682d9148ab9..89fe65593c16 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/txrx.h @@ -81,6 +81,62 @@ mlx5e_post_nop_fence(struct mlx5_wq_cyc *wq, u32 sqn, u16 *pc) return wqe; } +static inline u16 mlx5e_txqsq_get_next_pi(struct mlx5e_txqsq *sq, u16 size) +{ + struct mlx5_wq_cyc *wq = &sq->wq; + u16 pi, contig_wqebbs; + + pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); + contig_wqebbs = mlx5_wq_cyc_get_contig_wqebbs(wq, pi); + if (unlikely(contig_wqebbs < size)) { + struct mlx5e_tx_wqe_info *wi, *edge_wi; + + wi = &sq->db.wqe_info[pi]; + edge_wi = wi + contig_wqebbs; + + /* Fill SQ frag edge with NOPs to avoid WQE wrapping two pages. */ + for (; wi < edge_wi; wi++) { + *wi = (struct mlx5e_tx_wqe_info) { + .num_wqebbs = 1, + }; + mlx5e_post_nop(wq, sq->sqn, &sq->pc); + } + sq->stats->nop += contig_wqebbs; + + pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); + } + + return pi; +} + +static inline u16 mlx5e_icosq_get_next_pi(struct mlx5e_icosq *sq, u16 size) +{ + struct mlx5_wq_cyc *wq = &sq->wq; + u16 pi, contig_wqebbs; + + pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); + contig_wqebbs = mlx5_wq_cyc_get_contig_wqebbs(wq, pi); + if (unlikely(contig_wqebbs < size)) { + struct mlx5e_icosq_wqe_info *wi, *edge_wi; + + wi = &sq->db.wqe_info[pi]; + edge_wi = wi + contig_wqebbs; + + /* Fill SQ frag edge with NOPs to avoid WQE wrapping two pages. */ + for (; wi < edge_wi; wi++) { + *wi = (struct mlx5e_icosq_wqe_info) { + .opcode = MLX5_OPCODE_NOP, + .num_wqebbs = 1, + }; + mlx5e_post_nop(wq, sq->sqn, &sq->pc); + } + + pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); + } + + return pi; +} + static inline void mlx5e_fill_sq_frag_edge(struct mlx5e_txqsq *sq, struct mlx5_wq_cyc *wq, u16 pi, u16 nnops) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c index cf089520c031..c4a7fb4ecd14 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.c @@ -178,21 +178,42 @@ bool mlx5e_xdp_handle(struct mlx5e_rq *rq, struct mlx5e_dma_info *di, } } -static void mlx5e_xdp_mpwqe_session_start(struct mlx5e_xdpsq *sq) +static u16 mlx5e_xdpsq_get_next_pi(struct mlx5e_xdpsq *sq, u16 size) { - struct mlx5e_xdp_mpwqe *session = &sq->mpwqe; - struct mlx5e_xdpsq_stats *stats = sq->stats; struct mlx5_wq_cyc *wq = &sq->wq; u16 pi, contig_wqebbs; pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); contig_wqebbs = mlx5_wq_cyc_get_contig_wqebbs(wq, pi); + if (unlikely(contig_wqebbs < size)) { + struct mlx5e_xdp_wqe_info *wi, *edge_wi; + + wi = &sq->db.wqe_info[pi]; + edge_wi = wi + contig_wqebbs; + + /* Fill SQ frag edge with NOPs to avoid WQE wrapping two pages. */ + for (; wi < edge_wi; wi++) { + *wi = (struct mlx5e_xdp_wqe_info) { + .num_wqebbs = 1, + .num_pkts = 0, + }; + mlx5e_post_nop(wq, sq->sqn, &sq->pc); + } + sq->stats->nops += contig_wqebbs; - if (unlikely(contig_wqebbs < MLX5_SEND_WQE_MAX_WQEBBS)) { - mlx5e_fill_xdpsq_frag_edge(sq, wq, pi, contig_wqebbs); pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); } + return pi; +} + +static void mlx5e_xdp_mpwqe_session_start(struct mlx5e_xdpsq *sq) +{ + struct mlx5e_xdp_mpwqe *session = &sq->mpwqe; + struct mlx5e_xdpsq_stats *stats = sq->stats; + u16 pi; + + pi = mlx5e_xdpsq_get_next_pi(sq, MLX5_SEND_WQE_MAX_WQEBBS); session->wqe = MLX5E_TX_FETCH_WQE(sq, pi); prefetchw(session->wqe->data); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h index 4fd0ff47bdc3..ed6f045febeb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/xdp.h @@ -137,23 +137,6 @@ mlx5e_xdp_no_room_for_inline_pkt(struct mlx5e_xdp_mpwqe *session) session->ds_count + MLX5E_XDP_INLINE_WQE_MAX_DS_CNT > MLX5E_XDP_MPW_MAX_NUM_DS; } -static inline void -mlx5e_fill_xdpsq_frag_edge(struct mlx5e_xdpsq *sq, struct mlx5_wq_cyc *wq, - u16 pi, u16 nnops) -{ - struct mlx5e_xdp_wqe_info *edge_wi, *wi = &sq->db.wqe_info[pi]; - - edge_wi = wi + nnops; - /* fill sq frag edge with nops to avoid wqe wrapping two pages */ - for (; wi < edge_wi; wi++) { - wi->num_wqebbs = 1; - wi->num_pkts = 0; - mlx5e_post_nop(wq, sq->sqn, &sq->pc); - } - - sq->stats->nops += nnops; -} - static inline void mlx5e_xdp_mpwqe_add_dseg(struct mlx5e_xdpsq *sq, struct mlx5e_xdp_xmit_data *xdptxd, diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c index 717d36b45aa9..ba973937f0b5 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c @@ -165,14 +165,8 @@ mlx5e_ktls_tx_post_param_wqes(struct mlx5e_txqsq *sq, bool skip_static_post, bool fence_first_post) { bool progress_fence = skip_static_post || !fence_first_post; - struct mlx5_wq_cyc *wq = &sq->wq; - u16 contig_wqebbs_room, pi; - pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); - contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi); - if (unlikely(contig_wqebbs_room < - MLX5E_KTLS_STATIC_WQEBBS + MLX5E_KTLS_PROGRESS_WQEBBS)) - mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room); + mlx5e_txqsq_get_next_pi(sq, MLX5E_KTLS_STATIC_WQEBBS + MLX5E_KTLS_PROGRESS_WQEBBS); if (!skip_static_post) post_static_params(sq, priv_tx, fence_first_post); @@ -346,10 +340,8 @@ mlx5e_ktls_tx_handle_ooo(struct mlx5e_ktls_offload_context_tx *priv_tx, u32 seq) { struct mlx5e_sq_stats *stats = sq->stats; - struct mlx5_wq_cyc *wq = &sq->wq; enum mlx5e_ktls_sync_retval ret; struct tx_sync_info info = {}; - u16 contig_wqebbs_room, pi; u8 num_wqebbs; int i = 0; @@ -380,11 +372,7 @@ mlx5e_ktls_tx_handle_ooo(struct mlx5e_ktls_offload_context_tx *priv_tx, } num_wqebbs = mlx5e_ktls_dumps_num_wqebbs(sq, info.nr_frags, info.sync_len); - pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); - contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi); - - if (unlikely(contig_wqebbs_room < num_wqebbs)) - mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room); + mlx5e_txqsq_get_next_pi(sq, num_wqebbs); for (; i < info.nr_frags; i++) { unsigned int orig_fsz, frag_offset = 0, n = 0; diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 9f33a0e7dd9a..d9a5a669b84d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c @@ -468,22 +468,6 @@ static void mlx5e_post_rx_mpwqe(struct mlx5e_rq *rq, u8 n) mlx5_wq_ll_update_db_record(wq); } -static inline void mlx5e_fill_icosq_frag_edge(struct mlx5e_icosq *sq, - struct mlx5_wq_cyc *wq, - u16 pi, u16 nnops) -{ - struct mlx5e_icosq_wqe_info *edge_wi, *wi = &sq->db.wqe_info[pi]; - - edge_wi = wi + nnops; - - /* fill sq frag edge with nops to avoid wqe wrapping two pages */ - for (; wi < edge_wi; wi++) { - wi->opcode = MLX5_OPCODE_NOP; - wi->num_wqebbs = 1; - mlx5e_post_nop(wq, sq->sqn, &sq->pc); - } -} - static int mlx5e_alloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix) { struct mlx5e_mpw_info *wi = &rq->mpwqe.info[ix]; @@ -492,7 +476,7 @@ static int mlx5e_alloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix) struct mlx5_wq_cyc *wq = &sq->wq; struct mlx5e_umr_wqe *umr_wqe; u16 xlt_offset = ix << (MLX5E_LOG_ALIGNED_MPWQE_PPW - 1); - u16 pi, contig_wqebbs_room; + u16 pi; int err; int i; @@ -502,13 +486,7 @@ static int mlx5e_alloc_rx_mpwqe(struct mlx5e_rq *rq, u16 ix) goto err; } - pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); - contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi); - if (unlikely(contig_wqebbs_room < MLX5E_UMR_WQEBBS)) { - mlx5e_fill_icosq_frag_edge(sq, wq, pi, contig_wqebbs_room); - pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); - } - + pi = mlx5e_icosq_get_next_pi(sq, MLX5E_UMR_WQEBBS); umr_wqe = mlx5_wq_cyc_get_wqe(wq, pi); memcpy(umr_wqe, &rq->mpwqe.umr_wqe, offsetof(struct mlx5e_umr_wqe, inline_mtts)); diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c index ec1429596cb7..583e1b201b75 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c @@ -572,7 +572,6 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, struct mlx5_av *av, u32 dqpn, u32 dqkey, bool xmit_more) { - struct mlx5_wq_cyc *wq = &sq->wq; struct mlx5i_tx_wqe *wqe; struct mlx5_wqe_datagram_seg *datagram; @@ -582,9 +581,9 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, struct mlx5e_tx_wqe_info *wi; struct mlx5e_sq_stats *stats = sq->stats; - u16 headlen, ihs, pi, contig_wqebbs_room; u16 ds_cnt, ds_cnt_inl = 0; u8 num_wqebbs, opcode; + u16 headlen, ihs, pi; u32 num_bytes; int num_dma; __be16 mss; @@ -620,13 +619,7 @@ netdev_tx_t mlx5i_sq_xmit(struct mlx5e_txqsq *sq, struct sk_buff *skb, } num_wqebbs = DIV_ROUND_UP(ds_cnt, MLX5_SEND_WQEBB_NUM_DS); - pi = mlx5_wq_cyc_ctr2ix(wq, sq->pc); - contig_wqebbs_room = mlx5_wq_cyc_get_contig_wqebbs(wq, pi); - if (unlikely(contig_wqebbs_room < num_wqebbs)) { - mlx5e_fill_sq_frag_edge(sq, wq, pi, contig_wqebbs_room); - pi = mlx5_wq_cyc_ctr2ix(&sq->wq, sq->pc); - } - + pi = mlx5e_txqsq_get_next_pi(sq, num_wqebbs); wqe = MLX5I_SQ_FETCH_WQE(sq, pi); /* fill wqe */