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 303F3A034D for ; Thu, 10 Feb 2022 13:03:33 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A7E4426E2; Thu, 10 Feb 2022 13:03:33 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 492B54013F; Thu, 10 Feb 2022 13:03:30 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494610; x=1676030610; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8g+Sb42bj52vQV9NNv9XsdqUB4r/6rXeG48Xotas0xE=; b=ZTzus3QMHF1VFYdKKY4/M5kG8OePPw6TpydKWDxIwlO8okvGy0/SQ9Tv 0Vv8O6IlkY2kDvI22ulbI1FjJlxe2jManRDcV3sS3SLbe3Nlvkhpb+IVy Twzh7NqkQ6sQH1XMnFRlHXJ0nfpc2CbwVBawCr8WG73T91RzyYqzEXtJR i0X86dAkFbyfsELUpZnWQ5WiXqZL3o/cPveGQ6haviu9GrOEohXOjIRxU 0adhzJmTY6nkLEZbY474H8+IW8wegsuQd1HgHwu3cqOswtDCKcsBA+OAD OdLGiumnCm9Z7lE1b79WScci62sq9/PJrRILgadQ6Zx9j8XQidQsh86U/ A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="229443057" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="229443057" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 04:03:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658242" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:03:27 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , joyce.kong@arm.com, david.marchand@redhat.com, stable@dpdk.org, Honnappa Nagarahalli , Ola Liljedahl , Gavin Hu , Konstantin Ananyev , Jerin Jacob Subject: [PATCH v2 1/7] eal: fix header build with C++ Date: Thu, 10 Feb 2022 12:02:51 +0000 Message-Id: <20220210120257.585822-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210120257.585822-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210120257.585822-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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: ebaee6409702 ("trace: simplify trace point headers") Cc: joyce.kong@arm.com Cc: david.marchand@redhat.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