From patchwork Wed Mar 13 17:06:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51161 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 56DB84C9D; Wed, 13 Mar 2019 18:07:23 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 21A3337B0 for ; Wed, 13 Mar 2019 18:07:21 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 639569E1D55; Wed, 13 Mar 2019 17:07:20 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 8C2C29E03AF; Wed, 13 Mar 2019 17:07:19 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:43 +0100 Message-Id: <20190313170657.16688-2-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 01/15] app/testpmd: replace uint with unsigned int X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Improve portability by avoid use non-standard 'uint'. This fixes following build error when building with musl libc: In file included from ../app/test-pmd/cmdline.c:75: ../app/test-pmd/testpmd.h:809:29: error: unknown type name 'uint'; did you mean 'int'? uint8_t *hash_key, uint hash_key_len); ^~~~ int Signed-off-by: Natanael Copa --- app/test-pmd/testpmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index fa4887853..84ef3fc30 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -806,7 +806,7 @@ int set_vf_rate_limit(portid_t port_id, uint16_t vf, uint16_t rate, void port_rss_hash_conf_show(portid_t port_id, int show_rss_key); void port_rss_hash_key_update(portid_t port_id, char rss_type[], - uint8_t *hash_key, uint hash_key_len); + uint8_t *hash_key, unsigned int hash_key_len); int rx_queue_id_is_invalid(queueid_t rxq_id); int tx_queue_id_is_invalid(queueid_t txq_id); void setup_gro(const char *onoff, portid_t port_id); From patchwork Wed Mar 13 17:06:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51162 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 840574CA7; Wed, 13 Mar 2019 18:07:25 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 8DECC37B0 for ; Wed, 13 Mar 2019 18:07:22 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 9EF819E03AF; Wed, 13 Mar 2019 17:07:21 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id C3FA99E1D58; Wed, 13 Mar 2019 17:07:20 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:44 +0100 Message-Id: <20190313170657.16688-3-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 02/15] net/cxgbe: replace uint with unsigned int X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Improve portability and fix build error with musl libc: In file included from ../drivers/net/cxgbe/cxgbe_filter.c:7: ../drivers/net/cxgbe/base/common.h:201:4: error: unknown type name 'uint' uint synmapen:1; /* SYN Map Enable */ ^~~~ Signed-off-by: Natanael Copa --- drivers/net/cxgbe/base/common.h | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/cxgbe/base/common.h b/drivers/net/cxgbe/base/common.h index 973d4d7dd..1f52609c6 100644 --- a/drivers/net/cxgbe/base/common.h +++ b/drivers/net/cxgbe/base/common.h @@ -198,15 +198,15 @@ struct rss_params { unsigned int mode; /* RSS mode */ union { struct { - uint synmapen:1; /* SYN Map Enable */ - uint syn4tupenipv6:1; /* en 4-tuple IPv6 SYNs hash */ - uint syn2tupenipv6:1; /* en 2-tuple IPv6 SYNs hash */ - uint syn4tupenipv4:1; /* en 4-tuple IPv4 SYNs hash */ - uint syn2tupenipv4:1; /* en 2-tuple IPv4 SYNs hash */ - uint ofdmapen:1; /* Offload Map Enable */ - uint tnlmapen:1; /* Tunnel Map Enable */ - uint tnlalllookup:1; /* Tunnel All Lookup */ - uint hashtoeplitz:1; /* use Toeplitz hash */ + unsigned int synmapen:1; /* SYN Map Enable */ + unsigned int syn4tupenipv6:1; /* en 4-tuple IPv6 SYNs hash */ + unsigned int syn2tupenipv6:1; /* en 2-tuple IPv6 SYNs hash */ + unsigned int syn4tupenipv4:1; /* en 4-tuple IPv4 SYNs hash */ + unsigned int syn2tupenipv4:1; /* en 2-tuple IPv4 SYNs hash */ + unsigned int ofdmapen:1; /* Offload Map Enable */ + unsigned int tnlmapen:1; /* Tunnel Map Enable */ + unsigned int tnlalllookup:1; /* Tunnel All Lookup */ + unsigned int hashtoeplitz:1; /* use Toeplitz hash */ } basicvirtual; } u; }; From patchwork Wed Mar 13 17:06:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51163 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 614F14CC3; Wed, 13 Mar 2019 18:07:27 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 493304C96 for ; Wed, 13 Mar 2019 18:07:23 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id C12E39E1D55; Wed, 13 Mar 2019 17:07:22 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 069999E1D60; Wed, 13 Mar 2019 17:07:21 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:45 +0100 Message-Id: <20190313170657.16688-4-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 03/15] bus/pci: add fallback for out[lwb]_p for non GNU libc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add a fallback for non-GNU libc systems like musl libc for the non-standard functions outl_p, outw_p and outb_p. This ifixes the following buildtime errors when building with musl libc: pci_uio.c:(.text+0xaa1): undefined reference to `outw_p' pci_uio.c:(.text+0xac5): undefined reference to `outl_p' pci_uio.c:(.text+0xadf): undefined reference to `outb_p' fixes https://bugs.dpdk.org/show_bug.cgi?id=35 Signed-off-by: Natanael Copa --- drivers/bus/pci/linux/pci_uio.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index 09ecbb7aa..e1dd8c875 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -14,6 +14,32 @@ #if defined(RTE_ARCH_X86) #include +#if defined(__GLIBC__) +#define pci_uio_outl_p outl_p +#define pci_uio_outw_p outw_p +#define pci_uio_outb_p outb_p +#else +static inline void +pci_uio_outl_p(unsigned int value, unsigned short int port) +{ + __asm__ __volatile__ ("outl %0,%w1\noutb %%al,$0x80" : : "a" (value), + "Nd" (port)); +} + +static inline void +pci_uio_outw_p(unsigned short int value, unsigned short int port) +{ + __asm__ __volatile__ ("outw %w0,%w1\noutb %%al,$0x80" : : "a" (value), + "Nd" (port)); +} + +static inline void +pci_uio_outb_p(unsigned char value, unsigned short int port) +{ + __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80" : : "a" (value), + "Nd" (port)); +} +#endif #endif #include @@ -527,21 +553,21 @@ pci_uio_ioport_write(struct rte_pci_ioport *p, if (len >= 4) { size = 4; #if defined(RTE_ARCH_X86) - outl_p(*(const uint32_t *)s, reg); + pci_uio_outl_p(*(const uint32_t *)s, reg); #else *(volatile uint32_t *)reg = *(const uint32_t *)s; #endif } else if (len >= 2) { size = 2; #if defined(RTE_ARCH_X86) - outw_p(*(const uint16_t *)s, reg); + pci_uio_outw_p(*(const uint16_t *)s, reg); #else *(volatile uint16_t *)reg = *(const uint16_t *)s; #endif } else { size = 1; #if defined(RTE_ARCH_X86) - outb_p(*s, reg); + pci_uio_outb_p(*s, reg); #else *(volatile uint8_t *)reg = *s; #endif From patchwork Wed Mar 13 17:06:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51164 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C867E4F90; Wed, 13 Mar 2019 18:07:28 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 63BDA4C96 for ; Wed, 13 Mar 2019 18:07:24 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id DA5AB9E03AF; Wed, 13 Mar 2019 17:07:23 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 2AA219E1D58; Wed, 13 Mar 2019 17:07:22 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:46 +0100 Message-Id: <20190313170657.16688-5-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 04/15] bus/pci: factor out various ifdefs in pci_uio_ioport_{read, write} X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" define the macros so we can remove various #if defined(RTE_ARCH_X86) Ref: https://bugs.dpdk.org/show_bug.cgi?id=35#c6 Signed-off-by: Natanael Copa --- drivers/bus/pci/linux/pci_uio.c | 54 +++++++++++++++------------------ 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index e1dd8c875..b0470358d 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -14,11 +14,18 @@ #if defined(RTE_ARCH_X86) #include + +#define pci_uio_inl(reg) inl(reg) +#define pci_uio_inw(reg) inw(reg) +#define pci_uio_inb(reg) inb(reg) + #if defined(__GLIBC__) + #define pci_uio_outl_p outl_p #define pci_uio_outw_p outw_p #define pci_uio_outb_p outb_p -#else + +#else /* defined(__GLIBC__) */ static inline void pci_uio_outl_p(unsigned int value, unsigned short int port) { @@ -39,8 +46,19 @@ pci_uio_outb_p(unsigned char value, unsigned short int port) __asm__ __volatile__ ("outb %b0,%w1\noutb %%al,$0x80" : : "a" (value), "Nd" (port)); } -#endif -#endif +#endif /* defined(__GLIBC__) */ + +#else /* RTE_ARCH_X86 */ + +#define pci_uio_inl(reg) (*(volatile uint32_t *)(reg)) +#define pci_uio_inw(reg) (*(volatile uint16_t *)(reg)) +#define pci_uio_inb(reg) (*(volatile uint8_t *)(reg)) + +#define pci_uio_outl_p(value, reg) (*(volatile uint32_t *)(reg) = (value)) +#define pci_uio_outw_p(value, reg) (*(volatile uint16_t *)(reg) = (value)) +#define pci_uio_outb_p(value, reg) (*(volatile uint8_t *)(reg) = (value)) + +#endif /* RTE_ARCH_X86 */ #include #include @@ -518,25 +536,13 @@ pci_uio_ioport_read(struct rte_pci_ioport *p, for (d = data; len > 0; d += size, reg += size, len -= size) { if (len >= 4) { size = 4; -#if defined(RTE_ARCH_X86) - *(uint32_t *)d = inl(reg); -#else - *(uint32_t *)d = *(volatile uint32_t *)reg; -#endif + *(uint32_t *)d = pci_uio_inl(reg); } else if (len >= 2) { size = 2; -#if defined(RTE_ARCH_X86) - *(uint16_t *)d = inw(reg); -#else - *(uint16_t *)d = *(volatile uint16_t *)reg; -#endif + *(uint16_t *)d = pci_uio_inw(reg); } else { size = 1; -#if defined(RTE_ARCH_X86) - *d = inb(reg); -#else - *d = *(volatile uint8_t *)reg; -#endif + *d = pci_uio_inb(reg); } } } @@ -552,25 +558,13 @@ pci_uio_ioport_write(struct rte_pci_ioport *p, for (s = data; len > 0; s += size, reg += size, len -= size) { if (len >= 4) { size = 4; -#if defined(RTE_ARCH_X86) pci_uio_outl_p(*(const uint32_t *)s, reg); -#else - *(volatile uint32_t *)reg = *(const uint32_t *)s; -#endif } else if (len >= 2) { size = 2; -#if defined(RTE_ARCH_X86) pci_uio_outw_p(*(const uint16_t *)s, reg); -#else - *(volatile uint16_t *)reg = *(const uint16_t *)s; -#endif } else { size = 1; -#if defined(RTE_ARCH_X86) pci_uio_outb_p(*s, reg); -#else - *(volatile uint8_t *)reg = *s; -#endif } } } From patchwork Wed Mar 13 17:06:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51165 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0EFCA5323; Wed, 13 Mar 2019 18:07:31 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 815F84CA6 for ; Wed, 13 Mar 2019 18:07:25 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 06BD39E03AF; Wed, 13 Mar 2019 17:07:25 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 444DC9E1D58; Wed, 13 Mar 2019 17:07:24 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:47 +0100 Message-Id: <20190313170657.16688-6-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 05/15] bus/fslmc: fix compile error with musl libc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This fixes the following compile error with musl libc: ../drivers/bus/fslmc/qbman/include/compat.h:41:10: error: 'stdout' undeclared (first use in this function) fflush(stdout); \ ^~~~~~ Signed-off-by: Natanael Copa --- drivers/bus/fslmc/qbman/include/compat.h | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index 655bff4b6..ae84528b9 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -11,6 +11,7 @@ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif +#include #include #include #include From patchwork Wed Mar 13 17:06:48 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51166 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CF7B5589; Wed, 13 Mar 2019 18:07:32 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id A29464CB5 for ; Wed, 13 Mar 2019 18:07:26 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 233249E03AF; Wed, 13 Mar 2019 17:07:26 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 4D2EF9E1D55; Wed, 13 Mar 2019 17:07:25 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:48 +0100 Message-Id: <20190313170657.16688-7-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 06/15] bus/fslmc: remove unused include of error.h X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes following build error with musl libc: In file included from ../drivers/bus/fslmc/qbman/qbman_debug.c:6: ../drivers/bus/fslmc/qbman/include/compat.h:21:10: fatal error: error.h: No such file or directory #include ^~~~~~~~~ Apparently it is not used anywere in qbman so simply remove the include. Signed-off-by: Natanael Copa --- drivers/bus/fslmc/qbman/include/compat.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/bus/fslmc/qbman/include/compat.h b/drivers/bus/fslmc/qbman/include/compat.h index ae84528b9..1ddd69e12 100644 --- a/drivers/bus/fslmc/qbman/include/compat.h +++ b/drivers/bus/fslmc/qbman/include/compat.h @@ -18,7 +18,6 @@ #include #include #include -#include #include #include From patchwork Wed Mar 13 17:06:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51167 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 30B2B5689; Wed, 13 Mar 2019 18:07:34 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id C7A724CE4 for ; Wed, 13 Mar 2019 18:07:27 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 4CBAD9E03AF; Wed, 13 Mar 2019 17:07:27 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 81A1F9E1D58; Wed, 13 Mar 2019 17:07:26 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:49 +0100 Message-Id: <20190313170657.16688-8-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 07/15] net/nfp: build fix for musl libc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fixes following build error on systems without execinfo.h: ../drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c:19:10: fatal error: execinfo.h: No such file or directory #include ^~~~~~~~~~~~ Signed-off-by: Natanael Copa Acked-by: Alejandro Lucero --- drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c index 39bd48a83..93ee310f5 100644 --- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c @@ -16,7 +16,9 @@ #include #include +#if defined(RTE_BACKTRACE) #include +#endif #include #include #include From patchwork Wed Mar 13 17:06:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51168 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 1BBEC56A1; Wed, 13 Mar 2019 18:07:36 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 1A2464F94 for ; Wed, 13 Mar 2019 18:07:29 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 938689E03AF; Wed, 13 Mar 2019 17:07:28 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id BAC909E1D58; Wed, 13 Mar 2019 17:07:27 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:50 +0100 Message-Id: <20190313170657.16688-9-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 08/15] app/test: include fcntl.h due to use of O_RDONLY X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix following build error with musl libc: ../app/test/test_eal_flags.c:152:55: error: 'O_RDONLY' undeclared (first use in this function) fd = openat(dirfd(hugepage_dir), dirent->d_name, O_RDONLY); ^~~~~~~~ Signed-off-by: Natanael Copa --- app/test/test_eal_flags.c | 1 + 1 file changed, 1 insertion(+) diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index 1a64b0900..d626dd712 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include From patchwork Wed Mar 13 17:06:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51169 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BE55B58FE; Wed, 13 Mar 2019 18:07:37 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 4FF835323 for ; Wed, 13 Mar 2019 18:07:30 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id C8A6A9E03AF; Wed, 13 Mar 2019 17:07:29 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id F27DE9E1D58; Wed, 13 Mar 2019 17:07:28 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:51 +0100 Message-Id: <20190313170657.16688-10-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 09/15] app/test: fix setting of -D_GNU_SOURCE with meson X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" in app/test/meson.build the default_cflag is never used so the -D_GNU_SOURCE was never passed as intended. Fixes the following build error with musl libc: ../lib/librte_eal/common/include/rte_lcore.h:26:9: error: unknown type name 'cpu_set_t' typedef cpu_set_t rte_cpuset_t; ^~~~~~~~~ The problem is that cpu_set_t is only defined when _GNU_SOURCE is set. Signed-off-by: Natanael Copa --- app/test/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/meson.build b/app/test/meson.build index 05e5ddeb0..2f2ec5057 100644 --- a/app/test/meson.build +++ b/app/test/meson.build @@ -298,7 +298,7 @@ if cc.has_argument('-Wno-format-truncation') endif # specify -D_GNU_SOURCE unconditionally -default_cflags += '-D_GNU_SOURCE' +cflags += '-D_GNU_SOURCE' test_dep_objs = [] if dpdk_conf.has('RTE_LIBRTE_COMPRESSDEV') From patchwork Wed Mar 13 17:06:52 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51170 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F1651532C; Wed, 13 Mar 2019 18:07:38 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 8CCE85589 for ; Wed, 13 Mar 2019 18:07:31 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 115B09E03AF; Wed, 13 Mar 2019 17:07:31 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 29A9C9E1D58; Wed, 13 Mar 2019 17:07:30 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:52 +0100 Message-Id: <20190313170657.16688-11-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 10/15] bus/dpaa: use warn(3) instead of error(3) to improve portability X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix build with musl libc by using warn(3) instead of error(3). This also fixes error message for kzmalloc failures which previously would have given "Unknown error -1". Signed-off-by: Natanael Copa Signed-off-by: Natanael Copa --- drivers/bus/dpaa/base/fman/netcfg_layer.c | 4 ++-- drivers/bus/dpaa/base/qbman/bman_driver.c | 6 +++--- drivers/bus/dpaa/base/qbman/qman_driver.c | 12 ++++++------ drivers/bus/dpaa/include/compat.h | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/bus/dpaa/base/fman/netcfg_layer.c b/drivers/bus/dpaa/base/fman/netcfg_layer.c index 6b5224203..0c3a1bfa3 100644 --- a/drivers/bus/dpaa/base/fman/netcfg_layer.c +++ b/drivers/bus/dpaa/base/fman/netcfg_layer.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include @@ -89,7 +89,7 @@ netcfg_acquire(void) */ skfd = socket(AF_PACKET, SOCK_RAW, 0); if (unlikely(skfd < 0)) { - error(0, errno, "%s(): open(SOCK_RAW)", __func__); + warn("%s(): open(SOCK_RAW)", __func__); return NULL; } diff --git a/drivers/bus/dpaa/base/qbman/bman_driver.c b/drivers/bus/dpaa/base/qbman/bman_driver.c index 750b756b9..dbe00d1c9 100644 --- a/drivers/bus/dpaa/base/qbman/bman_driver.c +++ b/drivers/bus/dpaa/base/qbman/bman_driver.c @@ -40,7 +40,7 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared) ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + warn("pthread_getaffinity_np()"); return ret; } pcfg.cpu = -1; @@ -60,7 +60,7 @@ static int fsl_bman_portal_init(uint32_t idx, int is_shared) map.index = idx; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + warn("process_portal_map()"); return ret; } /* Make the portal's cache-[enabled|inhibited] regions */ @@ -105,7 +105,7 @@ static int fsl_bman_portal_finish(void) DPAA_BUG_ON(cfg != &pcfg); ret = process_portal_unmap(&map.addr); if (ret) - error(0, ret, "process_portal_unmap()"); + warn("process_portal_unmap()"); return ret; } diff --git a/drivers/bus/dpaa/base/qbman/qman_driver.c b/drivers/bus/dpaa/base/qbman/qman_driver.c index ba153396d..163a66b30 100644 --- a/drivers/bus/dpaa/base/qbman/qman_driver.c +++ b/drivers/bus/dpaa/base/qbman/qman_driver.c @@ -41,7 +41,7 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + warn("pthread_getaffinity_np()"); return ret; } qpcfg.cpu = -1; @@ -62,7 +62,7 @@ static int fsl_qman_portal_init(uint32_t index, int is_shared) map.index = index; ret = process_portal_map(&map); if (ret) { - error(0, ret, "process_portal_map()"); + warn("process_portal_map()"); return ret; } qpcfg.channel = map.channel; @@ -109,7 +109,7 @@ static int fsl_qman_portal_finish(void) DPAA_BUG_ON(cfg != &qpcfg); ret = process_portal_unmap(&map.addr); if (ret) - error(0, ret, "process_portal_unmap()"); + warn("process_portal_unmap()"); return ret; } @@ -156,7 +156,7 @@ struct qman_portal *fsl_qman_portal_create(void) q_pcfg = kzalloc((sizeof(struct qm_portal_config)), 0); if (!q_pcfg) { - error(0, -1, "q_pcfg kzalloc failed"); + warn("q_pcfg kzalloc failed"); return NULL; } @@ -164,7 +164,7 @@ struct qman_portal *fsl_qman_portal_create(void) ret = pthread_getaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); if (ret) { - error(0, ret, "pthread_getaffinity_np()"); + warn("pthread_getaffinity_np()"); kfree(q_pcfg); return NULL; } @@ -190,7 +190,7 @@ struct qman_portal *fsl_qman_portal_create(void) q_map.index = QBMAN_ANY_PORTAL_IDX; ret = process_portal_map(&q_map); if (ret) { - error(0, ret, "process_portal_map()"); + warn("process_portal_map()"); kfree(q_pcfg); return NULL; } diff --git a/drivers/bus/dpaa/include/compat.h b/drivers/bus/dpaa/include/compat.h index 412265779..0c01c5514 100644 --- a/drivers/bus/dpaa/include/compat.h +++ b/drivers/bus/dpaa/include/compat.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include From patchwork Wed Mar 13 17:06:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51171 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E10225B12; Wed, 13 Mar 2019 18:07:40 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id C03AB5688 for ; Wed, 13 Mar 2019 18:07:32 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 465C99E03AF; Wed, 13 Mar 2019 17:07:32 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 6E9D49E1D58; Wed, 13 Mar 2019 17:07:31 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:53 +0100 Message-Id: <20190313170657.16688-12-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 11/15] bus/dpaa: fix warning: "__WORDSIZE" is not defined, evaluates to 0 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is no standard saying that __WORDSIZE should be be defined or in what include it should be defined. Use a portable way to detect 64 bit environment. This fixes a warning when building with musl libc: warning: "__WORDSIZE" is not defined, evaluates to 0 [-Wundef] Signed-off-by: Natanael Copa Acked-by: Hemant Agrawal --- drivers/bus/dpaa/include/fsl_qman.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/bus/dpaa/include/fsl_qman.h b/drivers/bus/dpaa/include/fsl_qman.h index e43841499..7f3f40d49 100644 --- a/drivers/bus/dpaa/include/fsl_qman.h +++ b/drivers/bus/dpaa/include/fsl_qman.h @@ -11,11 +11,12 @@ extern "C" { #endif +#include #include #include /* FQ lookups (turn this on for 64bit user-space) */ -#if (__WORDSIZE == 64) +#if (ULONG_MAX == 0xffffffffffffffff) #define CONFIG_FSL_QMAN_FQ_LOOKUP /* if FQ lookups are supported, this controls the number of initialised, * s/w-consumed FQs that can be supported at any one time. From patchwork Wed Mar 13 17:06:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51172 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 222AE5B26; Wed, 13 Mar 2019 18:07:42 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 06DBD4F9B for ; Wed, 13 Mar 2019 18:07:34 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 7FFF09E03AF; Wed, 13 Mar 2019 17:07:33 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id A5F579E1D58; Wed, 13 Mar 2019 17:07:32 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:54 +0100 Message-Id: <20190313170657.16688-13-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 12/15] crypto/dpaa2_sec: build fix for musl libc X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The swab16/swab32/swab64 are Linux specific and nog GNU libc specific. Keep the check for __GLIBC__ just in case other GNU systems depends on this (Hurd or GNU/kFreeBSD). This fixes a build error with musl libc. Signed-off-by: Natanael Copa Acked-by: Hemant Agrawal Signed-off-by: Natanael Copa --- drivers/crypto/dpaa2_sec/hw/compat.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/hw/compat.h b/drivers/crypto/dpaa2_sec/hw/compat.h index ce946ccb5..1362045ca 100644 --- a/drivers/crypto/dpaa2_sec/hw/compat.h +++ b/drivers/crypto/dpaa2_sec/hw/compat.h @@ -11,7 +11,7 @@ #include #include -#ifdef __GLIBC__ +#ifdef __linux__ #include #include #include @@ -40,7 +40,7 @@ #define __maybe_unused __attribute__((unused)) #endif -#if defined(__GLIBC__) && !defined(pr_debug) +#if !defined(pr_debug) #if !defined(SUPPRESS_PRINTS) && defined(RTA_DEBUG) #define pr_debug(fmt, ...) \ RTE_LOG(DEBUG, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -49,7 +49,7 @@ #endif #endif /* pr_debug */ -#if defined(__GLIBC__) && !defined(pr_err) +#if !defined(pr_err) #if !defined(SUPPRESS_PRINTS) #define pr_err(fmt, ...) \ RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -58,7 +58,7 @@ #endif #endif /* pr_err */ -#if defined(__GLIBC__) && !defined(pr_warn) +#if !defined(pr_warn) #if !defined(SUPPRESS_PRINTS) #define pr_warn(fmt, ...) \ RTE_LOG(WARNING, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) @@ -101,7 +101,7 @@ #endif /* Use Linux naming convention */ -#ifdef __GLIBC__ +#if defined(__linux__) || defined(__GLIBC__) #define swab16(x) rte_bswap16(x) #define swab32(x) rte_bswap32(x) #define swab64(x) rte_bswap64(x) From patchwork Wed Mar 13 17:06:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51173 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 43E1A5B38; Wed, 13 Mar 2019 18:07:43 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 4CC4D569B for ; Wed, 13 Mar 2019 18:07:35 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id B922D9E03AF; Wed, 13 Mar 2019 17:07:34 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id DCE379E1D58; Wed, 13 Mar 2019 17:07:33 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:55 +0100 Message-Id: <20190313170657.16688-14-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 13/15] crypto/dpaa2_sec: simplify pr_{debug, err, warn} macros X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Simplify pr_debug, pr_err and pr_warn macros by add an intermediate pr_msg macro. This way we only need test for SUPPRESS_PRINTS once. Signed-off-by: Natanael Copa Acked-by: Hemant Agrawal Acked-by: Hemant Agrawal Signed-off-by: Natanael Copa --- drivers/crypto/dpaa2_sec/hw/compat.h | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/drivers/crypto/dpaa2_sec/hw/compat.h b/drivers/crypto/dpaa2_sec/hw/compat.h index 1362045ca..e36229f5f 100644 --- a/drivers/crypto/dpaa2_sec/hw/compat.h +++ b/drivers/crypto/dpaa2_sec/hw/compat.h @@ -40,31 +40,27 @@ #define __maybe_unused __attribute__((unused)) #endif +#if defined(SUPPRESS_PRINTS) +#define pr_msg(l, fmt, ...) do { } while (0) +#else +#define pr_msg(l, fmt, ...) \ + RTE_LOG(l, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) +#endif + #if !defined(pr_debug) -#if !defined(SUPPRESS_PRINTS) && defined(RTA_DEBUG) -#define pr_debug(fmt, ...) \ - RTE_LOG(DEBUG, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) +#if defined(RTA_DEBUG) +#define pr_debug(fmt, ...) pr_msg(DEBUG, fmt, ##__VA_ARGS__) #else -#define pr_debug(fmt, ...) do { } while (0) +#define pr_debug(fmt, ...) do { } while (0) #endif #endif /* pr_debug */ #if !defined(pr_err) -#if !defined(SUPPRESS_PRINTS) -#define pr_err(fmt, ...) \ - RTE_LOG(ERR, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) -#else -#define pr_err(fmt, ...) do { } while (0) -#endif +#define pr_err(fmt, ...) pr_msg(ERR, fmt, ##__VA_ARGS__) #endif /* pr_err */ #if !defined(pr_warn) -#if !defined(SUPPRESS_PRINTS) -#define pr_warn(fmt, ...) \ - RTE_LOG(WARNING, PMD, "%s(): " fmt "\n", __func__, ##__VA_ARGS__) -#else -#define pr_warn(fmt, ...) do { } while (0) -#endif +#define pr_warn(fmt, ...) pr_msg(WARNING, fmt, ##__VA_ARGS__) #endif /* pr_warn */ /** From patchwork Wed Mar 13 17:06:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51174 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 88B0C5F0F; Wed, 13 Mar 2019 18:07:44 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 78D8258C6 for ; Wed, 13 Mar 2019 18:07:36 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id EE8AD9E03AF; Wed, 13 Mar 2019 17:07:35 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 125F89E1D55; Wed, 13 Mar 2019 17:07:34 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:56 +0100 Message-Id: <20190313170657.16688-15-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 14/15] net/netvsc: fix compile warning for fcntl.h include X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix the following warning when building with musl libc: In file included from ../drivers/net/netvsc/hn_vf.c:14: /usr/include/sys/fcntl.h:1:2: warning: #warning redirecting incorrect #include to [-Wcpp] #warning redirecting incorrect #include to ^~~~~~~ Signed-off-by: Natanael Copa --- drivers/net/netvsc/hn_vf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index 3f714ec99..6eeacb659 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -10,8 +10,8 @@ #include #include #include +#include #include -#include #include #include From patchwork Wed Mar 13 17:06:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51175 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF9875F1A; Wed, 13 Mar 2019 18:07:45 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id A8EB458F6 for ; Wed, 13 Mar 2019 18:07:37 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 2DC489E03AF; Wed, 13 Mar 2019 17:07:37 +0000 (UTC) Received: from ncopa-desktop.lan (67.63.200.37.customer.cdi.no [37.200.63.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: n@tanael.org) by mx1.tetrasec.net (Postfix) with ESMTPSA id 4A40C9E1D58; Wed, 13 Mar 2019 17:07:36 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Wed, 13 Mar 2019 18:06:57 +0100 Message-Id: <20190313170657.16688-16-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190313170657.16688-1-ncopa@alpinelinux.org> References: <20190313170657.16688-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 15/15] eal/linux: simplify debug message in sigbus_handler X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" There is no guarantee that pthread_self() returns the thread ID or that pthread_t is an integer. The thread ID is not that useful so simply remove it. This fixes the following warning when building with musl libc: ../lib/librte_eal/linuxapp/eal/eal_dev.c: In function 'sigbus_handler': ../lib/librte_eal/linuxapp/eal/eal_dev.c:70:3: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] (int)pthread_self(), info->si_addr); ^ Signed-off-by: Natanael Copa --- lib/librte_eal/linux/eal/eal_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eal/linux/eal/eal_dev.c b/lib/librte_eal/linux/eal/eal_dev.c index 2830c8687..c41809380 100644 --- a/lib/librte_eal/linux/eal/eal_dev.c +++ b/lib/librte_eal/linux/eal/eal_dev.c @@ -66,8 +66,8 @@ static void sigbus_handler(int signum, siginfo_t *info, { int ret; - RTE_LOG(DEBUG, EAL, "Thread[%d] catch SIGBUS, fault address:%p\n", - (int)pthread_self(), info->si_addr); + RTE_LOG(DEBUG, EAL, "Thread catch SIGBUS, fault address:%p\n", + info->si_addr); rte_spinlock_lock(&failure_handle_lock); ret = rte_bus_sigbus_handler(info->si_addr);