From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3C5ACA0543 for ; Tue, 21 Jun 2022 10:06:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 35D6640151; Tue, 21 Jun 2022 10:06:00 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2062.outbound.protection.outlook.com [40.107.92.62]) by mails.dpdk.org (Postfix) with ESMTP id 315E840151 for ; Tue, 21 Jun 2022 10:05:58 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MgfLlnrshQJ1VGxtBzft+P5lx+/a7qF9gwFrXFQt2svhK9g3+RnC6wafj8IzO2U8+sXHQRL9LodwpV7sjvzecN14/vUwAAxS/kr6IVy17+5Hhj+9QdDWrPxAt0SHcqQJiSQc44RfEF4brkNrBZPZOrZWWJOvuK5VLdY8h1ardRaKKYifchuvR+o1l9GuzK0hImge6K/P0UOnvY2tt1Uqb9yqrulKtVjw79cjsFTsRtCXLq/HUE9XaiC4meWDvi49CaLdkADhgeinGOqqVGenfsLl0DOCgFq7cPSFim+Kr7u31TXJ24MupeycZLimxiZd/sJMDXxOQf+5hDen7U9Mjw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8FIDbdFigsvMHim/ATR4R7tVfXCp8FKrWy/bEX6YtL0=; b=ggayTYD5oyqOhQ8KsVxdqpGxEJTQ7bSTHJ51pzKRt5HPjEijqoOlSkTDwUiyZa3YqywukETt283VeCgl9PNruV2BL00ejVKZLPenLdiBdKM7iSk2yshShcbDdHIaeCavJznPiu6KbkOBH4kTOLazYuH7TmKXE/ynJSRU2nfiKd66XceQl+HyA+VZeR6INTmUiNbI/WL+QqrXk/QugBFCrds0VkDVjMiJ3AzlvMFlacbMbgC0Sdx4lz3PbpuoL600w916hXp1v0rKE/27siS1/sTwxM7i+inVVlVQL3yB9GiBkXHDcX7MhH6ZwwAqKLI2dUgimNe2O/NDlNFCVVq8wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8FIDbdFigsvMHim/ATR4R7tVfXCp8FKrWy/bEX6YtL0=; b=VxrEhNQ/RchS6Lmg5YAKI4TqgyZxgBX5897ESsG4pWaACmFAZYnO6vGN0HiWD1IqNp7PM0xppAvjgIimRnC0xoabMYZFvf/pwvyp1RL2h4mcJYnWctuGiChEyxt0W/ffz/7HE3SGl+j86eAef9SU0as6yMsnDYnTlBlywMou34GsQtDfOh2D0+7xTjVJy2RKP/W1r669/8XZ+z9ZSMyd3UOjwvTn3G1xYSPvGA1AWC1iB77m24GRJEg0i4zq9ti/qj0zcC5+jCYaH5gc+WxBE7YRjwLZdUBvhGpLffYPQ2z8I3/6tgQuxWAsUonibMiaJmb88nwsKPIvFLOeWn3xaA== Received: from BN1PR13CA0020.namprd13.prod.outlook.com (2603:10b6:408:e2::25) by MN2PR12MB3870.namprd12.prod.outlook.com (2603:10b6:208:166::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.15; Tue, 21 Jun 2022 08:05:56 +0000 Received: from BN8NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e2:cafe::e) by BN1PR13CA0020.outlook.office365.com (2603:10b6:408:e2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.15 via Frontend Transport; Tue, 21 Jun 2022 08:05:56 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (12.22.5.234) by BN8NAM11FT051.mail.protection.outlook.com (10.13.177.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5353.14 via Frontend Transport; Tue, 21 Jun 2022 08:05:56 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.32; Tue, 21 Jun 2022 08:05:54 +0000 Received: from nvidia.com (10.126.230.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.22; Tue, 21 Jun 2022 01:05:52 -0700 From: Xueming Li To: Xueming Li CC: Maxime Coquelin , dpdk stable Subject: patch 'vdpa/mlx5: fix interrupt trash that leads to crash' has been queued to stable release 20.11.6 Date: Tue, 21 Jun 2022 11:01:37 +0300 Message-ID: <20220621080301.2315720-32-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220621080301.2315720-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 01bb2152-d2d1-4682-5417-08da535cdea0 X-MS-TrafficTypeDiagnostic: MN2PR12MB3870:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: onF3lXR0KWfxEtHzTgNVI413L5tfkiwzjPp9jGfuLZYOyURls/XcdGdllmCATQkADL3lS1gRxvveWJYEEgTCvG2+CINjKRnFTVZvSdiES75hyos1FoyOHyxbrUD7HxwVmspRovqt80OlvI4EV+o8JmROecHeaNdxo61k8VTgkrqHnK7qRLLg2GLa21LNSMJVBr+ZRAl3AsJVhB9Mq2nqXUkw2m3IwDiODcSK+BW6lSCm4XQhnRiMxBIAYG3LGzaMhy9j9LebwM24GMWIVmvDEhLnUa4gGhYtfR4+A9Y8jIr/6omXQfj52o0njkhoiD0v8JMDI4S6ZSSFYttQDvA6kwOao6qqsIQ7Ok4HIfaE3fqiatJ0HDxkAfo52U3MLIEqfUc6R9Ap4HcprLsltXct2VhA75uTZrEvOZeIDKzVKf5LTvgE6snNIMXmnqyr/bYyoTBZ62Bs3IQQbgEfOs+UEKMiCt6XpIdVbDujgYEd2MlENUQIyWDM4fKN5Ey22HOmpM+8jkrnkDJICwlIBwCw542gBdg4I0aOLr6IuO1q7+t14SvLydFzuosGFzZk/ntgRdaTyBo0bTldhLAr2njifBh+pPu1dc8XKHEfmbq7TzJFHqfi52liCJj748VpeP7Gyu/HrH9hu4JDvR/Tul54kLvSvr0JjqZyucRA5XY+7zSc40gWO6Knt/lxrVK5Bp9urgFTzW4T7K0c9sInHKJ1w9rfmMtWwcdlGAPWSruLCKE5Q4JAz7YDcbwfuIgTp4f95BJSylHgeeDmgK7FRGXNn5a/7ZpuiMlaWYKUGJZ8eUBNbgKODbg2pPdhLZ6uVPPz7Ry2vIaCoBtomgAx1nUKNAO6jP7iR/02pzRqpsbiIko= X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230016)(4636009)(39860400002)(346002)(136003)(376002)(396003)(40470700004)(46966006)(36840700001)(6200100001)(4326008)(5660300002)(8936002)(55016003)(83380400001)(47076005)(8676002)(6862004)(40480700001)(7049001)(82310400005)(16526019)(2906002)(6666004)(36860700001)(966005)(40460700003)(81166007)(82740400003)(356005)(478600001)(36756003)(86362001)(41300700001)(54906003)(37006003)(70206006)(316002)(70586007)(186003)(2616005)(6286002)(7696005)(426003)(53546011)(336012)(1076003)(26005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2022 08:05:56.1617 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01bb2152-d2d1-4682-5417-08da535cdea0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB3870 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 20.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/23/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/steevenlee/dpdk This queued commit can be viewed at: https://github.com/steevenlee/dpdk/commit/e8971ff299aa5167879e6c995b6da935e62194ee Thanks. Xueming Li --- >From e8971ff299aa5167879e6c995b6da935e62194ee Mon Sep 17 00:00:00 2001 From: Xueming Li Date: Sun, 8 May 2022 17:25:48 +0300 Subject: [PATCH] vdpa/mlx5: fix interrupt trash that leads to crash Cc: Xueming Li [ upstream commit 66a439c5d7c166347adc799fcc928058e16ac23d ] Disable interrupt unregister timeout to avoid invalid FD caused interrupt thread segment fault. Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell") Signed-off-by: Xueming Li Reviewed-by: Maxime Coquelin --- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c index 3d19cf5edb..c8c615054a 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c @@ -17,7 +17,7 @@ static void -mlx5_vdpa_virtq_handler(void *cb_arg) +mlx5_vdpa_virtq_kick_handler(void *cb_arg) { struct mlx5_vdpa_virtq *virtq = cb_arg; struct mlx5_vdpa_priv *priv = virtq->priv; @@ -55,19 +55,16 @@ static int mlx5_vdpa_virtq_unset(struct mlx5_vdpa_virtq *virtq) { unsigned int i; - int retries = MLX5_VDPA_INTR_RETRIES; int ret = -EAGAIN; - if (virtq->intr_handle.fd != -1) { - while (retries-- && ret == -EAGAIN) { + if (virtq->intr_handle.fd >= 0) { + while (ret == -EAGAIN) { ret = rte_intr_callback_unregister(&virtq->intr_handle, - mlx5_vdpa_virtq_handler, - virtq); + mlx5_vdpa_virtq_kick_handler, virtq); if (ret == -EAGAIN) { - DRV_LOG(DEBUG, "Try again to unregister fd %d " - "of virtq %d interrupt, retries = %d.", + DRV_LOG(DEBUG, "Try again to unregister fd %d of virtq %hu interrupt", virtq->intr_handle.fd, - (int)virtq->index, retries); + virtq->index); usleep(MLX5_VDPA_INTR_RETRIES_USEC); } } @@ -340,7 +337,7 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index) } else { virtq->intr_handle.type = RTE_INTR_HANDLE_EXT; if (rte_intr_callback_register(&virtq->intr_handle, - mlx5_vdpa_virtq_handler, + mlx5_vdpa_virtq_kick_handler, virtq)) { virtq->intr_handle.fd = -1; DRV_LOG(ERR, "Failed to register virtq %d interrupt.", -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-06-21 15:37:50.740757735 +0800 +++ 0031-vdpa-mlx5-fix-interrupt-trash-that-leads-to-crash.patch 2022-06-21 15:37:49.007784479 +0800 @@ -1 +1 @@ -From 66a439c5d7c166347adc799fcc928058e16ac23d Mon Sep 17 00:00:00 2001 +From e8971ff299aa5167879e6c995b6da935e62194ee Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 66a439c5d7c166347adc799fcc928058e16ac23d ] @@ -10 +12,0 @@ -Cc: stable@dpdk.org @@ -15,2 +17,2 @@ - drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 20 ++++++++------------ - 1 file changed, 8 insertions(+), 12 deletions(-) + drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 17 +++++++---------- + 1 file changed, 7 insertions(+), 10 deletions(-) @@ -19 +21 @@ -index 3416797d28..2e517beda2 100644 +index 3d19cf5edb..c8c615054a 100644 @@ -31 +33 @@ -@@ -59,20 +59,16 @@ static int +@@ -55,19 +55,16 @@ static int @@ -38 +40 @@ -- if (rte_intr_fd_get(virtq->intr_handle) != -1) { +- if (virtq->intr_handle.fd != -1) { @@ -40 +42 @@ -+ if (rte_intr_fd_get(virtq->intr_handle) >= 0) { ++ if (virtq->intr_handle.fd >= 0) { @@ -42 +44 @@ - ret = rte_intr_callback_unregister(virtq->intr_handle, + ret = rte_intr_callback_unregister(&virtq->intr_handle, @@ -48,4 +50 @@ -- "of virtq %d interrupt, retries = %d.", -- rte_intr_fd_get(virtq->intr_handle), -- (int)virtq->index, retries); -- +- "of virtq %d interrupt, retries = %d.", @@ -53 +52,2 @@ -+ rte_intr_fd_get(virtq->intr_handle), + virtq->intr_handle.fd, +- (int)virtq->index, retries); @@ -58,4 +58,4 @@ -@@ -359,7 +355,7 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index) - goto error; - - if (rte_intr_callback_register(virtq->intr_handle, +@@ -340,7 +337,7 @@ mlx5_vdpa_virtq_setup(struct mlx5_vdpa_priv *priv, int index) + } else { + virtq->intr_handle.type = RTE_INTR_HANDLE_EXT; + if (rte_intr_callback_register(&virtq->intr_handle, @@ -65 +65 @@ - rte_intr_fd_set(virtq->intr_handle, -1); + virtq->intr_handle.fd = -1;