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 6B845A00C5 for ; Wed, 20 Jul 2022 10:22:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6349A40697; Wed, 20 Jul 2022 10:22:15 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2045.outbound.protection.outlook.com [40.107.92.45]) by mails.dpdk.org (Postfix) with ESMTP id 5FA354003C for ; Wed, 20 Jul 2022 10:22:14 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AYXokT8ZehrIQQG0e9Od56HFm4ygHzKulAkCvsbDtwwBHA4FyIO9MFQm3oNdsRgFgTOZIrj2PEHYT4UT76HT9/y9pWCQ2sFgNrdRHz2EOSy3Xzw9POUfGpA173pBmuSMnKiso+8uzAnSqyf51EXczITEIQhRUaArBsQiE87+9NkYSsFXuj/wZjvLVWaGP6fNjsTjJbRwilgf1wGPqGiSKEi0j66j/A1Jx+8A+8VRm8npX4gxZCuo7HBLt30pDZIuK6BxJ+AP6stNlzCST6BBBj2U5yNB4W2i1N/QUm0OeoLyrj/hb5vEXkVvufsy5RAzv67q/1sFLcYuZkRqTjdHUw== 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=x3dYOMUwHEfWhYGpX457eVJUD5exXBdVcotm3u0uyzE=; b=BIMaLS1keiVQMtx3k9ZjWeBymtB6kfknBBsrqrr4kPfmh5XQrK2tdpZzdQlEbIL42eu/sTl5jD8MdPmD7n30GjhGNf3U7dCzELx/KRp5Nvhi4I79l+O+Z//zTSQUa36CnQaON6QOCRkD/gcqBgcv3VOTyvIZmQ8qeXYXfYgAK2WBXH1AMHpvgGuCvR7bzktrbg6ba+9IpiXuD6f+cGSi/qyhoOxEbyVXGQgPUN6xYW74BsqxeIe+tiyZgAgJybEVidX2sOVcn3vijkZQ3ZRSgDREqipEw6YVUJ74+TRvF1NzOFbUD0MH+Oyv8vJrnOco1MdnQ+XdiCP9CpLfl+X7rQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=marvell.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=x3dYOMUwHEfWhYGpX457eVJUD5exXBdVcotm3u0uyzE=; b=WzoOBVZF08fiu2brMONhSk7c0EbnamCBv7i567LH0VnxWMZOyFyeC5HDiFb+A0mIBv2x11TLVf3hbb1W3HD4APIpux0oP2OgwF+TPQOYZunjqoSn16jgEtxEf2jISFWW61CTEaFXghWAkFgNK0qfeISNgEH5bWcXIlchBwnBz76ZV0tlpxsWn4KdwjqLZIzkvupj8D7MlGcHprdXH7SbCvYMKL3EDPz+iKzYvFgX1lhq1spuA2DUWSbmoNziVBaMN53U4m2llnQNzUGML4Bm5zeKNkIs/44zoJZKR5NzNATGfJRg1qn9L9Zxpw6OzKTtL3S7URCvpJd1zRXBeXDLRw== Received: from BN9P221CA0024.NAMP221.PROD.OUTLOOK.COM (2603:10b6:408:10a::23) by PH7PR12MB6417.namprd12.prod.outlook.com (2603:10b6:510:1ff::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.23; Wed, 20 Jul 2022 08:22:12 +0000 Received: from BN8NAM11FT024.eop-nam11.prod.protection.outlook.com (2603:10b6:408:10a:cafe::2) by BN9P221CA0024.outlook.office365.com (2603:10b6:408:10a::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.19 via Frontend Transport; Wed, 20 Jul 2022 08:22:12 +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 BN8NAM11FT024.mail.protection.outlook.com (10.13.177.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5458.17 via Frontend Transport; Wed, 20 Jul 2022 08:22:11 +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; Wed, 20 Jul 2022 08:22:11 +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.26; Wed, 20 Jul 2022 01:22:09 -0700 From: Xueming Li To: Chengwen Feng CC: , David Marchand , "Jerin Jacob" , dpdk stable Subject: patch 'trace: fix init with long file prefix' has been queued to stable release 20.11.6 Date: Wed, 20 Jul 2022 11:20:32 +0300 Message-ID: <20220720082132.3954126-3-xuemingl@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220720082132.3954126-1-xuemingl@nvidia.com> References: <20220621080301.2315720-1-xuemingl@nvidia.com> <20220720082132.3954126-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: 157a4f19-57fe-400f-bb28-08da6a28f21e X-MS-TrafficTypeDiagnostic: PH7PR12MB6417:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?+DTH/IeARF1IV2WLPePMErVxKgGIP2HZ0KtmYqTxRFG6PeOriICtwtafrc+5?= =?us-ascii?Q?+LfOKgKWxsl+LCSW/6lE8ec1Klt7kKVyk4LGS8pzURCS+W0Z2gFM1weJ81iU?= =?us-ascii?Q?7qh3oIL51AIcSFCAcXgifXtTxM6kqgbQiVmdpZfqdFIw9N4p/eMtuHBI8LT/?= =?us-ascii?Q?f+lImr6bqX+i/LP8GCplCIgx75zKVaYPU/mOGaierU28N0kJ2eFUjWde0B9i?= =?us-ascii?Q?Qh8vowAiuQfY1BylY8MbANk0kMInFnoWtrtCfnxaEVjjBKPazWiOXby7fKJw?= =?us-ascii?Q?Y8gtIxW8fb6fQZqs/5NDLmedSeaS5BGp4gE2DiOYnhmcWqx5h2/Hc/kh+817?= =?us-ascii?Q?57DrsVU7iowADKc46YVoO8i5X46Tt8sdmAxDRaS2BsMJ5rwi3qmUhr22lpdV?= =?us-ascii?Q?aWbWnu+67xOBEOBABaufGLEXfoCPBt8tdK434hOwPyd50SKeizxNy3PYCyh8?= =?us-ascii?Q?kCOtJlIL3KNWnzfHlCu9+maw1blVrJFtU3beQoxNFOAc/8eJcslGVLrYgU3x?= =?us-ascii?Q?kXnL1wBE1Qp3+j3gwaa3hz11RrdsIjfbeBqPzMmg3naG9pDO9ZofiC4tSLvk?= =?us-ascii?Q?30hSDx63LSfQ1efpA2dsHQxbNqXU/xA4HJDcPWoIFgX9NClhhF+q63uVg4Ma?= =?us-ascii?Q?J7UbSbGbnSeJp7rVcNRtYDkbFrSEqvMYNTk62r2NCNKHss3qDYkKPwYoMcFM?= =?us-ascii?Q?0ebP1WeVUY+f5lPvRdHeWCjVlEhxwxPY/tpbicsJParGywi9BH+fOmR6tqAZ?= =?us-ascii?Q?7AkvC4HE0uvvIv8L9DeMmOXufK/cidFVDfa54lI2nxMyDPl2R+fF/m5Y5z+M?= =?us-ascii?Q?xewrUbLVgowe5SXXLSTK7DAYmcqVtNbdnL3X0L5ZnJV3SVD++PTJvVfw7xah?= =?us-ascii?Q?XunbnPQqlYDOEyxhZjAMmiXtKQY3To2WDGCzTL86xvAhaDOHlbA2Tfwd6quT?= =?us-ascii?Q?U+jRkX172vriX199e04d+Q=3D=3D?= 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)(346002)(136003)(39860400002)(396003)(376002)(40470700004)(36840700001)(46966006)(70586007)(478600001)(6286002)(6666004)(6916009)(7696005)(53546011)(41300700001)(2906002)(54906003)(81166007)(55016003)(8936002)(4326008)(40480700001)(316002)(82310400005)(8676002)(26005)(2616005)(966005)(5660300002)(356005)(36860700001)(36756003)(82740400003)(70206006)(40460700003)(426003)(336012)(83380400001)(47076005)(1076003)(16526019)(86362001)(186003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2022 08:22:11.8120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 157a4f19-57fe-400f-bb28-08da6a28f21e 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: BN8NAM11FT024.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6417 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 07/22/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/a6388c75952c77411d8bdea305433283428ada55 Thanks. Xueming Li --- >From a6388c75952c77411d8bdea305433283428ada55 Mon Sep 17 00:00:00 2001 From: Chengwen Feng Date: Fri, 17 Jun 2022 10:29:11 +0800 Subject: [PATCH] trace: fix init with long file prefix Cc: Xueming Li [ upstream commit d59a940667989461e2916207e7fbb8148504c44f ] Bug scenario: 1. start testpmd: $ dpdk-testpmd -l 4-6 -a 0000:7d:00.0 --trace=.* \ --file-prefix=trace_autotest -- -i 2. then observed: EAL: eal_trace_init():93 failed to initialize trace [File exists] EAL: FATAL: Cannot init trace EAL: Cannot init trace EAL: Error - exiting with code: 1 The root cause it that the offset set wrong with long file-prefix and then lead the strftime return failed. At the same time, trace_session_name_generate() uses errno as the return value, but the errno was not set if strftime returned zero. A previously set errno (EEXIST or ENOENT from call to mkdir for creating the runtime configuration directory) was returned in this case. This is fragile and may lead to incorrect logic if errno was set to 0 previously. This also resulted in inaccurate prompting. Set errno to ENOSPC if strftime return zero. Fixes: 321dd5f8fa62 ("trace: add internal init and fini interface") Signed-off-by: Chengwen Feng Reviewed-by: David Marchand Acked-by: Jerin Jacob --- lib/librte_eal/common/eal_common_trace_utils.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/common/eal_common_trace_utils.c b/lib/librte_eal/common/eal_common_trace_utils.c index 64f58fb66a..2b55dbec65 100644 --- a/lib/librte_eal/common/eal_common_trace_utils.c +++ b/lib/librte_eal/common/eal_common_trace_utils.c @@ -104,13 +104,15 @@ trace_session_name_generate(char *trace_dir) rc = rte_strscpy(trace_dir, eal_get_hugefile_prefix(), TRACE_PREFIX_LEN); if (rc == -E2BIG) - rc = TRACE_PREFIX_LEN; + rc = TRACE_PREFIX_LEN - 1; trace_dir[rc++] = '-'; rc = strftime(trace_dir + rc, TRACE_DIR_STR_LEN - rc, "%Y-%m-%d-%p-%I-%M-%S", tm_result); - if (rc == 0) + if (rc == 0) { + errno = ENOSPC; goto fail; + } return rc; fail: -- 2.35.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-07-20 15:00:58.963368636 +0800 +++ 0003-trace-fix-init-with-long-file-prefix.patch 2022-07-20 15:00:58.641000610 +0800 @@ -1 +1 @@ -From d59a940667989461e2916207e7fbb8148504c44f Mon Sep 17 00:00:00 2001 +From a6388c75952c77411d8bdea305433283428ada55 Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit d59a940667989461e2916207e7fbb8148504c44f ] @@ -29 +31,0 @@ -Cc: stable@dpdk.org @@ -35 +37 @@ - lib/eal/common/eal_common_trace_utils.c | 6 ++++-- + lib/librte_eal/common/eal_common_trace_utils.c | 6 ++++-- @@ -38 +40 @@ -diff --git a/lib/eal/common/eal_common_trace_utils.c b/lib/eal/common/eal_common_trace_utils.c +diff --git a/lib/librte_eal/common/eal_common_trace_utils.c b/lib/librte_eal/common/eal_common_trace_utils.c @@ -40,2 +42,2 @@ ---- a/lib/eal/common/eal_common_trace_utils.c -+++ b/lib/eal/common/eal_common_trace_utils.c +--- a/lib/librte_eal/common/eal_common_trace_utils.c ++++ b/lib/librte_eal/common/eal_common_trace_utils.c