From patchwork Thu Feb 10 14:03:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107259 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 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 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 14:03:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 107260 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 932D1A00BE; Thu, 10 Feb 2022 15:04:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 53B4A42722; Thu, 10 Feb 2022 15:04:32 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id DFF3C42711; Thu, 10 Feb 2022 15:04:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501869; x=1676037869; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mniVCn9k5i1gPUhp/5Epowbf2EvwvceUaEu1OsgzmG0=; b=e5IKCbF0kcLb8pITyNy++dJ7XukOau6A3qK8QNSZN/rtbpLsSBdz5HOA bw2RPYAsGkiFgXLiaX6Ai8torZQpXd2Gw/PRQhkYgWO/EHOHlFIFgyOL3 BB2XNtKUL+pEoCeDt1384s4/EyvnyHuRa6MyWF1aeYsDjz0XIj372OOrb iZqenUMPA682rtWutS5t/hxkEYydHWhoDeF+3PpSNJDfzp9VptCQi3Oa6 umdBtT1uBsJUJCEIqnkVakaAm4sDeQyb5BZXImuPeeNx5hh/o1XdbXHfY EVSSLKvAAMBaFI1514O0vq+iyj2cah1MCCxp5t2i8gPev93j+u1M/DB4K A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781094" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781094" 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:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964246" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:26 -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 v3 2/7] eventdev: fix header build with C++ Date: Thu, 10 Feb 2022 14:03:50 +0000 Message-Id: <20220210140355.586399-3-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 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 14:03: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: 107261 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 87259A00BE; Thu, 10 Feb 2022 15:04:44 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 251F642726; Thu, 10 Feb 2022 15:04:33 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id D65F042714; Thu, 10 Feb 2022 15:04: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=1644501871; x=1676037871; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=dBD+GspqG2no2kAvYJxoW+EbbsTf0E3yomllcbb7Cf0=; b=XPRM1mZhgcY8zAYQzndEUH2cxajyxfNpUckE865UoTyzkvNIx8SPuC6l O0iODhzPUcm6HmSPi2pJA+Z5ogOQ3ou6vUGWcVd7fI4BLRrcx/fdZi+UC hkvWreiPew1kLaPw3xcOu+h/L6c3FBfewcjKmuXCE6ImdGBTqOZe7YpGX qsKZfMiYnF6XBa+yze11FDwl0nxNukxAS1Pyln+CqseXB0IQymumgQE7U rh/BwGAvDENg0UFr0KpBhPFO0RAM7Apan+Nr6s2dbgOrZqCUEcDH6Z2tX d7YnrF1Lr3hFS+y0YVe+gT+mvVcEiC1p4NyBKGxwr6aZDR5fR1iOl44Vf g==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781098" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781098" 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:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964256" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:28 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , jerinj@marvell.com, stable@dpdk.org, Kiran Kumar K , Nithin Dabilpuram , Pavan Nikhilesh Subject: [PATCH v3 3/7] graph: fix missing explicit cast for C++ build Date: Thu, 10 Feb 2022 14:03:51 +0000 Message-Id: <20220210140355.586399-4-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 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 14:03: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: 107262 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 17825A00BE; Thu, 10 Feb 2022 15:04:51 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92BAB4272B; Thu, 10 Feb 2022 15:04:37 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 7139242726; Thu, 10 Feb 2022 15:04:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501872; x=1676037872; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=w3nkWAkj48JjmdHoviKPTULgG9C8eXj6VE6zcJgyzQQ=; b=c0RujVbcE/aRQB446zzfz/+ufKhjD/0hfTrae6bWrZFcbempkY3R+Mj3 9LbPD1WWBETA0TSSiLDwpH927qfBadDtQ7vDoNgObyqYt7A89hMeZqDk0 wwLxHF3Kqeb+j/XL+UnWWYWeElrPy8ApUZT6aqlnCIyyhd51oafMT9ago 17J3MX7wF5yVh8GAYsKATmfqBUNHf549BXxWHzxGU2zIBoLXqryRX4kjp hkD4UrdGbSY6OvGMLj0BrsEhSqXpFWGXsQFR1xXcfHw4v9y+tuPA3zt0C s69wm5/zJHR21P0NHfaDu6o9Ive6t15kzhS00QxLj7XORY+E/8wSxaM7d g==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781108" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781108" 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:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964267" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:29 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , konstantin.ananyev@intel.com, stable@dpdk.org, Declan Doherty , Akhil Goyal Subject: [PATCH v3 4/7] ipsec: fix missing explicit cast for C++ build Date: Thu, 10 Feb 2022 14:03:52 +0000 Message-Id: <20220210140355.586399-5-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 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 --- 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 14:03: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: 107263 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 639AEA00BE; Thu, 10 Feb 2022 15:04:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B26EC42739; Thu, 10 Feb 2022 15:04:38 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 7D27F4272B; Thu, 10 Feb 2022 15:04:33 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501873; x=1676037873; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pw8h7l85GTUAWLoIdKJY/D6EzLxrtOlOWNXgp0QmUVE=; b=A9AKjy6XmCid8bMdqnkLAgZh8NmfWbyuHQO2Ii4o4+zX7/zjSezHRl+Y 8OvYR/Z8vQBtTwqjLnPPvEaJve7uqzeoUV9G8H+KHoRgrau+k7OodSNL5 jAJd4yezCwkO6JsBllhgxr+Ynf2atfQGqjqhgaByw13JXrALvBOyOCPog 2wT5kNkmf5UzgsOUOjXdbXWql2mHFZcCw8EZWokuvlR8ZQ8pSbYkpQXSu B4i2CmpJiKz03jxCHI0LaITWVIVymPt/ljXWcWllyXDpyVmttNK575PQ3 cRMGJDp0/3H1NbdFNQzFSB7tYI+3fn6EMO7H6QJI8jFyqF6wtIKH3iC8E Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781113" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781113" 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:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964279" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:31 -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 v3 5/7] table: fix missing explicit casts for C++ build Date: Thu, 10 Feb 2022 14:03:53 +0000 Message-Id: <20220210140355.586399-6-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 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 14:03: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: 107264 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 168CAA00BE; Thu, 10 Feb 2022 15:05:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1529A42743; Thu, 10 Feb 2022 15:04:40 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id EB7B442732; Thu, 10 Feb 2022 15:04:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501875; x=1676037875; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=veIxnvD4HcP71geTR9XiNe9UbAQ5n7+OKC29V7i55zI=; b=ViGwBfVolDc0j5GXIQ8cC6cDzItWyDoHDz6qDpvPVWM8clX6jMgchYtC lpj2hAvaE0yy8jU7aN0nGLv1uxTbvkm5DVC19a6SmQ+pdnZJ034o9q7E4 Hr393UYovb1uTB7A6jR1dcuIKPQO3OlWLBtzIT6LEL1GIYA+FAKucjJUo hYPwePL7nefYIIkKIk9SWYp31YNjwr3iGWhJkdz3HayIDxDbhsfZ2pvgA VijkgiIYYbKR1LptfUVCRy+sUuk7aNdDNJ0CNJ14H6cy0+oDAKkiXpWXT fiXbZaAuzUZ3/RZ8Tfc8BAjRJZ3uL/j/hFgb08B75HNeI8EWVgw9QIvbW g==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781116" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781116" 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:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964285" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:33 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , adrien.mazarguil@6wind.com, stable@dpdk.org, Yuanhan Liu , Maxime Coquelin Subject: [PATCH v3 6/7] vhost: fix incompatible header includes for C++ Date: Thu, 10 Feb 2022 14:03:54 +0000 Message-Id: <20220210140355.586399-7-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 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 14:03: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: 107265 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 C5D5CA00C2; Thu, 10 Feb 2022 15:05:11 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E757742745; Thu, 10 Feb 2022 15:04:40 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id 1D9E94271E for ; Thu, 10 Feb 2022 15:04:35 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644501876; x=1676037876; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4Ibb21kATi9rzqe3WyPjCC7aDfmyQy2U45C/Ium/Krk=; b=DnGIW28zlWbBAjdcZrov6w5thHRdCeNB6mtHlXapfZlq95EQf2WpIuJF BvUhV2X/K4OcTCY1W7QcpBIiWTyOR+8Gx4MuZaKCe+QDiJ0rHNkKMT/Of 68MHnnWA2KvDl/M46dqXWJPOhbDZIdSZ2CeHY6tlpE4Ii5hgK+FF8niFo +1rJ6wtEHst9Tv7Rma8Ry0VsXfN2cB5bgiPDMgVIR/m1KU5on/d+o+kDq 2BGCkMpyZsDsgTXVmmfvJ51IgTWiK7+BIBk74Vg8oUlez+jmsGjJIREMy y5TRTzvLM9fA42CSfenokIar9K4ScSPIiB4k/E4yOvKM84uOmR6oE7Jws A==; X-IronPort-AV: E=McAfee;i="6200,9189,10253"; a="312781119" X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="312781119" 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:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,358,1635231600"; d="scan'208";a="585964294" Received: from silpixa00399126.ir.intel.com ([10.237.223.162]) by fmsmga008.fm.intel.com with ESMTP; 10 Feb 2022 06:04:34 -0800 From: Bruce Richardson To: dev@dpdk.org Cc: Bruce Richardson , Aaron Conole , Michael Santana Subject: [PATCH v3 7/7] buildtools/chkincs: test headers for C++ compatibility Date: Thu, 10 Feb 2022 14:03:55 +0000 Message-Id: <20220210140355.586399-8-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 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 + buildtools/chkincs/main.cpp | 4 ++++ buildtools/chkincs/meson.build | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+) 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/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)