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 C2750428F8 for ; Sun, 9 Apr 2023 17:33:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B5B6E410EF; Sun, 9 Apr 2023 17:33:55 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2067.outbound.protection.outlook.com [40.107.94.67]) by mails.dpdk.org (Postfix) with ESMTP id 01C6E4067E for ; Sun, 9 Apr 2023 17:33:54 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dH5CxvdhMVWQQnmOdkUvXQXC5E3ZzHi6dfpRpt6C6RIzW3JNrAb8UPTV7ExMP86cxN5ZurDE7/W4WsYh5UV/aZePVBwc7BrOzj9+HodNUlOoQBaGsji8RJ7615xFnxpzNALUPWw9uQ30P/7whBHgt/dfTFKFDwCSs0Uxy76C/p8UaQwlCqMBVolCsyDdPDDY/ZFVtQeWfNUY5ksDjdA9dxnkHA4KE9L51qiGSOgU/NR5p1wl9DBJ5Kzy1SNdt0JxwFgAULXNsQqua4Ooy2tsoJu24c/bjWqghmGUBoO6pBJKpObZWjzxvFUbC+e/62jCwINcMzHylAMe3NLr323fmQ== 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=Dzwgq4+YfQNmD+v49HW2NlL5Eb1dqCXp0tMUzip87qs=; b=aW/cKj5bgBoWWhiZG9jYRZXPJ4yswPWuKDM+tweS5ym/w6ZBQkSD7A0Ndsv1vi3UaEjH/yKUlPhXkixwc07q/R+nPNuvGRiBcXqYzKSZhmAaOHQAJquvnYbSVWXkKNTYrwSk3xbCJgaWwB+v/i3+mlubB7gok9/POozdMDGEDVTAfjIBegAs3MZ2SGqy0JNpvekEKzbLHSa4d0JQB7/rEih6qW749mKY8zHii0G3l9WmGzVjfUniO2aeVdZpZpBzQ4sV3SAYKqphxUXXXn9zzx2VOz2/8Z+I13RB97Pili6tL45kNhdL6fJpIdfnCtsNmhcN81Bgn2wGzF6nSEOcdw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=redhat.com 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=Dzwgq4+YfQNmD+v49HW2NlL5Eb1dqCXp0tMUzip87qs=; b=oXc49TdQbChCoQsyhBERn4UMLqZsNYonA6v+u3mYZ8dS6lw1EuuZVFRkMpGOpj28Vt9QMgF3ZO0ev8IqiEBNPBWKUAagjNPcEOLE98i247RsNPRfndgqVd+0f7hYB8efEkt75Q5f+yWt5284gxrDIbVyZgJ52EUbUtnccfp5BwgrxRp80G8+seSkfNiNG/+Oo0mzr+VElprD+G/WxA/oDEVbvQuIs59Ouh33hrSb58TzhoFR92E3uxnWifHHaJI1WaIkzEvs5epM99noelEvEObry44it80q7RCAt4UZOAhLyxkTVPJgoXGJ1o4GhL5+3hjQkSRnkgIoOjHqwcLCtA== Received: from MW4PR04CA0233.namprd04.prod.outlook.com (2603:10b6:303:87::28) by MW3PR12MB4586.namprd12.prod.outlook.com (2603:10b6:303:53::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Sun, 9 Apr 2023 15:33:52 +0000 Received: from CO1NAM11FT025.eop-nam11.prod.protection.outlook.com (2603:10b6:303:87::4) by MW4PR04CA0233.outlook.office365.com (2603:10b6:303:87::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38 via Frontend Transport; Sun, 9 Apr 2023 15:33:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CO1NAM11FT025.mail.protection.outlook.com (10.13.175.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.20 via Frontend Transport; Sun, 9 Apr 2023 15:33:51 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.5; Sun, 9 Apr 2023 08:33:51 -0700 Received: from nvidia.com (10.126.230.37) 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.37; Sun, 9 Apr 2023 08:33:49 -0700 From: Xueming Li To: David Marchand CC: Yu Jiang , Hemant Agrawal , dpdk stable Subject: patch 'raw/skeleton: fix selftest' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:24:43 +0800 Message-ID: <20230409152529.5308-96-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1NAM11FT025:EE_|MW3PR12MB4586:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a0ebfe9-fbf5-4e8b-ba6f-08db390fd264 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XtppzMmrwN64UCfmfkNfkSTOtYyK1mFkY3QTVLx8W3ktqJKMMfeCvHZuCkmRHGG5D001c9PQd9oo1HaKf+LyKD0pQvB2SlukV+8UgmN/KkSl2eBB6xj4ng4SdPqrrsEjkY3lCg36dd6DGh7bRZOeX7mDL1JBUgyxtnvX1DULGiZdCeLD7cMEyAjgSBF/pKI8Ee+pHXX1LEUhAX2U0WJZ0ix+fS/Byw0hTarUcf3dHjSkd49j4OcEX1KmwpVMMh7r7GYbU1fgR1boe1pmsjr2tV6kQBuw8xhW8l8FZQbZeOCSeh/mIjDCjzivG1OJskOCn1eqE3yz1eMl8w5eMOu6FxgtJNjlG29JEyqzkzew5raR4jTiq1EXoogBBNHdS0rU11TYIi/zzavOGuofqXrHV4acxMXaOmcL3YdAjWM/ZfBR2J5UKez2mF9svKgU8y5C9c5MZagAq6FQmshrn0P61y1KS1qnapLbaYpgxlXO4zv3QarM/HJNX54ikSBf/c7ZaEOUt/KREzpbzUyXuylK9s5hY1f+B5sbryvqLrpq74yXwj4edXsxYYCUP8jL4pDK8r+24DslZuneZ+0sdSkYLQOYj0q3npOneUhM2EZfdj8cRcV0TZiF9UF5wsK74ebJfG+8i77+MzRqTa1sGXmszO0ld3jL5+b6ZF3DB5cFMC+c9EAoKqXNlIdZ9FxQZKV+oTm5JdmMzhM7w36jeMZmb4PvT+imWr1HP58vyLVWig9YJ28rmYXgruMzXt+wxroT62pzWtAxQRJ7AIU7Qf0GOGa05LWykzC6BBJQxvSyhYny6GMllOtU53cro+TC4wfscRM8scDuwOBJDVyR2CWHbtGhq6KTruOEK9/L95cJ8AMVOCQjIjS8B+JF9b5sNWfL X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230028)(4636009)(39860400002)(136003)(346002)(396003)(376002)(451199021)(36840700001)(40470700004)(46966006)(7696005)(478600001)(86362001)(55016003)(40480700001)(83380400001)(47076005)(36756003)(40460700003)(82740400003)(7636003)(356005)(2616005)(36860700001)(426003)(336012)(6666004)(966005)(2906002)(54906003)(316002)(16526019)(6286002)(186003)(1076003)(53546011)(26005)(8676002)(6916009)(41300700001)(8936002)(5660300002)(82310400005)(4326008)(70586007)(70206006); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:33:51.9229 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a0ebfe9-fbf5-4e8b-ba6f-08db390fd264 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT025.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4586 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 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 04/11/23. 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://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/ebcd68e43a55bdc6bc40b0a5a801940d5b5c75be Thanks. Xueming Li --- >From ebcd68e43a55bdc6bc40b0a5a801940d5b5c75be Mon Sep 17 00:00:00 2001 From: David Marchand Date: Fri, 10 Mar 2023 15:26:03 +0100 Subject: [PATCH] raw/skeleton: fix selftest Cc: Xueming Li [ upstream commit 365ec3c4fe599048c67cc79817ae9dfa090753cc ] ASan reported issues in this driver. rte_rawdev_obj_t context object points at a uint16_t. skeleton_rawdev_enqueue_bufs() and skeleton_rawdev_dequeue_bufs() were incorrectly casting to an int. The enqueue/dequeue selftest had a leak on the enqueued string and was wrong in passing a rte_rawdev_buf pointer array. Fix this by allocating buffers on the stack and check that returned string is the expected one. Bugzilla ID: 999 Fixes: 61c592a8d035 ("raw/skeleton: introduce skeleton rawdev driver") Fixes: 55ca1b0f2151 ("raw/skeleton: add test cases") Signed-off-by: David Marchand Tested-by: Yu Jiang Acked-by: Hemant Agrawal --- drivers/raw/skeleton/skeleton_rawdev.c | 4 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 46 +++++++++------------ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c index 53fe49f936..6e99d35536 100644 --- a/drivers/raw/skeleton/skeleton_rawdev.c +++ b/drivers/raw/skeleton/skeleton_rawdev.c @@ -428,7 +428,7 @@ static int skeleton_rawdev_enqueue_bufs(struct rte_rawdev *dev, * help in complex implementation which require more information than * just an integer - for example, a queue-pair. */ - q_id = *((int *)context); + q_id = *((uint16_t *)context); for (i = 0; i < count; i++) queue_buf[q_id].bufs[i] = buffers[i]->buf_addr; @@ -450,7 +450,7 @@ static int skeleton_rawdev_dequeue_bufs(struct rte_rawdev *dev, * help in complex implementation which require more information than * just an integer - for example, a queue-pair. */ - q_id = *((int *)context); + q_id = *((uint16_t *)context); for (i = 0; i < count; i++) buffers[i]->buf_addr = queue_buf[q_id].bufs[i]; diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c index ca15c49990..b7a7f623aa 100644 --- a/drivers/raw/skeleton/skeleton_rawdev_test.c +++ b/drivers/raw/skeleton/skeleton_rawdev_test.c @@ -370,40 +370,34 @@ static int test_rawdev_enqdeq(void) { int ret; - unsigned int count = 1; uint16_t queue_id = 0; - struct rte_rawdev_buf buffers[1]; - struct rte_rawdev_buf *deq_buffers = NULL; - - buffers[0].buf_addr = malloc(strlen(TEST_DEV_NAME) + 3); - if (!buffers[0].buf_addr) - goto cleanup; - snprintf(buffers[0].buf_addr, strlen(TEST_DEV_NAME) + 2, "%s%d", + struct rte_rawdev_buf buffer; + struct rte_rawdev_buf *buffers[1]; + struct rte_rawdev_buf deq_buffer; + struct rte_rawdev_buf *deq_buffers[1]; + + buffers[0] = &buffer; + buffer.buf_addr = malloc(strlen(TEST_DEV_NAME) + 3); + if (!buffer.buf_addr) + return TEST_FAILED; + snprintf(buffer.buf_addr, strlen(TEST_DEV_NAME) + 2, "%s%d", TEST_DEV_NAME, 0); - ret = rte_rawdev_enqueue_buffers(test_dev_id, - (struct rte_rawdev_buf **)&buffers, - count, &queue_id); - RTE_TEST_ASSERT_EQUAL((unsigned int)ret, count, + ret = rte_rawdev_enqueue_buffers(test_dev_id, buffers, + RTE_DIM(buffers), &queue_id); + RTE_TEST_ASSERT_EQUAL((unsigned int)ret, RTE_DIM(buffers), "Unable to enqueue buffers"); - deq_buffers = malloc(sizeof(struct rte_rawdev_buf) * count); - if (!deq_buffers) - goto cleanup; - - ret = rte_rawdev_dequeue_buffers(test_dev_id, - (struct rte_rawdev_buf **)&deq_buffers, - count, &queue_id); - RTE_TEST_ASSERT_EQUAL((unsigned int)ret, count, + deq_buffers[0] = &deq_buffer; + ret = rte_rawdev_dequeue_buffers(test_dev_id, deq_buffers, + RTE_DIM(deq_buffers), &queue_id); + RTE_TEST_ASSERT_EQUAL((unsigned int)ret, RTE_DIM(buffers), "Unable to dequeue buffers"); + RTE_TEST_ASSERT_EQUAL(deq_buffers[0]->buf_addr, buffers[0]->buf_addr, + "Did not retrieve expected object"); - free(deq_buffers); - + free(buffer.buf_addr); return TEST_SUCCESS; -cleanup: - free(buffers[0].buf_addr); - - return TEST_FAILED; } static void skeldev_test_run(int (*setup)(void), -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:41.201324700 +0800 +++ 0095-raw-skeleton-fix-selftest.patch 2023-04-09 21:45:38.719042200 +0800 @@ -1 +1 @@ -From 365ec3c4fe599048c67cc79817ae9dfa090753cc Mon Sep 17 00:00:00 2001 +From ebcd68e43a55bdc6bc40b0a5a801940d5b5c75be Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 365ec3c4fe599048c67cc79817ae9dfa090753cc ] @@ -20 +22,0 @@ -Cc: stable@dpdk.org