From patchwork Thu Feb 10 12:02:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107238 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 65712A00C2; Thu, 10 Feb 2022 13:03:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FC5C411AE; Thu, 10 Feb 2022 13:03:32 +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 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) From patchwork Thu Feb 10 12:02:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107239 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 5BD84A00C2; Thu, 10 Feb 2022 13:03:40 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D5A4426E2; Thu, 10 Feb 2022 13:03:40 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 4CA624013F; Thu, 10 Feb 2022 13:03:38 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494618; x=1676030618; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mniVCn9k5i1gPUhp/5Epowbf2EvwvceUaEu1OsgzmG0=; b=G+JU8eQw77pMk8BFJfVp70diroOgxqL7r0o+1mr0F/sQ/eJGhSJiqR5Z ru2RVhVk7/kqnQk0GcSJJiXsJDQ6FE59505808RLeL9qgLVQ3nB09K4Bk 8FSZG12QUVYQP6hCsPfNGSczlgNZHsx5AXDO5LH95dZsx/I/saYBdrPRs 5qLdWhm7IgLUWq53isfewy4ayh7H/KCWMP54A235IjrGyGiSWntKT5Q7G yb+OhEvMDxWYl/0cGhS7J8rEiIrtcUR75AlnMmqa+5qaPBDK+hALXMr9f p+tHPGUBXUmRPt9HyEJG+v6r32gtwyLAph7krXMCmZOzT4l7PqK6YDRiF Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="230121039" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="230121039" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 04:03:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658272" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:03:35 -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 v2 2/7] eventdev: fix header build with C++ Date: Thu, 10 Feb 2022 12:02:52 +0000 Message-Id: <20220210120257.585822-3-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 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 12:02:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107240 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 82359A00C2; Thu, 10 Feb 2022 13:03:45 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B57D426EE; Thu, 10 Feb 2022 13:03:42 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id 86FF6426E7; Thu, 10 Feb 2022 13:03:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494620; x=1676030620; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dBD+GspqG2no2kAvYJxoW+EbbsTf0E3yomllcbb7Cf0=; b=k6VkVaQZto6qJKx7uJeFxlBX7uGT5r+/4mlXrc42IwUPHhwVwep8Ihfq vu8VMRyo/+UUyT1s+M6kOYDIYaVaihulU71tMbKQco43I5aAJdvK4zKqx VpJDA1FyEdmFra+gFfSUxJKO5G/KB+OiX1sII9DSoIPEMcVuYWPm81Imv DEW2AtOuneJi0bIj5ceg/E3dcNiAjocvHA2JYMrgI+dgEiFIQvnBi84Xf iRPUqu3btJsDMt8u7jNXGO/eQw3JQhLeBpT/pU4SGJ8WOSQ6QoHZiotB2 vXcqaGQ6mcK19oxKFwoMie1RWjFZ3n4EoybxyWpo1AnQhJtH6Aa6IG8t1 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="230121062" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="230121062" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 04:03:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658281" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:03:38 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , jerinj@marvell.com, stable@dpdk.org, Pavan Nikhilesh , Kiran Kumar K , Nithin Dabilpuram Subject: [PATCH v2 3/7] graph: fix missing explicit cast for C++ build Date: Thu, 10 Feb 2022 12:02:53 +0000 Message-Id: <20220210120257.585822-4-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 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 12:02:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107241 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 CF5F0A00C2; Thu, 10 Feb 2022 13:03:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C0DEE426E7; Thu, 10 Feb 2022 13:03:51 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 76752411DB; Thu, 10 Feb 2022 13:03:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494629; x=1676030629; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w3nkWAkj48JjmdHoviKPTULgG9C8eXj6VE6zcJgyzQQ=; b=KPd6OgM5Vlf9k57GntUA+YvXVv16RXdF7995N942UZkz+pEJiQ5vRcCQ mTiB4Aj1R7eUPcq+J1i3p4WECGFKtiCsYbUvQ7MBlXtbfvpkgs1VFEbhP GQ7yBVvWxQhvg8K4iXUEXrx8odDRMgQTwpvmbg/tYdDrACnPg2fkyOcfR /yZ0S5Gp+dkUdfhlSwI9UPQ+tI+jS7rujh7QXgi/+fGGEqyzXnGw3qxyG 7wXr4jyXPqJhB8rm+1oCThmZsISfTd7JdbS/baxNm70DO6xF/T7ODA8aa xBKUM9c3QZwDdhIyWaigpEHWnHGzktP8JLcM6FsalkJoaEt8ZbKxUjyMY A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="249227143" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="249227143" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 04:03:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658298" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:03:42 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , konstantin.ananyev@intel.com, stable@dpdk.org, Declan Doherty , Akhil Goyal Subject: [PATCH v2 4/7] ipsec: fix missing explicit cast for C++ build Date: Thu, 10 Feb 2022 12:02:54 +0000 Message-Id: <20220210120257.585822-5-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 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 12:02:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107242 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 2EA53A00C2; Thu, 10 Feb 2022 13:03:59 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1563E426FE; Thu, 10 Feb 2022 13:03:53 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 6BB3A411DB; Thu, 10 Feb 2022 13:03:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494630; x=1676030630; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pw8h7l85GTUAWLoIdKJY/D6EzLxrtOlOWNXgp0QmUVE=; b=gESy9gEE2Z/dyKdxZWDholxyUXoKBhxfrVG4GbNu29qSjjpFUYx8U3in q4DIdU2L2bRpztDvcAEwBSQYAG3zRi9CJVVL6FOoMsvxDtbXrRkaliyOQ pjKZET/fYLuYqR8bMSv45ZVAavn7S+rX8x+tTzrgZ6Ll5WIGA0OwVPM/2 zQ4V+GQLhCWWxqEVSkNxtRL8FKVr8oZ/tk+WTzEmw0Dim1/5bXS7UW9hl KC/3V2rDKgsO6LkN/mPfTKBwANp1QHonRC7boe/EaHMUvMnOoigkd2M7n 65xCu3Yg3/z32R+1ZR8SXELbIdpNKFawFs4pT3H90XK+f6BcHBQ81NWQa g==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="249227161" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="249227161" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 04:03:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658322" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:03:46 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , kevin.laatz@intel.com, cristian.dumitrescu@intel.com, stable@dpdk.org, Jerin Jacob , Gavin Hu Subject: [PATCH v2 5/7] table: fix missing explicit casts for C++ build Date: Thu, 10 Feb 2022 12:02:55 +0000 Message-Id: <20220210120257.585822-6-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 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 12:02:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107243 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 81CBFA00C2; Thu, 10 Feb 2022 13:04:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 771CA426F6; Thu, 10 Feb 2022 13:03:58 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 23D594013F; Thu, 10 Feb 2022 13:03:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494637; x=1676030637; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=veIxnvD4HcP71geTR9XiNe9UbAQ5n7+OKC29V7i55zI=; b=D47bmeaYyQVxDjqacQei4VGhk0dHtTgqW61EwBbhxahDOvpkraX3vCVL um7ecYwxWLt9ew1n7l1L/Wz4tMfA47/iKGSjLDxIxHpt1YzrqYfxrDwRd i2bOWNr4TcMjmU/IGfhXwqM2Gf8VcSsgbwiSEkV/sX4RNyLmNgvJcW7SC pwytVDVICxQis+idEGiQJij6J99MTFIyyZeEiHBzd93R2MoUJimXJ4E5o n4HHEsRBrefPdyGGdOkygJpP6IHj/8d3Tz3MQseNwS6gq0TQPEMGf7ESR 9T8agRcv/nlPAsZsw1nq9Wk7Qi9vKYDhipCe/dsaykSsTxU4mqOlUI55t Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312761755" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312761755" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2022 04:03:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658341" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:03:54 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , adrien.mazarguil@6wind.com, stable@dpdk.org, Yuanhan Liu , Maxime Coquelin Subject: [PATCH v2 6/7] vhost: fix incompatible header includes for C++ Date: Thu, 10 Feb 2022 12:02:56 +0000 Message-Id: <20220210120257.585822-7-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 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 12:02:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107244 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 DD1B2A00C2; Thu, 10 Feb 2022 13:04:12 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE9E3426EC; Thu, 10 Feb 2022 13:04:12 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 3F6694013F for ; Thu, 10 Feb 2022 13:04:11 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644494651; x=1676030651; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qOcgvMD67t0FQBAuad4/OKjnMTgYNAuM5LsiMr1NU0Y=; b=FxKwBfe8otIQgipfSJTubSH3q4iAHJEwU4MHOBpNARAB0oI8N9tMvGGd VnXQ+cTHqdO/K91QjEmgQ4zLSToZCx8EIF34UGjP4mTNCTaLTaCdo7V6T BK98og+7+Vg20qh2bLLUtZOUaQ1AhB3543AtaqMYaHkxYSdc36wtPa8iq 7FMsL/eBiE05wzLWBQwAe1YLoUZRUCiZQ7PCnogiQ5MG56kZ1WqvioPFq Zvp9yP6YZjL9hmzsq4k2+cWqBfP9oFcpXt0CLIwRcxBHBudP24nPsDtKl 1cRc4nF4UOFeKGbjDls9WkJOoVtfZtyxO1MFIxBg7ekgekuqmvQ3W2zKK Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="229443176" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="229443176" 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:04:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="622658367" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by FMSMGA003.fm.intel.com with ESMTP; 10 Feb 2022 04:04:09 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson Subject: [PATCH v2 7/7] buildtools/chkincs: test headers for C++ compatibility Date: Thu, 10 Feb 2022 12:02:57 +0000 Message-Id: <20220210120257.585822-8-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 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 --- buildtools/chkincs/main.cpp | 4 ++++ buildtools/chkincs/meson.build | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 buildtools/chkincs/main.cpp 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)