From patchwork Thu Apr 30 16:25:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220183 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70D3BC47247 for ; Thu, 30 Apr 2020 16:26:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4BCE8208CA for ; Thu, 30 Apr 2020 16:26:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="MX7SM6Oa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727103AbgD3Q0Z (ORCPT ); Thu, 30 Apr 2020 12:26:25 -0400 Received: from mail-eopbgr60079.outbound.protection.outlook.com ([40.107.6.79]:10070 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727065AbgD3Q0Y (ORCPT ); Thu, 30 Apr 2020 12:26:24 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ePkUteEw5WvFjh2sXh6QneMLBGZ1GbWCIH57utmufaLVbWznS+x4jRQ9Sj1sgqC4lopHERYefTy166+vf4Dk7k3nCq7nHP/8bqQAtPJpStjaxoDZljRAx/m3BYvixSZ75TIny+5Sq4nOZLYISBFUVnOW5agVW3guPj7Gk5cIK2/ZSoMYlCBigJ6FKk6XpzxLQWl1Z0PH7MYJZDmytYtlvinCZrTypHcLI7ZudDXCDGobKddh8eONcs57Y937vKwVd/6Sad9W3OjIxmWYYMp59AwiwNvPMYkNOMpMwVnDqNRcc2U8NncipEcVni3zb1YZvT1Z2/yGKuPD2Z8/y6GevQ== 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=yUUfQGm9dEFRtllrurkLra+TvryAZHLiXCxBc7Xzj4I=; b=NzIH5FLjy/1XHu3ZRf9sMuO5n8ZOeSSMXURuTw1QV7cjewqBI0WuECckiXPVNgeimab356JU/XO06YUD06CVi5ayzocCs9hnQFrmhQ00Kz2H/jR/13HeDlCQ9H9FG6PLt0nHPZ9W93z4UeksCJN4Z61N9J7McEWvGFaK521B5yb5v6TE4mT+i51gZz9xAnXScKMQ+CLvcVq0qLDfvJJZ5y0YMQm7cik1hrBvP87iAXl0SXeKa8+huKxygAbJgjJf2xJSp13bWAGHe4V69vKEA8tUhHjd0HbikAyKcMliDIh8lZPfvCy2tBx0+zpppx52wFBi4A54oN5ETo1dXbGeNA== 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=yUUfQGm9dEFRtllrurkLra+TvryAZHLiXCxBc7Xzj4I=; b=MX7SM6OaUUEoOG4Oi8epR+Vpgfza96mVyhZ+QOX1/Lat+ztOxK8tLqsYtckVp0gD8f6oe/WXu/8Whw3u0CfcJalm9zoJW3O0gEhN1wxQlcKRATih0R2v1wdARn9LndYWtkiD+yKahbPdyFEO/AGdnDdLeH59i5d9el2oInCMwnY= 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 VI1PR05MB5376.eurprd05.prod.outlook.com (2603:10a6:803:a4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 16:26:20 +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 16:26:20 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Parav Pandit , Roi Dayan , Saeed Mahameed Subject: [net V2 2/7] net/mlx5: E-switch, Fix printing wrong error value Date: Thu, 30 Apr 2020 09:25:46 -0700 Message-Id: <20200430162551.14997-3-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430162551.14997-1-saeedm@mellanox.com> References: <20200430162551.14997-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR02CA0070.namprd02.prod.outlook.com (2603:10b6:a03:54::47) 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 BYAPR02CA0070.namprd02.prod.outlook.com (2603:10b6:a03:54::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Thu, 30 Apr 2020 16:26:18 +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: 8b4d83cd-3bea-4fa3-aa0e-08d7ed2336f0 X-MS-TrafficTypeDiagnostic: VI1PR05MB5376:|VI1PR05MB5376: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:247; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +dmJJdq8zl004NvfEQ7Jh7GbO4Hr0QLWEVKnYMr+swPntU8zjsZjBzFifRCSce2b8tfJOOhRl3REVunFICO3XN3fXD6GIrzSP8a50OGmDX4qH/KqbxY4EVQrnGcKV3dR8c1eeGYeqcnUy3fLk+D/nJlKNsa0z3/ujASDZpLkkS6A64wcMeNreCFsM6GHiAl33GoPl3LJg+h7Gzun/t/geKl01vCR+WCRJZ9mfSlH0l7OMOM7WUOLBFBkrvm6bj+UKwuB1wiafenXqjEYmj1miPh0puT0lexn4cKMuLvPh5em7Sjy2t6zSIejlnSlXCHNyT4lQeW/VDhTf0PjPnNTWJnw7kIzmnPpPqtXiTqhObwHiwQwCXELlB9KX8u8H42JGsBWJtCkAbcU4Xfkq0rVCCEOa5wXSJKQh2GLtaPbDv1uF61nEBcZBKpV8p3R9Z4sNXVfUawdZFb9GFAzxiOefLzhCHZG1F2j94DDjpSqOqfJK3K38wy4dhR2Ki1mNtPl 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)(366004)(136003)(39860400002)(346002)(8936002)(6916009)(107886003)(36756003)(4326008)(66476007)(6486002)(54906003)(8676002)(66556008)(66946007)(2906002)(26005)(6512007)(1076003)(316002)(956004)(6506007)(86362001)(6666004)(52116002)(2616005)(5660300002)(186003)(16526019)(478600001)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: BJLgnf+hOT6FfO3i5jWMdI+yj1TZppSrmBAPyx0jWQ1uBFwN9RDYeCgUBBytLUtpHaIKcoIeoo2vNs7qj3i+eZ2w7V1/GLZJ4v7Vh8TWeg277toJ/6+lFGg50UsV7SUkMRjAidc5tOa1wVe+eqJlrKyFc4ktZiKm3e5adRqRx/dndvueKInXORrLooi98ltFsacSlOGICSIp1rcm4SEGl6pQbTabaKfza9r0I0LBhLLioU5N1NppEMi2aUB70IDeqGNLOrwUbQoYqYMt6tCkN6R+HWSwMGypUx1AQuiKKr4+a6Si+aN5LcHFNBaQUvlstwAB86G0f9ob8SEWRX9/4WhZMWc/EHVh0MdLS7u2Dla4ljKRAlYarHnMeN1fCgYlCtEm6hEy1k7XtxxUXf+/W9O6pQQTJ0vhkkZRkJV3DSKZyChcWV5yD4+UBBRLCUiWt9il9Lds/OE4wQL9Iyc0D/SstLfXs818D8FU1EL0k4XoPLBViDyk7mQqr+zhg1NUce3Dgk07W6zn6x6wd6Fc26SbiuW3YK2xLHUbd3qo5LhY5wEIEMdEj2jG0+Z/JyS8NAOPMasynMtJE2vrhmTzwhVfRXMnFZOSRY62Q4bmLfss8JIBpNn42XfPGLdAm9F4RJLeQkH0knN5rjSWHwQY8jaDtMHi80UCMUOhStS6bQvvbS1/gZ310EFViMAPrJVxVtyV+rYcPuGI6yjJ3n8ibEevxCg0u+mqROrtzcmtR2pi6LYWQXF6DFCYVnmm/T+RuF7KeDbsJV214gt2Xn+ZSJ3vXvGXG/oTrvyP2bZvVcc= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8b4d83cd-3bea-4fa3-aa0e-08d7ed2336f0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 16:26:20.2241 (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: yLjUlMprN/aJ0LheFnPm4rf8VRF8Qj3qiW+8IWZ5Zbrhxn849QFuwxbtsVuQi8vHWfIxzA3KUDlAic2uSorG0g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5376 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Parav Pandit When mlx5_modify_header_alloc() fails, instead of printing the error value returned, current error log prints 0. Fix by printing correct error value returned by mlx5_modify_header_alloc(). Fixes: 6724e66b90ee ("net/mlx5: E-Switch, Get reg_c1 value on miss") Signed-off-by: Parav Pandit Reviewed-by: Roi Dayan 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 94d6c91a8612..8289af360e8d 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c @@ -1550,9 +1550,9 @@ static int esw_create_restore_table(struct mlx5_eswitch *esw) MLX5_FLOW_NAMESPACE_KERNEL, 1, modact); if (IS_ERR(mod_hdr)) { + err = PTR_ERR(mod_hdr); esw_warn(dev, "Failed to create restore mod header, err: %d\n", err); - err = PTR_ERR(mod_hdr); goto err_mod_hdr; } From patchwork Thu Apr 30 16:25:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220182 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1DAFEC47247 for ; Thu, 30 Apr 2020 16:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E65C1208CA for ; Thu, 30 Apr 2020 16:26:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="Mkz2tbQN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727109AbgD3Q0b (ORCPT ); Thu, 30 Apr 2020 12:26:31 -0400 Received: from mail-eopbgr60079.outbound.protection.outlook.com ([40.107.6.79]:10070 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726839AbgD3Q0a (ORCPT ); Thu, 30 Apr 2020 12:26:30 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YYNFlUrsbh764rCgeu+by+HWtYONs5l6Q/UBaAlStaDYjLVxVCb3mUKEbrd4NTyGs57a/1NIbjsan1YmbbF9PxPmL+HRFPhVmfQBQFNQMvuqqNGizaTbVs59LwViKvTWwf4Kk/lmderHchJziU0pYMCT6TZHBVc40H8OlDlxk0pI9WdzEU8QHhs+UK3QtjBYpcKL/AIaczdjOSW7maYi0ATQNS5TxcZCBdytPGimCDyw55k96JBQlDMwW2y9nvf8Bxj8sZFEh0CPDpq2jaO44U3RpiotZ/KT0GZYncnRdSPEMiycadAr6KPOZpEzPObk06gmnBnh4yd+LcINQWvhvg== 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=Vq8h8/3OAdogrgGDTEaFalKljXpjv0MY1fxQWeDsi7Q=; b=Dd4r536OzwKN0MG81bYG1Xp9UxzGpcM/FwY6Mo6D8M1vj2wTmYlFsYFMZB4tWYM1n8MERItgxziNmdF6pnSw6cWoI4EkfQFHNFlfO0+UhX9E9C9C97exLfRYICQ3yDmtXdIviYjO09rTM+MkqMcQkRUCYq/gtwPlPybnFiy6W/O8E4P5soPqZJEWS1eOKGQGuGPNDStBuKJ1wjsxAkx1ZDC4wf0S31B/LAxZMNcrjvM6cdocBrwrBmacAFoaWUSjTGMUJLZ/nyotSFga8xXiEAPaVNhUzLHlVkcgE31F7MjiXw88u+47BsgaTuU1S5hjW7WzO0gj1xhJcn4HYiLhmg== 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=Vq8h8/3OAdogrgGDTEaFalKljXpjv0MY1fxQWeDsi7Q=; b=Mkz2tbQNjJu7Guo3dVt+Qy+gElAllPr0giNdcBVaooCLScrO1WShoystsji4qOdbW7q9mbCT5YPUzNSUbb6TxKzYuwasojtFTYEjrEi4yiEuMHyClnhIjGwrwTjBGjbkd0dvtqXcv8fFRU0xuQmus/xryEmfhneEBtmGwAuK6zE= 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 VI1PR05MB5376.eurprd05.prod.outlook.com (2603:10a6:803:a4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 16:26:25 +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 16:26:25 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Erez Shitrit , Tariq Toukan , Alex Vesker , Saeed Mahameed Subject: [net V2 4/7] net/mlx5: DR, On creation set CQ's arm_db member to right value Date: Thu, 30 Apr 2020 09:25:48 -0700 Message-Id: <20200430162551.14997-5-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430162551.14997-1-saeedm@mellanox.com> References: <20200430162551.14997-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR02CA0070.namprd02.prod.outlook.com (2603:10b6:a03:54::47) 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 BYAPR02CA0070.namprd02.prod.outlook.com (2603:10b6:a03:54::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Thu, 30 Apr 2020 16:26:22 +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: 119a9944-eb69-4af6-07b1-08d7ed2339f2 X-MS-TrafficTypeDiagnostic: VI1PR05MB5376:|VI1PR05MB5376: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4941; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: xaH0b0SsNJBuyyM3HyaHMgtxtcAljiGh4fVZuj/fqx1yXtZuc73JoWV50SwFJLm1lbkj2vNHZjveQtLEz6mJ97Gzg1zxDp1xj2ud/HrUWcihW3smpakQmtk07gx1IDPDNR/CMuaJqHc+o2J316xIsEPjrjMerhz3fByZ7u3EzDE97Bv62eeEw3EC1SVMKgzPJkAYIFxvYsW3KWhN/uRYLD4PbPaVP5D5Frm3wZptdtpOLOMVH6Beln2aRHFAtNIADfv+irGzjBLCnysAhV7M0jkOGfyGAsYVKqE5TwAM7OIKhnxAhJ6suRQCrP8LGLPOx7BQr6zolBbfPDIF5Q+1djsUPykfTCmkS+F6GtfG/pn1HH/iOsRpfEwxPhOvZQLo2aFwXMbjC7iY7KhMzQv2yUIsJZ0u1NvxlZ50HXWratdzPq6JtAXWdvFs1SLylkW1finHaZrhUWhuuYVCc/0o2aSFcInVkUjN5mz+IZ8j+YP+ssr0mLHUgm9GADciVzIX 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)(366004)(136003)(39860400002)(346002)(8936002)(6916009)(107886003)(36756003)(4326008)(66476007)(6486002)(54906003)(8676002)(66556008)(66946007)(2906002)(26005)(6512007)(1076003)(316002)(956004)(6506007)(86362001)(6666004)(52116002)(2616005)(5660300002)(186003)(16526019)(478600001)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: G1L6dgLMifXrTEk5pNuCmt8O3sxZlFao2KDyy5UE4aZqxH/dvxrazHIIf3Z0Y0pQXVImtiPKnXrAULPy5/j14jaiv+8U58rDVwh21ttTrPQ9EVQ4XMwmEMVwIDpcoy9U2hbbZe1G9e4zvmzIQseDK9srRGn9n6YCy1UD5w7IT9yzAWfvHYXba37Jl4nd5VEsbNfLnaUceMmvYB3i2WdpC7Z7jtOl3N+GTXIvVlENVolWcAkYrwtQcDQoRYYstGAtNIpfFTUvZCpKa3/x4a4422JfYfaEJxXKOPqnRVLrCTPJCRnEMi2LdUMnh9tHtJIOl5s5NuAXXp8pwYgwQ7tsOnUfFOcywGWBt/7DeLQnz/FroPNuGOfIVgca5iX2CPQt0PC4DNgMdBge17zwVCQCQW0JIwQ5clRzZn3L82nj0XIVRyAaDUIPJgckF95Ww1lTXyszTVOxwlcAHIPyUbjVk/dnKcKQkHZGlr3IKE/20R4Lf+mG/epKdElpa+jp8VHR4ZTAeeZSVYinC3dXECxwgqcQGIqHPXE+zBb/1qIh8pEi34JLyhKKh+h+ovX63lmNFQoSD3ec2hxv6T01MbebGCt+GBqU+CvPhfzDTeXRFokYcJQW8LJLnsjozIZsnI0v/XhC/vntJrk7ympxuB3bniHcbr01JxcDBHq1a2spJr+ICjk8HBTjXGJjWuvAQ+JGM7WKm8N3GbIm/Ns+xOTp42eQt/db4Skhqz3PogmDjOEsDLdX3oNx2kF+3gAFNz44BaD8joNunYhoE81gfd/8BvnoLYJ0Ezx6wAlkmMioR9Y= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 119a9944-eb69-4af6-07b1-08d7ed2339f2 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 16:26:25.0844 (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: D0gxgnO1PO43Juj186tzeiih0NCt+EDVXVLKz+5l62CxKtmyJDpx46wsQPglpzkPLkqFeSBHU8vGARVCnaOKUA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5376 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Erez Shitrit In polling mode, set arm_db member to a value that will avoid CQ event recovery by the HW. Otherwise we might get event without completion function. In addition,empty completion function to was added to protect from unexpected events. Fixes: 297cccebdc5a ("net/mlx5: DR, Expose an internal API to issue RDMA operations") Signed-off-by: Erez Shitrit Reviewed-by: Tariq Toukan Reviewed-by: Alex Vesker Signed-off-by: Saeed Mahameed --- .../ethernet/mellanox/mlx5/core/steering/dr_send.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c index c0ab9cf74929..18719acb7e54 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c @@ -695,6 +695,12 @@ static void dr_cq_event(struct mlx5_core_cq *mcq, pr_info("CQ event %u on CQ #%u\n", event, mcq->cqn); } +static void dr_cq_complete(struct mlx5_core_cq *mcq, + struct mlx5_eqe *eqe) +{ + pr_err("CQ completion CQ: #%u\n", mcq->cqn); +} + static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, struct mlx5_uars_page *uar, size_t ncqe) @@ -756,6 +762,7 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, mlx5_fill_page_frag_array(&cq->wq_ctrl.buf, pas); cq->mcq.event = dr_cq_event; + cq->mcq.comp = dr_cq_complete; err = mlx5_core_create_cq(mdev, &cq->mcq, in, inlen, out, sizeof(out)); kvfree(in); @@ -767,7 +774,12 @@ static struct mlx5dr_cq *dr_create_cq(struct mlx5_core_dev *mdev, cq->mcq.set_ci_db = cq->wq_ctrl.db.db; cq->mcq.arm_db = cq->wq_ctrl.db.db + 1; *cq->mcq.set_ci_db = 0; - *cq->mcq.arm_db = 0; + + /* set no-zero value, in order to avoid the HW to run db-recovery on + * CQ that used in polling mode. + */ + *cq->mcq.arm_db = cpu_to_be32(2 << 28); + cq->mcq.vector = 0; cq->mcq.irqn = irqn; cq->mcq.uar = uar; From patchwork Thu Apr 30 16:25:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 220181 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 BCD52C47253 for ; Thu, 30 Apr 2020 16:26:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9739620873 for ; Thu, 30 Apr 2020 16:26:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="WSTYlw5h" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727789AbgD3Q0f (ORCPT ); Thu, 30 Apr 2020 12:26:35 -0400 Received: from mail-eopbgr60079.outbound.protection.outlook.com ([40.107.6.79]:10070 "EHLO EUR04-DB3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726839AbgD3Q0f (ORCPT ); Thu, 30 Apr 2020 12:26:35 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ByyrB91m3AohOKRPphoMFIAcFw7bCf5fm8k1X5+stxXhR2xGUfuRYg7HziYxNbgHKd4R4mNbB9bnYayIGiXdr0C0r8hAH0bKCu/J+8QVZwc6+6chZtQNpKPyxJ5drVsF91N0NVJwb5gPR6bJeEIkvag8SJrgbAbhmM95MfdRcDDBlRJ//ydiIBMll9Ej4Haw+MR0eQgUgnCGjrXgL3H0c+vWSFgyOQqGA59whh28aTLVKvjgRdNucWVH1/bS2cAucGxyWHwr+VjKdhaqlcCypqgPg8svhS+63NhzSjB5JEecF6eWdjRSKX9CVoiOmr7lj4bkc+UJ7bG92cvjy+7jhA== 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=7OTtUiRkkxCXZot63MFRXM8FIhhj7QEossWMro4dok4=; b=W1cqdKBG8bNmbCkUzuoYbDGwbqdo6uYlG89npYDTDaZT/4efnEzf4V9Jp2SBufyvOyrZOhXhvwQbNxlAMvQZ7oQAwfTfMJYpY00RDnSNkxrStZFESmYVpZaMtjHYT0H0xjmhcQ9kvQ1YnpXSm9/BK4powDM9mTL2UZf1w5z+ijWhx6Qb0j3y7vzxauDWsHWD+Sy4zKQlkTktE8puZJlTbPM2K3CSUNHAyZha/3rH2O6jLed2lXWIoxAbyAoAKR1cVw3VwGbA8wWDE0J/ZrLcJv70jeks8gNtXEgGIZzfDlErf9j+G53lm8BQBRbL/et9eJqeLwxge6Ksve17+bhdVA== 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=7OTtUiRkkxCXZot63MFRXM8FIhhj7QEossWMro4dok4=; b=WSTYlw5hagAdd2gycY2rTVspHW9VYntJ27hpEgDUuYwZMixkBvMWypQ9J9Mrn4es82W+KgHGhGxdyzVfvpCEFaUqEkniaDRAEiGpCenbVI2tRa9hNLS26NTPznT1SaAIMo1hmIq/6qTtYz9zQ/8aFEzgSF6o0eY0MI3BAz3fQ3Q= 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 VI1PR05MB5376.eurprd05.prod.outlook.com (2603:10a6:803:a4::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19; Thu, 30 Apr 2020 16:26:29 +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 16:26:29 +0000 From: Saeed Mahameed To: "David S. Miller" Cc: netdev@vger.kernel.org, kuba@kernel.org, Moshe Shemesh , Eran Ben Elisha , Saeed Mahameed Subject: [net V2 6/7] net/mlx5: Fix command entry leak in Internal Error State Date: Thu, 30 Apr 2020 09:25:50 -0700 Message-Id: <20200430162551.14997-7-saeedm@mellanox.com> X-Mailer: git-send-email 2.25.4 In-Reply-To: <20200430162551.14997-1-saeedm@mellanox.com> References: <20200430162551.14997-1-saeedm@mellanox.com> X-ClientProxiedBy: BYAPR02CA0070.namprd02.prod.outlook.com (2603:10b6:a03:54::47) 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 BYAPR02CA0070.namprd02.prod.outlook.com (2603:10b6:a03:54::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2958.19 via Frontend Transport; Thu, 30 Apr 2020 16:26:27 +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: 20009214-e740-497d-690a-08d7ed233c80 X-MS-TrafficTypeDiagnostic: VI1PR05MB5376:|VI1PR05MB5376: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 0389EDA07F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +EX5v3Ul9RPH+8kp4cQ3psgqBNWsDYmb4Z71E0TFebx0NK6kvbwBiRnLdu2BhQO2Wn3JwLq4NW9ZrwXARSmKI4U+1gqSb51SZ1twRzbhOn0b6PRCToDK63JdK8QiRDhpIfxjlZgWZllgQI1dp4cHVDWpbOZsqmBsBfbDVEyF+yy+Go75moadn4/8KZwgdvVaL2CdaY4LjpQy40I47bWbIv1PRlrjTovSuae7t3FMIay62u2jFCeLMgKG1xS1bkp2cwFYMcM65cgX9Xmft2gg++9uU9ctasLq/elMqT6VJjBcswBCsnKiX1c3Nt9dqv1Vf1ILAioyPKJfiJp7gkGVLUrAm5QYclc6l6YmlVxon6dU/syh64CQteiy9+3EDH1mgvXuIsUlT0yam/6GJDEjqYapUvaKvCYBLcxksRi39WtMBNA8IP4yXzoIkjDYJghP4DPnkQK/9h0qBKp0CYa1hsh0v7o5w6gJ2abJSCQQ6LwQsBCg5l9xRbKs3QoOamu0 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)(366004)(136003)(39860400002)(346002)(8936002)(6916009)(107886003)(36756003)(4326008)(66476007)(6486002)(54906003)(8676002)(66556008)(66946007)(2906002)(26005)(6512007)(1076003)(316002)(956004)(6506007)(86362001)(6666004)(52116002)(2616005)(5660300002)(186003)(16526019)(478600001)(54420400002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: z+SnyIpVIX7sRKDHs+XsqBfqUesKislXKi76sjiDRaOUo68z0ZpdPEg42mB67hhRNpH+ZU9CXfFRlEBf73qsVsMZLlBFxxVYFXP6Njs6s2A5LrIHhiKVLEM97ejOi1eWRPGbwkKFr73NxoZuUHVQ2X+6HGSDcgb9s/Cb/D4rDeFN2iHC6r+LL5fOAg0lDTa6kzktSTIuuGcGcATXR5iJwbpKVbB2glQvYs4kov2pZ5oNp3QxLePerw3mexiDDAUzs7p9cDpjmVsMacGV7dmR1PasTY4v7ebmB07TREMXaf+syaj8DpIfbKB49Cs5wHn65ssliPSrL3wbHejpDzvG3IhkBs1nAW+8GVE99qB3G6nl5QUAN7cc7YQMWl5+2oU6wRvcFBmR8MbdMz7Bes+LkTDSpWeH3clgSK3nSDOVenr4GWBnj0mieOkDscJ+VYPhZOIfMub80kUyPGaJYyu4UG0FjU/N3MPJwNnnv0FSyP0h5x9uLFfrTIVMo5cNYqOhtZMEUzdxXBhSI0D9kKa3hx+K3zm4pSKq6gkCBs9ZLiT2tjPs/RFE/4elpYCz87GGPi+rOgCflLnPoq27CTt+vNPNAylfy+1ZPll/VDWz0I8Gxawlxe9lTI/wJwnWFrvFByxV3Ko2KCfU2LQNyfmfZY0FOnWQcVGurku47aZmYRNOYLL8hON+k4ckko7ox+Tv3VrlfZKEvO5RGjHgWRhSC1dRzVvFi0zeR2v7jAbBcHyyvJYrVMdVTFsA8b0T3b88tcT6it6+2f7mdmwvxlApQzB9Hz+owpnKaj5oa5+a/Lc= X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 20009214-e740-497d-690a-08d7ed233c80 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2020 16:26:29.4489 (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: YiU70m0uHgjbow/abi26f9f/E4feE/5OfvnOIj9CBAyHtf9sQmzLmUI43rO7ctHdjfXa0CFUvZIT4QRCddKJlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB5376 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Moshe Shemesh Processing commands by cmd_work_handler() while already in Internal Error State will result in entry leak, since the handler process force completion without doorbell. Forced completion doesn't release the entry and event completion will never arrive, so entry should be released. Fixes: 73dd3a4839c1 ("net/mlx5: Avoid using pending command interface slots") Signed-off-by: Moshe Shemesh Signed-off-by: Eran Ben Elisha Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c index d7470f8d355e..cede5bdfd598 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c @@ -922,6 +922,10 @@ static void cmd_work_handler(struct work_struct *work) MLX5_SET(mbox_out, ent->out, syndrome, drv_synd); mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true); + /* no doorbell, no need to keep the entry */ + free_ent(cmd, ent->idx); + if (ent->callback) + free_cmd(ent); return; }