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 09AA0A0511 for ; Sun, 8 May 2022 16:26:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02505427F8; Sun, 8 May 2022 16:26:43 +0200 (CEST) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2042.outbound.protection.outlook.com [40.107.237.42]) by mails.dpdk.org (Postfix) with ESMTP id 0452740395; Sun, 8 May 2022 16:26:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RRhhij/jv5qQGQjZSCy9T2bu67Y2vQmA/Y1TLMNUGNSI3IyJKsLUjMnvMguBvTvqfy67IlfIZVk5ug2si4LJ1A0hYMUlPWN3s+ClVesuP04HdTNgd6G0f2W/eo9lwOpBExGO4KZBvp74jV7dMPskcLlEoay6wVBhK+oEbnqWbJGhCs6sgFbMGbhSJDJcUIuHv/WPNE6rovwqObb8rE77wy6vBUCc8FZkOubXp21EqZKXUiPMwHewIA3YtXaC3lzwLmPtQmmOE1WMMDa2YrUGwScbf9yNht00HPRhu+w7z7CUXT5YHem8PzXWAte0JDdaB9j/HqFstXfv8fyfAz+IUQ== 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=vLuozA3QDxnSx1PJsfBlVwJ/+3u1p7fBxPpxpvkJ3Ss=; b=IJjc/+cCJNW6C6Tb9ZPsQY/OHe2TCTFU88zsCHeBhgQQPrbnMvmGWWQJy9Bd+h8VjvJOfRB9oGfO3NpME0wXbsmarQDAQj9ike8hj6sxh8CwmP5PqJsVY0VihUouVVqp+VHY6Oy8n+BvtHDirlA0xWDXr61Houp3oMJSfMppn6qQ7BxFUMe0Gj3LkwgxNoPE3t9FnONl5cFqH9wVFEy0wyrdZLWmEJ5jblHEtiJazXH6SHtmmD54ji2rKsBTFUn5NdBi1ylit04jOIkDrGeS7YyKC8DCo9MS9HY79KUjeBLlgp4fVglNBQ8ns5VKihBvMqEAz/mzD4b2b3zN7LvDQA== 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=vLuozA3QDxnSx1PJsfBlVwJ/+3u1p7fBxPpxpvkJ3Ss=; b=hX5d2+YxHAatezYaWIWdVP44xFMpHkcELMaUwZc/eHK+cA590+PVkpjkTnjA18qNcWZdAu1f5UJHK1gIEYlMDY3BQGBu0eMwm82mis87ZH6JkopMOX+3AHZdcecDE5+n7vsnYURu8g2fl91TSMvktbcD2mnq/EqdSjxlvpAPYsP+EYJ+nq1qOZoukdGXnw41bvN86gEiTkpT4M3qzJxRo9cwQ5k971FLGHIdcOkrYpoFdwIPBDL9ox5z3xnJWa/JQLmf1uauWtJNoUlnYCoKh1wO/zPLi0ivbKBKrANqMR4/wI0XKbyyjx7S03t+bi5hCSI93LZN6z96RJri1O3PJA== Received: from MW4PR03CA0208.namprd03.prod.outlook.com (2603:10b6:303:b8::33) by DM6PR12MB4514.namprd12.prod.outlook.com (2603:10b6:5:2a7::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20; Sun, 8 May 2022 14:26:38 +0000 Received: from CO1NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b8:cafe::ab) by MW4PR03CA0208.outlook.office365.com (2603:10b6:303:b8::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.20 via Frontend Transport; Sun, 8 May 2022 14:26:38 +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; Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT017.mail.protection.outlook.com (10.13.175.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5227.15 via Frontend Transport; Sun, 8 May 2022 14:26:38 +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; Sun, 8 May 2022 14:26:38 +0000 Received: from nvidia.com (10.126.231.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; Sun, 8 May 2022 07:26:36 -0700 From: Xueming Li To: , Maxime Coquelin CC: , , Subject: [PATCH v3 1/7] vdpa/mlx5: fix interrupt trash that leads to segment fault Date: Sun, 8 May 2022 17:25:48 +0300 Message-ID: <20220508142554.560354-2-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220508142554.560354-1-xuemingl@nvidia.com> References: <20220224132820.1939650-1-xuemingl@nvidia.com> <20220508142554.560354-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.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: bc22d350-61fa-4bcd-6364-08da30fec37c X-MS-TrafficTypeDiagnostic: DM6PR12MB4514: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: AhPgmXHiLnwdt/F6GEBL54Tb+r5dg8jsPSDm5eCeQzl/3Kf2oMBx+3TEKO/Hmie1Foq8RAFoNz0JGuUm+jH7DZxQIvZ8FLJaHGSZkAZ9qtw+B4ziBCkSle9VB1BAFjxVuXm2kcZeesAxyLsEfIyeIvT9Xj1wBn1dbT9go55L7wjNx0dDYU/iSQzuS3YT1bo4c/t/EmF3yn1g8FcNK5gSBQWYtZ4rC1MzdkVTDv+Ar0Xi0yCpSUkiUUyoWRX3YT6vKZ69jhALN5oA5svlnvEzXZe4KgZSx4SYYxOOgfIAp9AkFlO5HqplD7vyMnNb+xIu8/EA/yonjM920N8SxPThwPVvyLKWjTJhShgEzuNQjlKoPbCbvslvIvDmHWaNFS75BlTAcz5ZunBtOP5NB1bLZQrbKgcXXQxh55UsawcpYeY/h12FCksmXXbkkId4eugQc8b6hvrc9/19SYUPY0VzDyivJ0nFCCmPbNt6KfrL3a6othJvGsNG0gLb5xsVvXkpsTiR2HjpyGuOLU4yIHHqiyPwfh3QFXHizyk1SoG9ZgoFChFbJbRq1xfdbkSVWeyuSS2qHMwjDNbk2t4rVYx9o3//BjiNqlvBobw6jyTsHwesfsOu7FVOhG9ECbFYyVPR/Hd75D16yu0kvb23iINorjxGYtzdfrcBbpRLlINeREQgpo34AMOOcfZpTnOpjUEwSSp9LKgC8yBGdg0h3JWSxA== 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:(13230001)(4636009)(40470700004)(46966006)(36840700001)(1076003)(55016003)(8936002)(508600001)(36860700001)(83380400001)(426003)(356005)(54906003)(110136005)(336012)(316002)(16526019)(186003)(36756003)(47076005)(8676002)(7696005)(4326008)(6666004)(2906002)(82310400005)(26005)(81166007)(70206006)(70586007)(2616005)(5660300002)(86362001)(40460700003)(6286002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2022 14:26:38.4944 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bc22d350-61fa-4bcd-6364-08da30fec37c 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: CO1NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4514 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 Disable interrupt unregister timeout to avoid invalid FD caused interrupt thread segment fault. Fixes: 62c813706e41 ("vdpa/mlx5: map doorbell") Cc: matan@mellanox.com Cc: stable@dpdk.org Signed-off-by: Xueming Li Reviewed-by: Maxime Coquelin --- drivers/vdpa/mlx5/mlx5_vdpa_virtq.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c b/drivers/vdpa/mlx5/mlx5_vdpa_virtq.c index 3416797d289..2e517beda24 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; @@ -59,20 +59,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 (rte_intr_fd_get(virtq->intr_handle) != -1) { - while (retries-- && ret == -EAGAIN) { + if (rte_intr_fd_get(virtq->intr_handle) >= 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.", - rte_intr_fd_get(virtq->intr_handle), - (int)virtq->index, retries); - + DRV_LOG(DEBUG, "Try again to unregister fd %d of virtq %hu interrupt", + rte_intr_fd_get(virtq->intr_handle), + virtq->index); usleep(MLX5_VDPA_INTR_RETRIES_USEC); } } @@ -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, - mlx5_vdpa_virtq_handler, + mlx5_vdpa_virtq_kick_handler, virtq)) { rte_intr_fd_set(virtq->intr_handle, -1); DRV_LOG(ERR, "Failed to register virtq %d interrupt.", -- 2.35.1