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 65F4EA00BE; Thu, 10 Feb 2022 15:04:31 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2712642711; Thu, 10 Feb 2022 15:04:30 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 863E042711; Thu, 10 Feb 2022 15:04:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501867; x=1676037867; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8g+Sb42bj52vQV9NNv9XsdqUB4r/6rXeG48Xotas0xE=; b=b3JTWjEphFwk9F+pQ1+lHTmAOz/GrL2mXOnOXg6CpiICIEheC0cTmBdv UCdrqanWAjGieAd0WXdaM38gKMSEwVe6G3qEZRIwSX4jVV3BMiDjka9FK ymQUjooNp65xwNGw5kqHvm2flNa/37FbuxiB30pMQ7Sf9gl+aE8lartuh 2PTZjK64leHrSsY+LAjLZ2OOxp4Xn6tnJxf2ObWLGqp+0dXa2mGrOuzLU vHBH4+K/oX+HF7EXmxb2z1vADOB5cabQYVMCHuPkq/8XOHnXAiM4P67Hy FhC9zTmY1cxqFIGmzXPy1sl/G1WZu1lCti7JaUhJH7syal0cqG49Hp22+ g==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781084" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781084" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 06:04:26 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964239" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:24 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , joyce.kong@arm.com, david.marchand@redhat.com, stable@dpdk.org, Gavin Hu , Konstantin Ananyev , Honnappa Nagarahalli , Ola Liljedahl , Jerin Jacob Subject: [PATCH v3 1/7] eal: fix header build with C++ Date: Thu, 10 Feb 2022 14:03:49 +0000 Message-Id: <20220210140355.586399-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220210140355.586399-1-bruce.richardson@intel.com> References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210140355.586399-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: 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