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 6702445D01; Thu, 14 Nov 2024 08:45:06 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C40B542DF0; Thu, 14 Nov 2024 08:44:59 +0100 (CET) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2080.outbound.protection.outlook.com [40.107.21.80]) by mails.dpdk.org (Postfix) with ESMTP id A3C1042DCE for ; Thu, 14 Nov 2024 08:44:58 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FRAaYZe4VAv2+HBGNpBeEUTMjXAbmp+Md+KBBzXQfgNMAizuxE2B2e4WaDjPLlxRJoRQIxf297Q7EanWyJADt1Z+lU1gXW1GDpyFQ/xYs4ic/VvLcrifAQYfAsNhIRNCwkv2D9zVeOumpep100TY4Jv5oB+VV3WYgN7dwH9SMEgikpGgjPK3JYBKxu8qKVfy4f6lzxQQ40wPhFLhCaiah+cycR0qTy65LHt8jyb44t96zCcJtT3rBj1/lCLZ9PimqBs7N+IM2v0XnNFdCpKLVTuH/H26NqAI1kRo5YP/lfvNl8j8Sgb87KdY+k28+kGO5qZEq6Qk930t2Zn5drEOxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=uxWhVt2F154Jhyax5yGehW4hSvI4oHYV0sAUhQTq5M8=; b=L4O5cWOST0bMgl4Oz+945sBl4K69nCmByIr5xEIFSxeo9XWVzKMr+JiN9CoOq9wakzLTDuJliSd2YIou2OQPgLWfkhS/8NTqCUe9DT3eCkv+jigQAyhepAm1pwQVwOmdn0VBYRlILBADOPC1aDmDJyLxtQla3PCDpYUmoi3ZBnFSFDuWdl0CEcxq58LXtpTRz0T+NQ6ZIJA250H0YGiHLQtYp04YDyFid6w3g3BWuAQ8QmxxTpKFbRh6VTlfGw5MYJDESlyml2vBnVgDXf84Htq+rbVwqQuFxAJ0xq0zKKZH0HDw5gOoVlcGHZ0vn+6YdwT/nM0+GLv2REDm5fcrFA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uxWhVt2F154Jhyax5yGehW4hSvI4oHYV0sAUhQTq5M8=; b=XRa8u+TvAQ7SdmXoIpKTQCiz8cMRSUaz6TQE+wGb7AzcKsIEyXr5Ajrp4+uz6o0Ji5ot+ZHn0kG30MsPivK5asik/y6RECMCuzrw8RMnCysAtdKdWzcj5oKnx0DfF2tw5kQnVCMYqTsLwwHBQY2Vt1xKXbBSP1sBERzgcoTw4WmcVBBX6tPS9x6TWfeIeva6GIcVCxjzJnA+X00EIMvYKNQSMrKqlac1omKNPClNNhRgGaTxJXOUzToixWm2EUzgp9ZhUy6Vqrjdm9GF673ATflhVzAqu/4GCPMwVbQWJUU20jVfztPqdtJXIHThm0AR+yndd+mAgROKY74I8w04HA== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) by GV1PR04MB10380.eurprd04.prod.outlook.com (2603:10a6:150:1cc::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Thu, 14 Nov 2024 07:44:56 +0000 Received: from PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87]) by PAXPR04MB9328.eurprd04.prod.outlook.com ([fe80::367:d59:375:fb87%4]) with mapi id 15.20.8137.027; Thu, 14 Nov 2024 07:44:56 +0000 From: Hemant Agrawal To: thomas@monjalon.net, dev@dpdk.org, david.marchand@redhat.com Cc: stephen@networkplumber.org Subject: [PATCH v2 3/3] bus/dpaa: enabling clang thread safety for locks Date: Thu, 14 Nov 2024 13:14:37 +0530 Message-Id: <20241114074437.2943885-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20241114074437.2943885-1-hemant.agrawal@nxp.com> References: <20241113161455.2649551-1-hemant.agrawal@nxp.com> <20241114074437.2943885-1-hemant.agrawal@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0007.apcprd02.prod.outlook.com (2603:1096:4:194::23) To PAXPR04MB9328.eurprd04.prod.outlook.com (2603:10a6:102:2b6::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9328:EE_|GV1PR04MB10380:EE_ X-MS-Office365-Filtering-Correlation-Id: de33609f-ec1b-4f25-e161-08dd04803bef X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|376014|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?9y+vTz0et8LTVK/SRteWaUZ7dlNLnK6wTf8suJJmQPlBQXP2rLfEc4/Ta81F?= =?us-ascii?Q?zA6vkhPhw1lIybommuy4LAeiasfUxo98oDzaq5kLuYX91ghK4ARQwprtbTJy?= =?us-ascii?Q?xD8eQmKUK+X1IMbjD7yuOAAyjU87PgBSZiez6ZEPGWGli7iKTTIp/4zuNzCz?= =?us-ascii?Q?fBnf8slY9JhG8TvXYXdnIh7BT7jnVSq1mhc+Rts56J0+BkxGh+Rkndj3Cdk2?= =?us-asc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odWG0kXzV4Vci?= =?us-ascii?Q?C0edYOgYUqLrZloKWerdG/qH8o4SKnR0U1J06mNmtgrfbFw7UhSRVz5O2Y3C?= =?us-ascii?Q?cvA2ylfibuOt07Iq+U/ty8p3BIFGnQLpNr7MSTOSroXBcuH9u/nOwiMrZ5HS?= =?us-ascii?Q?NTEVtrXh0vNNZ6Gj7/nkmC9Gh0MCYBcvookPkaq92tiB6zSs0VJ3kG4Y8pMS?= =?us-ascii?Q?WT1S1LxQNMrcGH/OwZEOkI/Wtirb8zK+B0q5UILQ3Pk9fT2wMz/Y11OVt+J/?= =?us-ascii?Q?OSrO7mY=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PAXPR04MB9328.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(52116014)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?+G8ctTfbzPsMaq4HlG8DerxH2EpCA09ZtQV8BrK2zcL4TCUeQh4Inaa55mcB?= =?us-ascii?Q?iAPSJpGCTIL/OFw8Qvvnd1CSkVC4MyZMfYjZZjpCUG/IvDbUoTeD9ghad2L/?= =?us-ascii?Q?MMDvCGqyhIGA1FfItLawOCC+yeoDmAgMpOxx8XG6kuJzYWVT6loV8YHWvR0I?= =?us-ascii?Q?RpxN3YV/rv9PiyICF6ndluUZFgXMqUKU/VIF/i+VN58pXvlE+Rw+wpVt+fBo?= =?us-ascii?Q?QgbBFO1NUT6i1k/K4kan1h6PU2ZEw77nDS/5v9Pn3WfIxneUN6L5AbkmJwg9?= =?us-ascii?Q?cf52DcvZhEbrhlvTGBz9vXRxKbIBuimbbygTDXFd2W4RtxUnggEWpgK+BxsZ?= =?us-ascii?Q?FG+iqbXDoyEFaJUplPpc+rmo3bxaDDjdaxD+EmEftSHwhpF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oDyQWGYUHu6Fy95fT/ceW5SHg+Mm/Ec2Jya9tCwGdAG9Op?= =?us-ascii?Q?vG+mN8+fPoNG8BZMbFCWxWRltQZ5m2qGZRd20GJUcN2h3D6JJ1wkAttWNyAu?= =?us-ascii?Q?KEuDt3SGeVs+5HxRdDpGB+0Sp/UBFh4BYQdCbnWsMLkTNkIr+CyVHIOiJX0V?= =?us-ascii?Q?+YRJrqMKunhnwzhXMq0UogVZh5punf6KiH9dkEogUJFOd0lfftmxWeNFUdq3?= =?us-ascii?Q?dbhORSJcXYqubLBc3X04uk8luAaO57IZptLEIqMFkn8Eu7MpHQ8PP3x92npn?= =?us-ascii?Q?cIeYV9RS974L9SPA1TNSPkb0GJg06r44Ro7a2N11EgRkzvX9rRpJIXidu0G0?= =?us-ascii?Q?DA=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: de33609f-ec1b-4f25-e161-08dd04803bef X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9328.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2024 07:44:56.5784 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: b7GhDQtmk3yIk6hadsn7+gfG2O2OJD9yd6UxqQb+XcuazqLS24odSTi79yGs7wGeM7KEy/CkTEcV83mgGmyeXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR04MB10380 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org To avoid regressions on this topic, could you look into enabling clang thread safety check? Signed-off-by: David Marchand Signed-off-by: Hemant Agrawal --- drivers/bus/dpaa/base/qbman/qman.c | 35 ++++++++++++++++-------------- drivers/bus/dpaa/meson.build | 2 -- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index c48fa3e073..f92b25343a 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -22,23 +22,10 @@ #define FSL_QMAN_POLL_LIMIT 8 /* Lock/unlock frame queues, subject to the "LOCKED" flag. This is about - * inter-processor locking only. Note, FQLOCK() is always called either under a - * local_irq_save() or from interrupt context - hence there's no need for irq - * protection (and indeed, attempting to nest irq-protection doesn't work, as - * the "irq en/disable" machinery isn't recursive...). + * inter-processor locking only. */ -#define FQLOCK(fq) \ - do { \ - struct qman_fq *__fq478 = (fq); \ - if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \ - spin_lock(&__fq478->fqlock); \ - } while (0) -#define FQUNLOCK(fq) \ - do { \ - struct qman_fq *__fq478 = (fq); \ - if (fq_isset(__fq478, QMAN_FQ_FLAG_LOCKED)) \ - spin_unlock(&__fq478->fqlock); \ - } while (0) +#define FQLOCK(fq) fq_lock(fq) +#define FQUNLOCK(fq) fq_unlock(fq) static qman_cb_free_mbuf qman_free_mbuf_cb; @@ -57,6 +44,22 @@ static inline int fq_isset(struct qman_fq *fq, u32 mask) return fq->flags & mask; } +static inline void fq_lock(struct qman_fq *fq) + __rte_exclusive_lock_function(&fq->fqlock) + __rte_no_thread_safety_analysis +{ + if (fq_isset(fq, QMAN_FQ_FLAG_LOCKED)) + spin_lock(&fq->fqlock); +} + +static inline void fq_unlock(struct qman_fq *fq) + __rte_unlock_function(&fq->fqlock) + __rte_no_thread_safety_analysis +{ + if (fq_isset(fq, QMAN_FQ_FLAG_LOCKED)) + spin_unlock(&fq->fqlock); +} + static inline int fq_isclear(struct qman_fq *fq, u32 mask) { return !(fq->flags & mask); diff --git a/drivers/bus/dpaa/meson.build b/drivers/bus/dpaa/meson.build index 114e0a2265..5506f2bffc 100644 --- a/drivers/bus/dpaa/meson.build +++ b/drivers/bus/dpaa/meson.build @@ -29,5 +29,3 @@ if cc.has_argument('-Wno-pointer-arith') endif includes += include_directories('include', 'base/qbman') - -annotate_locks = false -- 2.25.1