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 EF54AA00BE; Thu, 10 Feb 2022 16:43:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DFA764274B; Thu, 10 Feb 2022 16:43:05 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 71C5B426ED; Thu, 10 Feb 2022 16:43:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507784; x=1676043784; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=T0owC88/PabvnVJE2FcQA+oqFbMvWokbTc1k9v9LjfU=; b=GJOouaap9oH3t9kYVcpZ7djVT5CmE1C09/blZRF77+Z+F6PtmQB90Bob Va6CshiaqFPDEDZ+EVvhZfPGzqKuw2+o62Eaz2c5xWmRYDGy7Nzd0bn4J wMUy5c8vZgYFPKDJTwkioBs9EXHwBhYqAOZL9tpKJzhfiKPPnei0cbTP5 9jcTc5V0gEDwn6SdHhLfOy7ujtaIaGJ+K7mzgKHzpb5PLg+vDq2+fKU9o Qoj2BUiBlaZQ6Fbv0FWY+eEPuf5c/Ftj91uS9PBxrkbH9qKHPJXhPBxTr AlqWnsvaVbcVNuhezqsrSCTpzKOjPNbARtJ2nxg2d5ZIDhYX3bU8ELh02 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101111" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101111" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 07:42:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723380" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:42:47 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , joyce.kong@arm.com, jerinj@marvell.com, stable@dpdk.org, Gavin Hu , Konstantin Ananyev , Honnappa Nagarahalli , Ola Liljedahl , Sunil Kumar Kori , David Marchand Subject: [PATCH v4 1/7] eal: fix header build with C++ Date: Thu, 10 Feb 2022 15:42:33 +0000 Message-Id: <20220210154239.587185-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210154239.587185-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210154239.587185-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 C++ files could not include some headers because: * "new" is a keyword in C++, so can't be a variable name * there is no automatic casting to/from void * Fixes: 184104fc6121 ("ticketlock: introduce fair ticket based locking") Fixes: 032a7e5499a0 ("trace: implement provider payload") Cc: joyce.kong@arm.com Cc: jerinj@marvell.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- lib/eal/include/generic/rte_ticketlock.h | 14 +++++++------- lib/eal/include/rte_trace_point.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/eal/include/generic/rte_ticketlock.h b/lib/eal/include/generic/rte_ticketlock.h index c1b8808f51..693c67b517 100644 --- a/lib/eal/include/generic/rte_ticketlock.h +++ b/lib/eal/include/generic/rte_ticketlock.h @@ -91,13 +91,13 @@ rte_ticketlock_unlock(rte_ticketlock_t *tl) static inline int rte_ticketlock_trylock(rte_ticketlock_t *tl) { - rte_ticketlock_t old, new; - old.tickets = __atomic_load_n(&tl->tickets, __ATOMIC_RELAXED); - new.tickets = old.tickets; - new.s.next++; - if (old.s.next == old.s.current) { - if (__atomic_compare_exchange_n(&tl->tickets, &old.tickets, - new.tickets, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) + rte_ticketlock_t oldl, newl; + oldl.tickets = __atomic_load_n(&tl->tickets, __ATOMIC_RELAXED); + newl.tickets = oldl.tickets; + newl.s.next++; + if (oldl.s.next == oldl.s.current) { + if (__atomic_compare_exchange_n(&tl->tickets, &oldl.tickets, + newl.tickets, 0, __ATOMIC_ACQUIRE, __ATOMIC_RELAXED)) return 1; } diff --git a/lib/eal/include/rte_trace_point.h b/lib/eal/include/rte_trace_point.h index e226f073f7..0f8700974f 100644 --- a/lib/eal/include/rte_trace_point.h +++ b/lib/eal/include/rte_trace_point.h @@ -370,7 +370,7 @@ do { \ do { \ if (unlikely(in == NULL)) \ return; \ - rte_strscpy(mem, in, __RTE_TRACE_EMIT_STRING_LEN_MAX); \ + rte_strscpy((char *)mem, in, __RTE_TRACE_EMIT_STRING_LEN_MAX); \ mem = RTE_PTR_ADD(mem, __RTE_TRACE_EMIT_STRING_LEN_MAX); \ } while (0) -- 2.32.0