From patchwork Thu Feb 10 15:42:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107272 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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 Acked-by: Joyce Kong --- 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) From patchwork Thu Feb 10 15:42:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107273 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 11241A00BE; Thu, 10 Feb 2022 16:43:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4640642752; Thu, 10 Feb 2022 16:43:09 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 5B676426ED; Thu, 10 Feb 2022 16:43:05 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507785; x=1676043785; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mniVCn9k5i1gPUhp/5Epowbf2EvwvceUaEu1OsgzmG0=; b=kEL2TsEeC+2zpADWE74aqHkeSXy19XKc7rTz7r31ERaDV8xDUj+fJTYN 7MxzKAD6w99kfmYc8jesNugsyC0gMvCHspU0opEKF6u3ud5bPqbYG46hH 1fB8fGCaDxKazYQ8rm+yE9L+OdwVjgw+YQrN2B8r9spC6PFsuwWgU+2AH 8MnppNkSa1ak4p5wpOywHxfYTvs+dBLedKc7o93F7sHmMjrfUTos+mp22 PNBASAy6VuqY03C/RohmguER2l5JamyiMlaRH3YS2hrUw7uRvE8rlhacL yWG2ZHqNO4sNds+u1+AFkmWHwb88PuLP91SWzKjdUCZAElOt75HBSsb2a g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101118" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101118" 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:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723401" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:42:52 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , erik.g.carrillo@intel.com, skori@marvell.com, stable@dpdk.org, Jerin Jacob , Jerin Jacob , Pavan Nikhilesh , David Marchand Subject: [PATCH v4 2/7] eventdev: fix header build with C++ Date: Thu, 10 Feb 2022 15:42:34 +0000 Message-Id: <20220210154239.587185-3-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 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 The eventdev headers had issues when used from C++ * Missing closing "}" for the extern "C" block * No automatic casting to/from void * Fixes: a6562f6d6f8e ("eventdev: introduce event timer adapter") Fixes: 32e326869ed6 ("eventdev: add tracepoints") Cc: erik.g.carrillo@intel.com Cc: skori@marvell.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Acked-by: Jerin Jacob --- lib/eventdev/rte_event_timer_adapter.h | 3 +++ lib/eventdev/rte_eventdev.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/eventdev/rte_event_timer_adapter.h b/lib/eventdev/rte_event_timer_adapter.h index 1551741820..1fe4dd8e8f 100644 --- a/lib/eventdev/rte_event_timer_adapter.h +++ b/lib/eventdev/rte_event_timer_adapter.h @@ -678,4 +678,7 @@ rte_event_timer_cancel_burst(const struct rte_event_timer_adapter *adapter, return adapter->cancel_burst(adapter, evtims, nb_evtims); } +#ifdef __cplusplus +} +#endif #endif /* __RTE_EVENT_TIMER_ADAPTER_H__ */ diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h index eef47d8acc..25fb7c89dd 100644 --- a/lib/eventdev/rte_eventdev.h +++ b/lib/eventdev/rte_eventdev.h @@ -1805,7 +1805,7 @@ __rte_event_enqueue_burst(uint8_t dev_id, uint8_t port_id, return 0; } #endif - rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, fn); + rte_eventdev_trace_enq_burst(dev_id, port_id, ev, nb_events, (void *)fn); /* * Allow zero cost non burst mode routine invocation if application * requests nb_events as const one From patchwork Thu Feb 10 15:42:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107274 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 31BACA00BE; Thu, 10 Feb 2022 16:43:16 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8CD6D42757; Thu, 10 Feb 2022 16:43:10 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 7D902426ED; Thu, 10 Feb 2022 16:43:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507787; x=1676043787; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dBD+GspqG2no2kAvYJxoW+EbbsTf0E3yomllcbb7Cf0=; b=Us1nRQaDHiuC2Kim6IpaJ3ylGQKWiTqsMjncPLD/OF+sPHRlfGcABLUG k1ABIXtDkQde3XACiwg+AHbws9PXN2UD/x+iPMbWFWbHaVcCXdZ5O0xcJ 7EXrkZrj8On80c6LQ8uZFNWHEyXwxZwTkL5m63+nNkjSPIlj+QvWHNP03 ZX7u+yLLPal+KVyXEJvRkbRnEnC/1W2hZgedFDpnGL9/RDGVe8fb7NSOY 0ZK3h6lIq/hLbLmbXPvRBWoOBHN/NXkleiePrAZMoC9Z8NyI1Wg6mhouf 11mlKfIhOJ/4FmfXdYe6TXh39OE9Yndk1kouXJ5i8/GsvTpeQnMyNVbrm A==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101133" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101133" 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:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723415" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:42:55 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , jerinj@marvell.com, stable@dpdk.org, Nithin Dabilpuram , Kiran Kumar K , Pavan Nikhilesh Subject: [PATCH v4 3/7] graph: fix missing explicit cast for C++ build Date: Thu, 10 Feb 2022 15:42:35 +0000 Message-Id: <20220210154239.587185-4-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 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++ does not have automatic casting to/from void pointers, so need explicit cast if header is to be included in C++ code Fixes: 40d4f51403ec ("graph: implement fastpath routines") Cc: jerinj@marvell.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Acked-by: Jerin Jacob --- lib/graph/rte_graph_worker.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/graph/rte_graph_worker.h b/lib/graph/rte_graph_worker.h index eef77f732a..0c0b9c095a 100644 --- a/lib/graph/rte_graph_worker.h +++ b/lib/graph/rte_graph_worker.h @@ -155,7 +155,7 @@ rte_graph_walk(struct rte_graph *graph) * +-----+ <= cir_start + mask */ while (likely(head != graph->tail)) { - node = RTE_PTR_ADD(graph, cir_start[(int32_t)head++]); + node = (struct rte_node *)RTE_PTR_ADD(graph, cir_start[(int32_t)head++]); RTE_ASSERT(node->fence == RTE_GRAPH_FENCE); objs = node->objs; rte_prefetch0(objs); From patchwork Thu Feb 10 15:42:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107275 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 78099A00BE; Thu, 10 Feb 2022 16:43:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0A3DA42763; Thu, 10 Feb 2022 16:43:12 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 97885426ED; Thu, 10 Feb 2022 16:43:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507788; x=1676043788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=TmPILIvrE48YfwTYSX63JExVohAKlqCv+3O1dOrrTZ4=; b=Argal+4IxHdQFMFxnjX5vHD1FrVLPwwkHF2w28lNLJnNZ2LjMNcRgJe+ adB071kMOP92c8Jn8JIzAv7iWpQLElZR38qzxw0RtoqgGEDzr3NtajYIB 9j+avYcKsKzHzvD70+N6iTeMpgBD4UUMa/3e2HIemhjlSq5KZDfHLke/H ZbgP8FS6KUmJXN4ARvfSyCr3zApBVXHXL2UlrV//UIcYSoXyU+1nP3eb7 BWOoCv1SZCQ41ZUBHT2BDdtT/eL16KwFb9ofZ1kRptuFhh9IkSzX5XDhv Ir9v63kQJfC0+4xYzfkyY8CVFVqqYNAJ+vM/jXpXXIhxx88CDYKfYmR0H Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101156" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101156" 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:43:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723439" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:42:59 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , konstantin.ananyev@intel.com, stable@dpdk.org, Declan Doherty , Akhil Goyal Subject: [PATCH v4 4/7] ipsec: fix missing explicit cast for C++ build Date: Thu, 10 Feb 2022 15:42:36 +0000 Message-Id: <20220210154239.587185-5-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 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++ does not have automatic casting to/from void pointers, so need explicit cast if header is to be included in C++ code Fixes: f901d9c82688 ("ipsec: add helpers to group completed crypto-ops") Cc: konstantin.ananyev@intel.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson Acked-by: Konstantin Ananyev --- lib/ipsec/rte_ipsec_group.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ipsec/rte_ipsec_group.h b/lib/ipsec/rte_ipsec_group.h index 60ab297710..62c2bd7217 100644 --- a/lib/ipsec/rte_ipsec_group.h +++ b/lib/ipsec/rte_ipsec_group.h @@ -49,10 +49,10 @@ rte_ipsec_ses_from_crypto(const struct rte_crypto_op *cop) if (cop->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION) { ss = cop->sym[0].sec_session; - return (void *)(uintptr_t)ss->opaque_data; + return (struct rte_ipsec_session *)(uintptr_t)ss->opaque_data; } else if (cop->sess_type == RTE_CRYPTO_OP_WITH_SESSION) { cs = cop->sym[0].session; - return (void *)(uintptr_t)cs->opaque_data; + return (struct rte_ipsec_session *)(uintptr_t)cs->opaque_data; } return NULL; } From patchwork Thu Feb 10 15:42:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107276 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4AF61A00BE; Thu, 10 Feb 2022 16:43:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D61742769; Thu, 10 Feb 2022 16:43:14 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 1CA0B426F7; Thu, 10 Feb 2022 16:43:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507788; x=1676043788; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pw8h7l85GTUAWLoIdKJY/D6EzLxrtOlOWNXgp0QmUVE=; b=fmgffaW3W710WjxKhG53SYdGFlQIy/ExWXGzkFsrHG0FAlnVZ8n9acU6 U1pqOKhbo9OHQn73d214IGrF7muxXgpL5IKQ7Q1GgE6kBJCRu7Icxm1D+ bdgktpySOw0byryV29ieMld37YrpXDTkXbgdPXomk23uGkAp5z6RhrahA 8W2O4TMRdrlMjzLDyhmYifyItgcfyq2/lzUl3mbDEE+mtUUt1xL0sSel1 dTma33FVLYhYkJTqr5gr+Fb5KF1rvmeqfzpxYRFwMdcJMi73oQ9c3PNpU e/yEMGg3PsEB8gEkAo5Rudf2NKnybWpS7ozxn8b0hJiJnfcD50fTw7BqM g==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101183" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101183" 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:43:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723465" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:43:01 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , kevin.laatz@intel.com, cristian.dumitrescu@intel.com, stable@dpdk.org, Gavin Hu , Jerin Jacob Subject: [PATCH v4 5/7] table: fix missing explicit casts for C++ build Date: Thu, 10 Feb 2022 15:42:37 +0000 Message-Id: <20220210154239.587185-6-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 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 Since C++ doesn't support automatic casting from void * to other types, we need to explicitly add the casts to any header files in DPDK. Fixes: ea7be0a0386e ("lib/librte_table: add hash function headers") Cc: kevin.laatz@intel.com Cc: cristian.dumitrescu@intel.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- lib/table/rte_table_hash_func.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/table/rte_table_hash_func.h b/lib/table/rte_table_hash_func.h index c4c35cc06a..a962ec2f68 100644 --- a/lib/table/rte_table_hash_func.h +++ b/lib/table/rte_table_hash_func.h @@ -58,8 +58,8 @@ static inline uint64_t rte_table_hash_crc_key8(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t crc0; crc0 = rte_crc32_u64(seed, k[0] & m[0]); @@ -72,8 +72,8 @@ static inline uint64_t rte_table_hash_crc_key16(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t k0, crc0, crc1; k0 = k[0] & m[0]; @@ -91,8 +91,8 @@ static inline uint64_t rte_table_hash_crc_key24(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t k0, k2, crc0, crc1; k0 = k[0] & m[0]; @@ -113,8 +113,8 @@ static inline uint64_t rte_table_hash_crc_key32(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t k0, k2, crc0, crc1, crc2, crc3; k0 = k[0] & m[0]; @@ -139,8 +139,8 @@ static inline uint64_t rte_table_hash_crc_key40(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t k0, k2, crc0, crc1, crc2, crc3; k0 = k[0] & m[0]; @@ -165,8 +165,8 @@ static inline uint64_t rte_table_hash_crc_key48(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t k0, k2, k5, crc0, crc1, crc2, crc3; k0 = k[0] & m[0]; @@ -192,8 +192,8 @@ static inline uint64_t rte_table_hash_crc_key56(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5; k0 = k[0] & m[0]; @@ -222,8 +222,8 @@ static inline uint64_t rte_table_hash_crc_key64(void *key, void *mask, __rte_unused uint32_t key_size, uint64_t seed) { - uint64_t *k = key; - uint64_t *m = mask; + uint64_t *k = (uint64_t *)key; + uint64_t *m = (uint64_t *)mask; uint64_t k0, k2, k5, crc0, crc1, crc2, crc3, crc4, crc5; k0 = k[0] & m[0]; From patchwork Thu Feb 10 15:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107277 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CC19FA00BE; Thu, 10 Feb 2022 16:43:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D5BB142770; Thu, 10 Feb 2022 16:43:15 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id AE483426ED; Thu, 10 Feb 2022 16:43:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507789; x=1676043789; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=veIxnvD4HcP71geTR9XiNe9UbAQ5n7+OKC29V7i55zI=; b=YXa2qRd6Gfw4KNmm+GZRaPuvyYW8S3DVBTthTaCSAyxac0iAhuyIVI0N 5jCHga5Rx02YKLdfj2i99ATDN7tBRq2inOh0bUv5I+GDcF0onLDelzja9 GN4KsSXOBHhQ1BQ39j9G5sV0/hTk6UNk00GJy7wfrhoA6oV7UffUjeuo/ G8voMyF7WkQxdcoRTAy4m93yHe+w/ZIWX1CB2puoL3WlFTdfepBioP9Ak 88F94lL2SWifm62t9VobDlxxGxuHuNwTi7cYgeOFqtQlIsPtveXOIwekD x6YD10b1OHzOxdxJVxS5kT98eNj5OPeUTNVwDkcr1MSXg1v06AyBSHmdw Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101207" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101207" 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:43:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723489" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:43:04 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , adrien.mazarguil@6wind.com, stable@dpdk.org, Yuanhan Liu , Maxime Coquelin Subject: [PATCH v4 6/7] vhost: fix incompatible header includes for C++ Date: Thu, 10 Feb 2022 15:42:38 +0000 Message-Id: <20220210154239.587185-7-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 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 The virtio kernel header includes are already noted as being incompatible with C++. We can ensure that the header is safe for inclusion in C++ code by not including those headers during C++ builds. While not ideal, this does ensure that all DPDK headers can be included in C++ code without errors. Fixes: f8904d563691 ("vhost: fix header for strict compilation flags") Cc: adrien.mazarguil@6wind.com Cc: stable@dpdk.org Signed-off-by: Bruce Richardson --- lib/vhost/rte_vhost.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vhost/rte_vhost.h b/lib/vhost/rte_vhost.h index b454c05868..2acb31df2d 100644 --- a/lib/vhost/rte_vhost.h +++ b/lib/vhost/rte_vhost.h @@ -21,10 +21,12 @@ extern "C" { #endif +#ifndef __cplusplus /* These are not C++-aware. */ #include #include #include +#endif #define RTE_VHOST_USER_CLIENT (1ULL << 0) #define RTE_VHOST_USER_NO_RECONNECT (1ULL << 1) From patchwork Thu Feb 10 15:42:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107278 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 889AAA00BE; Thu, 10 Feb 2022 16:43:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 205DA42775; Thu, 10 Feb 2022 16:43:17 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 45FC442755 for ; Thu, 10 Feb 2022 16:43:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644507790; x=1676043790; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=A9RJREu6ajd6nuB1RfmPeub0zL5omlbywiJF2p6BwWk=; b=Qm4NoyTpmHnMrTWwvF4RGophd6o0dsJ7AK4Sk5xH+RkOQ5crm8E8lYJu biKXr7oOT3xsp+KfnRClAesAXnLUOYq/r1nn3rasOQ+415kZMOI462ayZ +8Ry2875XxKgVhuB7ShOlLhI5tPw+kzdtaNPSevbeNa5HKDR4pDy5p21j C1JxRNPReVoEueMQJBcl0WB+BAO+jDHxSKuKYZIrnRj6EgF/BzlESowSt +fm3F4HJwN03qgbAnJl7j1J9IwkTkoqNCw88ACNnNmVmOMJkfSs6dYk9k SUW0atIIm33P98vx7fUYzAv4EMEPusBhwQyUS3GkfXpA/KWf6hrLS97oj A==; X-IronPort-AV: E=McAfee;i="6200,9189,10254"; a="247101218" X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="247101218" 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:43:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,359,1635231600"; d="scan'208";a="485723508" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by orsmga006.jf.intel.com with ESMTP; 10 Feb 2022 07:43:07 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Aaron Conole , Michael Santana Subject: [PATCH v4 7/7] buildtools/chkincs: test headers for C++ compatibility Date: Thu, 10 Feb 2022 15:42:39 +0000 Message-Id: <20220210154239.587185-8-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 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 Add support for checking each of our headers for issues when included in a C++ file. Signed-off-by: Bruce Richardson --- .ci/linux-build.sh | 1 + .github/workflows/build.yml | 2 +- buildtools/chkincs/main.cpp | 4 ++++ buildtools/chkincs/meson.build | 20 ++++++++++++++++++++ devtools/test-meson-builds.sh | 3 ++- 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 buildtools/chkincs/main.cpp diff --git a/.ci/linux-build.sh b/.ci/linux-build.sh index c10c1a8ab5..67d68535e0 100755 --- a/.ci/linux-build.sh +++ b/.ci/linux-build.sh @@ -74,6 +74,7 @@ fi if [ "$BUILD_32BIT" = "true" ]; then OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32" + OPTS="$OPTS -Dcpp_args=-m32 -Dcpp_link_args=-m32" export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig" fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cf997d6ee..d30cfd08d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,7 +116,7 @@ jobs: libdw-dev - name: Install i386 cross compiling packages if: env.BUILD_32BIT == 'true' - run: sudo apt install -y gcc-multilib + run: sudo apt install -y gcc-multilib g++-multilib - name: Install aarch64 cross compiling packages if: env.AARCH64 == 'true' run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross diff --git a/buildtools/chkincs/main.cpp b/buildtools/chkincs/main.cpp new file mode 100644 index 0000000000..d25bb8852a --- /dev/null +++ b/buildtools/chkincs/main.cpp @@ -0,0 +1,4 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2021 Intel Corporation + */ +int main(void) { return 0; } diff --git a/buildtools/chkincs/meson.build b/buildtools/chkincs/meson.build index 5ffca89761..beabcd55d8 100644 --- a/buildtools/chkincs/meson.build +++ b/buildtools/chkincs/meson.build @@ -28,3 +28,23 @@ executable('chkincs', sources, dependencies: deps, link_whole: dpdk_static_libraries + dpdk_drivers, install: false) + +# run tests for c++ builds also +if not add_languages('cpp', required: false) + subdir_done() +endif + +gen_cpp_files = generator(gen_c_file_for_header, + output: '@BASENAME@.cpp', + arguments: ['@INPUT@', '@OUTPUT@']) + +cpp_sources = files('main.cpp') +cpp_sources += gen_cpp_files.process(dpdk_chkinc_headers) + +executable('chkincs-cpp', cpp_sources, + cpp_args: ['-include', 'rte_config.h', cflags], + link_args: dpdk_extra_ldflags, + include_directories: includes, + dependencies: deps, + link_whole: dpdk_static_libraries + dpdk_drivers, + install: false) diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh index 4ed61328b9..c07fd16fdc 100755 --- a/devtools/test-meson-builds.sh +++ b/devtools/test-meson-builds.sh @@ -246,7 +246,8 @@ if check_cc_flags '-m32' ; then export PKG_CONFIG_LIBDIR='/usr/lib/pkgconfig' fi target_override='i386-pc-linux-gnu' - build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' + build build-32b cc ABI -Dc_args='-m32' -Dc_link_args='-m32' \ + -Dcpp_args='-m32' -Dcpp_link_args='-m32' target_override= unset PKG_CONFIG_LIBDIR fi