From patchwork Thu Jun 9 12:16:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Kardach X-Patchwork-Id: 112615 X-Patchwork-Delegate: david.marchand@redhat.com 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 60183A0555; Thu, 9 Jun 2022 14:17:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B5684280B; Thu, 9 Jun 2022 14:17:15 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id 00DC640A7D for ; Thu, 9 Jun 2022 14:17:12 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id w20so16036781lfa.11 for ; Thu, 09 Jun 2022 05:17:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Yhoxn4ytCyugxT4U99qpxlKim/LStTu07HEc+ucYX+k=; b=lxMzO9wgi5RZkePtddeEVgdDgLS3swgoWsZm0o5YHb0oS8nfyBmjMVxVaKuYqqlG02 Elwr5GIlh+hdUurtnIMMp0CekZp/sCfn0iR2Y+IpDj+oXIa4NzBSQezoCFASQ32P3YkE JG7Lq9EkBF/gc8CDWhHyUDFbzpNbHlqZV+1Zl89wcRcyMMQnNtjDdLhc0lAC8fuvIB+R xsJ0ghEo94GdeHsmQhCIRG4l0wxDQ0S/Yx6rq3VLxA3FfVDeiK7nicPQRUONjCewHeuv lNWhUwaIqfh5Gk4NVfSN3HbtNOZ+RHHY+HDS1bk726Ubl2XiN7XOAMsTb/kEsP/ehvaz ggdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Yhoxn4ytCyugxT4U99qpxlKim/LStTu07HEc+ucYX+k=; b=s/mWfa+i7voznGdauTTbOMV7ZTqrHBVK3idUdLPy9Cy2n2yMaSH+8pVE7NXslzs+1J EQ8vqEbGC0PF5DiGMpRXG4u0LsjLANTdt2xHRnVMLb9ewtT0BuzwxrjG+hOb7iiRUD9G ybTDCqOPavKYjDAPgjge1MWWInhqygKPwFPQGOeP+8D3aMpuQzIGnqfHv2ywn4ny3VE+ 85gKL+3xl7iOE/ohdMriFjywKBLkTE2L2xNEEjFBkICKhgVSglbfTSZcInMNAJ8Evz2y FokXT0ojbHJVYoIa2hGWIS3HFEeJXXkZoaIksfzz1KSK00HWNyJTTDhOAM/NUq4u3673 dxcg== X-Gm-Message-State: AOAM533xWnHOpOX7ITPACtu3RdG1N4YKT3qGYIjVHZX3lhz96UDaXg9p AJXaOwpdPVTbcW6ljqG1kqthLQ== X-Google-Smtp-Source: ABdhPJwXmXXqDQWjywqOK3RqX7P3sGTi69LvLpf+GQ8ZwGHR1tbwxSOaO3HmlQEa1ICuYH2G5iftzA== X-Received: by 2002:a05:6512:3a93:b0:479:76e7:3861 with SMTP id q19-20020a0565123a9300b0047976e73861mr6014307lfu.446.1654777032538; Thu, 09 Jun 2022 05:17:12 -0700 (PDT) Received: from toster.semihalf.net ([83.142.187.86]) by smtp.gmail.com with ESMTPSA id f6-20020a2eb5a6000000b00253da47cfbesm3706999ljn.80.2022.06.09.05.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 05:17:12 -0700 (PDT) From: Stanislaw Kardach To: David Marchand Cc: Stanislaw Kardach , dev@dpdk.org, upstream@semihalf.com Subject: [PATCH 1/3] eal/riscv: fix xmm_t casting for C++ Date: Thu, 9 Jun 2022 14:16:59 +0200 Message-Id: <20220609121701.716299-2-kda@semihalf.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609121701.716299-1-kda@semihalf.com> References: <20220609121701.716299-1-kda@semihalf.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 rte_xmm_t is a union type which wraps around xmm_t and maps its contents to scalar structures. Since C++ has stricter type conversion rules than C, the rte_xmm_t::x has to be used instead of C-casting. Signed-off-by: Stanislaw Kardach Reviewed-by: David Marchand --- lib/eal/riscv/include/rte_vect.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/eal/riscv/include/rte_vect.h b/lib/eal/riscv/include/rte_vect.h index 4600521c20..2f97f437a2 100644 --- a/lib/eal/riscv/include/rte_vect.h +++ b/lib/eal/riscv/include/rte_vect.h @@ -41,8 +41,8 @@ vect_load_128(void *p) static inline xmm_t vect_and(xmm_t data, xmm_t mask) { - rte_xmm_t ret = (rte_xmm_t)data; - rte_xmm_t m = (rte_xmm_t)mask; + rte_xmm_t ret = {.x = data }; + rte_xmm_t m = {.x = mask }; ret.u64[0] &= m.u64[0]; ret.u64[1] &= m.u64[1]; return ret.x; From patchwork Thu Jun 9 12:17:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Kardach X-Patchwork-Id: 112614 X-Patchwork-Delegate: david.marchand@redhat.com 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 AA78DA0555; Thu, 9 Jun 2022 14:17:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 80B9C427E9; Thu, 9 Jun 2022 14:17:14 +0200 (CEST) Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) by mails.dpdk.org (Postfix) with ESMTP id D2867406B4 for ; Thu, 9 Jun 2022 14:17:13 +0200 (CEST) Received: by mail-lj1-f177.google.com with SMTP id y29so25933791ljd.7 for ; Thu, 09 Jun 2022 05:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wXpXhR6pVCJLgcYGYWXmNmuOfSD4Vu5jMcpligv6DK8=; b=Yst37CBumRzsL71dzXMc1/eQ6kuaX7advg+hVHqs8fDvoS1Rtz4oHMWRTFAkqfOYvB UKKamW34I+lB42dYw/8i5kzuZXfZ9gJ/bVwrBN6YXAAJ1mOKCXdFfHzlBakRy1tZQ2wC KmeAAioMPhvqxMvieAF2QuTBSnXCpjHsL4mVERz+Npu9jpCguTHv/cAE0UnDHIf4IxLP fMybUKAGakxaCYUxTuAdP6uqWfIwgKnNFdZwhZFz/dKJQBGAObDB++qWZgm+DPyMfMc1 fe1S5M9giEN6F32mxrxYSMxCeU2Np1sE19aeI+JYTKKIHd3qiCZWSzUFvVdLFF4NHmnU Rqkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wXpXhR6pVCJLgcYGYWXmNmuOfSD4Vu5jMcpligv6DK8=; b=TC/oUL4ZsHTjJAuKdy2AHjNox/OuYmnxgR/ndZaVvq0iEPsgfOTmMmQPiR1oYZUHoz 52VEwrg/6UvEnzVBVGFGgyiR4jRzWC/NhWrRs07ObTxsyemuApo17Khz8aCXkgIVP/tT jsjCkr+oqjnZxRllFWaOg7rqDfl9/UsJHw/MxOkt4kkNMaMujcgQsZcufziDA/4XxXmO CgEjC2eQ8KS9+wx8JncpsgteKwp6zRaoaCrywOoBTubJHcyaK52UTG5YjJh5NtcEbvea FU2WrGy+/QaGXgovHEra3t57L0oMuduEkx8DSBT6vxTpEL5QjgTBK4YjQEOQM8bliJAF OMbg== X-Gm-Message-State: AOAM533lXjZhJRudeCv1MPOdzv166oUXU2V8WOO4vdepta9t/jJkmS9L agYOKksONn4z833Aj+GzDB+pQQ== X-Google-Smtp-Source: ABdhPJyYO7ofgpG2t6WczsCB9cqyUMqJHtOgYz/7ZUvs7WB1om/nlxAi93hXdxQTYw20AtjbO9WY0Q== X-Received: by 2002:a2e:b988:0:b0:255:75b6:91ff with SMTP id p8-20020a2eb988000000b0025575b691ffmr20398096ljp.228.1654777033407; Thu, 09 Jun 2022 05:17:13 -0700 (PDT) Received: from toster.semihalf.net ([83.142.187.86]) by smtp.gmail.com with ESMTPSA id f6-20020a2eb5a6000000b00253da47cfbesm3706999ljn.80.2022.06.09.05.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 05:17:13 -0700 (PDT) From: Stanislaw Kardach To: Vladimir Medvedkin Cc: Stanislaw Kardach , David Marchand , dev@dpdk.org, upstream@semihalf.com Subject: [PATCH 2/3] lpm: fix xmm_t casting for C++ in scalar version Date: Thu, 9 Jun 2022 14:17:00 +0200 Message-Id: <20220609121701.716299-3-kda@semihalf.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609121701.716299-1-kda@semihalf.com> References: <20220609121701.716299-1-kda@semihalf.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 rte_xmm_t is a union type which wraps around xmm_t and maps its contents to scalar structures. Since C++ has stricter type conversion rules than C, the rte_xmm_t::x has to be used instead of C-casting. The generated assembly is identical to the code without the fix (checked both on x86 and RISC-V). Signed-off-by: Stanislaw Kardach Reviewed-by: David Marchand --- lib/lpm/rte_lpm_scalar.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/lpm/rte_lpm_scalar.h b/lib/lpm/rte_lpm_scalar.h index f0d9f37894..161b40ff80 100644 --- a/lib/lpm/rte_lpm_scalar.h +++ b/lib/lpm/rte_lpm_scalar.h @@ -15,18 +15,19 @@ extern "C" { static inline void rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4], - uint32_t defv) + uint32_t defv) { + rte_xmm_t xip = { .x = ip }; uint32_t nh; int ret; - ret = rte_lpm_lookup(lpm, ((rte_xmm_t)ip).u32[0], &nh); + ret = rte_lpm_lookup(lpm, xip.u32[0], &nh); hop[0] = (ret == 0) ? nh : defv; - ret = rte_lpm_lookup(lpm, ((rte_xmm_t)ip).u32[1], &nh); + ret = rte_lpm_lookup(lpm, xip.u32[1], &nh); hop[1] = (ret == 0) ? nh : defv; - ret = rte_lpm_lookup(lpm, ((rte_xmm_t)ip).u32[2], &nh); + ret = rte_lpm_lookup(lpm, xip.u32[2], &nh); hop[2] = (ret == 0) ? nh : defv; - ret = rte_lpm_lookup(lpm, ((rte_xmm_t)ip).u32[3], &nh); + ret = rte_lpm_lookup(lpm, xip.u32[3], &nh); hop[3] = (ret == 0) ? nh : defv; } From patchwork Thu Jun 9 12:17:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislaw Kardach X-Patchwork-Id: 112616 X-Patchwork-Delegate: david.marchand@redhat.com 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 F14A6A0555; Thu, 9 Jun 2022 14:17:33 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CC1414282A; Thu, 9 Jun 2022 14:17:18 +0200 (CEST) Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) by mails.dpdk.org (Postfix) with ESMTP id DFCA4427F9 for ; Thu, 9 Jun 2022 14:17:14 +0200 (CEST) Received: by mail-lf1-f52.google.com with SMTP id i29so20943300lfp.3 for ; Thu, 09 Jun 2022 05:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=aN+wK5nqbMTsbPIsmRkEFCSdqjzeVDgB5gAcaKI165U=; b=HJPrhCrGZ0Ifv70S1rnO8IQAYori94ebtMp9QV9uyhryK21HM16srZZdEVjzmOY/C3 9b9nzxcyUl+bIx2vfU1N5lT7ShE42wXUYeGMAMlnKiSTU9kenWSGEMG9/e9ohTJthf8n C/NDVjhyV/cfioeEXXilINVOXp0Qoe+ChM9q9JJ4jk5BsYqwNiaVi+xpznWkqcoSP/3A HLsXPNH4/HlFT+DizZ+Pyqb5laJB+GIa46H2FX7aGd0dsMing98y3eBmSRK+iyKj0BRp M3k0ZGZkz0lFJMG7wMBQAShL+ZTk/tPCsl1F6skBWTzEVjpSIBCMG8Q9W7ROAVbzVzoG EZ6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=aN+wK5nqbMTsbPIsmRkEFCSdqjzeVDgB5gAcaKI165U=; b=58Wlhtmb0sbPt976seTEmoCC03qe4MR4OkmZ4XrgCYhr2fBvCBNN/emecq2Ue0EErl YSuFckph23bQQ68knPPIC12p1lcdpZV8BnA6EqDsqrXhBLDPHERuLQGzU7ZI11ow9icv nPmCjwHhIMUVvHrh8ZU2uwkH6zgmlSTNqO8Y6E7znnjBq/+byTluqSQyKIJ1wOXzV/6L bdUHiiSCyWP7fQ1/XhjzNxvEt3MYDVQIMOUW64SyyDcMasuEtOOh5qwnZyBzQnNYtuGf CEjm+rSBaA4h0uXaNoLjJV0wd+dH7+bdMpy/QTVGMKXoclrbOaycE21WgATFqBennOCD H5sA== X-Gm-Message-State: AOAM531jrKzYBD9mA+HWd/ZJtTao9qh+m6tiUcg152hMAGsw4jUzhGmt fhBqXLzW3kQFbxHYw6cs6aGtaQ== X-Google-Smtp-Source: ABdhPJwnwkt3EQlZGxndxgyzzsm0RShckjiPYmgqyFMtXTuRk7HKW34BGDnqJf7TNMkeq1H2rrrhoQ== X-Received: by 2002:a05:6512:2216:b0:479:390c:70e with SMTP id h22-20020a056512221600b00479390c070emr13979939lfu.453.1654777034512; Thu, 09 Jun 2022 05:17:14 -0700 (PDT) Received: from toster.semihalf.net ([83.142.187.86]) by smtp.gmail.com with ESMTPSA id f6-20020a2eb5a6000000b00253da47cfbesm3706999ljn.80.2022.06.09.05.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jun 2022 05:17:14 -0700 (PDT) From: Stanislaw Kardach To: Aaron Conole Cc: Stanislaw Kardach , David Marchand , dev@dpdk.org, upstream@semihalf.com Subject: [PATCH 3/3] ci: use crossbuild-essential-riscv64 for compiling Date: Thu, 9 Jun 2022 14:17:01 +0200 Message-Id: <20220609121701.716299-4-kda@semihalf.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220609121701.716299-1-kda@semihalf.com> References: <20220609121701.716299-1-kda@semihalf.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 current packages installed for RISC-V build check do not contain a C++ compiler, which hid an issue with C++ type conversion in the rte_vect.h header on RISC-V or in the scalar implementation of the LPM x4 lookup. Now that this issue is fixed, use the full toolchain install to enable the C++ test. Besides, the user's guide for RISC-V cross-compilation recommends the use of crossbuild-essential-riscv64. Signed-off-by: Stanislaw Kardach Reviewed-by: David Marchand Acked-by: Aaron Conole --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c8528cb04..c0d2829d0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -139,8 +139,7 @@ jobs: pkg-config-powerpc-linux-gnu - name: Install riscv64 cross compiling packages if: env.RISCV64 == 'true' - run: sudo apt install -y gcc-riscv64-linux-gnu libc6-dev-riscv64-cross - pkg-config-riscv64-linux-gnu + run: sudo apt install -y crossbuild-essential-riscv64 - name: Install test tools packages if: env.AARCH64 != 'true' || env.PPC64LE != 'true' || env.RISCV64 != 'true' || env.RUN_TESTS == 'true' run: sudo apt install -y gdb