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 9511DA00C2; Thu, 10 Feb 2022 13:57:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5A0B7411AE; Thu, 10 Feb 2022 13:57:28 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1121D4013F for ; Thu, 10 Feb 2022 13:57:26 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644497846; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=CUCmq2K71gbAe/wJV7aXcCLO3sfuTg6cDgcUCnPib/A=; b=ECfQ0aRj7Z75SQbbqGaiYvmwQ4BzUJNvEs3gdwz/EIxA7Nq/k2ukQnvTXUVJ+vYcCL/h4z 0ux0cu53nc7Vl3azT9BRuvcC6XedcvJeib2wgx8KDvSNng2ZrCUlnkawb1SnPzHXVnaZgv 3VbbJReyM48JjY6noD5S9zfc5QAzcso= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-262--99aNRQlMFeZWWFOiZARdg-1; Thu, 10 Feb 2022 07:57:22 -0500 X-MC-Unique: -99aNRQlMFeZWWFOiZARdg-1 Received: by mail-lf1-f72.google.com with SMTP id d14-20020a196b0e000000b0043a9be72315so1354629lfa.22 for ; Thu, 10 Feb 2022 04:57:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CUCmq2K71gbAe/wJV7aXcCLO3sfuTg6cDgcUCnPib/A=; b=5uJxMRAtvCMG1VtdSTZ/72V80M60JDVdho6rnSf7MnjdMmrmuKzoq+ZcE6V87Ed9mB CMPzWBibymNBesFFKWCo7Ld8LQgistxbksngPrUKYN8urg9yH0guggLonULGINwzpDPc nJfmmc21IJpj7KJFBfB5nNtjXhdenWm5TTB1jqI7mZU35w6IPX4R4U3V6P984jiNXJ5J ma5t3po+TbEX4KtuXlagpk3xLmcpGmJvAbgG6cN/AzABXDkJ7wHpg4Z7u9Jwzfw3Yccn ZiwZFA1C6bhLvVIFgBMTzyGZfiGPhrJzOeoUTfNliwY2RXqEciSLjqWwhPwpnQTeugdN ueTA== X-Gm-Message-State: AOAM533iwVzxnoVzheLWD3GvUeZjOuVEMDrg3VOplVT0gT/xWJMflRQd tqvr2JVAJAHoNfo+2TK2K97Mt3yj045A+MRgcoQ5/0KnLCT/b+WH8F29b6CpebHksppzgModHQz HCUgpzIGjR9isVr9btoE= X-Received: by 2002:a05:6512:3d14:: with SMTP id d20mr5149736lfv.499.1644497841092; Thu, 10 Feb 2022 04:57:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyN7zd9ey/vmsj+AgpUHWu0hLSOeLZbkFJBGtK2DPNtLZz41UczVkqCyN88ecl0tzTyrSy3Hz46mVhLngJbtyk= X-Received: by 2002:a05:6512:3d14:: with SMTP id d20mr5149721lfv.499.1644497840907; Thu, 10 Feb 2022 04:57:20 -0800 (PST) MIME-Version: 1.0 References: <20220204174209.440207-1-bruce.richardson@intel.com> <20220210120257.585822-1-bruce.richardson@intel.com> <20220210120257.585822-2-bruce.richardson@intel.com> In-Reply-To: <20220210120257.585822-2-bruce.richardson@intel.com> From: David Marchand Date: Thu, 10 Feb 2022 13:57:09 +0100 Message-ID: Subject: Re: [PATCH v2 1/7] eal: fix header build with C++ To: Bruce Richardson Cc: dev , Joyce Kong , dpdk stable , Honnappa Nagarahalli , Ola Liljedahl , Gavin Hu , Konstantin Ananyev , Jerin Jacob Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 On Thu, Feb 10, 2022 at 1:03 PM Bruce Richardson wrote: > > 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") rte_strcpy was moved in this commit. This is more about: Fixes: 032a7e5499a0 ("trace: implement provider payload") > 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 > lgtm, thanks. -- David Marchand