From patchwork Mon Mar 11 17:36: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: 51085 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 C8BA04C96; Mon, 11 Mar 2019 18:37:32 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id E66F72C24 for ; Mon, 11 Mar 2019 18:37:29 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id D73199E1F70; Mon, 11 Mar 2019 17:37: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 9AE009E1F68; Mon, 11 Mar 2019 17:37:27 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:48 +0100 Message-Id: <20190311173702.24471-2-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 Mon Mar 11 17:36: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: 51086 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 435B64CA7; Mon, 11 Mar 2019 18:37:34 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 75F044C8F for ; Mon, 11 Mar 2019 18:37:30 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id E65429E1F6A; Mon, 11 Mar 2019 17:37: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 298F19E1F68; Mon, 11 Mar 2019 17:37:29 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:49 +0100 Message-Id: <20190311173702.24471-3-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 Mon Mar 11 17:36: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: 51087 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 A19C54CBD; Mon, 11 Mar 2019 18:37:35 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id B7EB14C95 for ; Mon, 11 Mar 2019 18:37:31 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 337D89E1F6A; Mon, 11 Mar 2019 17:37: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 5E17A9E1F68; Mon, 11 Mar 2019 17:37:30 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:50 +0100 Message-Id: <20190311173702.24471-4-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- Please note that this is only compile tested with musl libc. 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..6058cd9f8 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 Mon Mar 11 17:36: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: 51088 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 033F14D3A; Mon, 11 Mar 2019 18:37:37 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 0E3134C9D for ; Mon, 11 Mar 2019 18:37:33 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 853499E1F68; Mon, 11 Mar 2019 17:37: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 95CCE9E1F70; Mon, 11 Mar 2019 17:37:31 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:51 +0100 Message-Id: <20190311173702.24471-5-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- Please note that this is only compile tested with musl libc on x86_64. 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 6058cd9f8..dfa42c565 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 Mon Mar 11 17:36: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: 51089 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 269064F9B; Mon, 11 Mar 2019 18:37:39 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 5CFB94CA9 for ; Mon, 11 Mar 2019 18:37:34 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id D750C9E1F68; Mon, 11 Mar 2019 17:37: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 F115E9E1F70; Mon, 11 Mar 2019 17:37:32 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:52 +0100 Message-Id: <20190311173702.24471-6-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 Mon Mar 11 17:36: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: 51090 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 D5E994C99; Mon, 11 Mar 2019 18:37:40 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 99C564C95 for ; Mon, 11 Mar 2019 18:37:35 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 1F7499E1F68; Mon, 11 Mar 2019 17:37: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 4355F9E1F6A; Mon, 11 Mar 2019 17:37:34 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:53 +0100 Message-Id: <20190311173702.24471-7-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 Mon Mar 11 17:36: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: 51091 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 4D5335681; Mon, 11 Mar 2019 18:37:43 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id D3AFB4CC7 for ; Mon, 11 Mar 2019 18:37:36 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 589109E1F68; Mon, 11 Mar 2019 17:37:36 +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 7BA9A9E1F70; Mon, 11 Mar 2019 17:37:35 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:54 +0100 Message-Id: <20190311173702.24471-8-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- 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 Mon Mar 11 17:36: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: 51092 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 5CA6356A3; Mon, 11 Mar 2019 18:37:45 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 1CE4E4F94 for ; Mon, 11 Mar 2019 18:37:38 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 8DF999E1F68; Mon, 11 Mar 2019 17:37: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 B3CE99E1F70; Mon, 11 Mar 2019 17:37:36 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:55 +0100 Message-Id: <20190311173702.24471-9-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 81e345b87..775ccd3dd 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 Mon Mar 11 17:36: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: 51093 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 7003158CB; Mon, 11 Mar 2019 18:37:47 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 3E84C4CB5 for ; Mon, 11 Mar 2019 18:37:39 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id B85979E1F68; Mon, 11 Mar 2019 17:37:38 +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 EAE999E1F70; Mon, 11 Mar 2019 17:37:37 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:56 +0100 Message-Id: <20190311173702.24471-10-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 Mon Mar 11 17:36: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: 51094 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 1FDC65920; Mon, 11 Mar 2019 18:37:49 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 8C8BE5398 for ; Mon, 11 Mar 2019 18:37:40 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id EF8759E1F68; Mon, 11 Mar 2019 17:37:39 +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 302599E1F6A; Mon, 11 Mar 2019 17:37:38 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:57 +0100 Message-Id: <20190311173702.24471-11-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- Note that err.h is not in POSIX standard either, but is implemented in musl libc. 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 Mon Mar 11 17:36:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51095 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 BE3F75A6E; Mon, 11 Mar 2019 18:37:50 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 7B0DA4F9A for ; Mon, 11 Mar 2019 18:37:41 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 007369E1F68; Mon, 11 Mar 2019 17:37:41 +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 418469E1F6A; Mon, 11 Mar 2019 17:37:40 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:58 +0100 Message-Id: <20190311173702.24471-12-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- This was not really a compile error but the warning looked scary enough. There are various alternative ways to detect 64bit user-space at compile time, but this is the most portable way I think. 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 Mon Mar 11 17:36:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51096 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 4D7385B26; Mon, 11 Mar 2019 18:37:52 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id A5ABA4D27 for ; Mon, 11 Mar 2019 18:37:42 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 2A8F79E1F68; Mon, 11 Mar 2019 17:37:42 +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 470969E1F6A; Mon, 11 Mar 2019 17:37:41 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:36:59 +0100 Message-Id: <20190311173702.24471-13-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- I guess the check for __linux__ and __GLIBC__ could be completely removed, but I was not sure. 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..b9564d848 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 Mon Mar 11 17:37:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51097 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 B40995B38; Mon, 11 Mar 2019 18:37:53 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 01AC9568A for ; Mon, 11 Mar 2019 18:37:44 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id 79C359E1F68; Mon, 11 Mar 2019 17:37:43 +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 B17AD9E1F6A; Mon, 11 Mar 2019 17:37:42 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:37:00 +0100 Message-Id: <20190311173702.24471-14-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 --- This does not really fix any error, but I cleaned it up while at it. Feel free to skip this patch. 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 b9564d848..f6186a9d3 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 Mon Mar 11 17:37:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51098 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 2141E5F11; Mon, 11 Mar 2019 18:37:55 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 3CDB0569B for ; Mon, 11 Mar 2019 18:37:45 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id B6A3F9E1F68; Mon, 11 Mar 2019 17:37:44 +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 DC5349E1F70; Mon, 11 Mar 2019 17:37:43 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:37:01 +0100 Message-Id: <20190311173702.24471-15-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 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 Acked-by: Stephen Hemminger --- This is a low priority patch, but it is so trivial so I fixed it while at it. 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 Mon Mar 11 17:37:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Natanael Copa X-Patchwork-Id: 51099 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 5E8005F1B; Mon, 11 Mar 2019 18:37:56 +0100 (CET) Received: from mx1.tetrasec.net (mx1.tetrasec.net [74.117.190.25]) by dpdk.org (Postfix) with ESMTP id 73FD358C6 for ; Mon, 11 Mar 2019 18:37:46 +0100 (CET) Received: from mx1.tetrasec.net (mail.local [127.0.0.1]) by mx1.tetrasec.net (Postfix) with ESMTP id EE07D9E1F68; Mon, 11 Mar 2019 17:37:45 +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 1FB6A9E1F70; Mon, 11 Mar 2019 17:37:44 +0000 (UTC) From: Natanael Copa To: dev@dpdk.org Cc: Natanael Copa Date: Mon, 11 Mar 2019 18:37:02 +0100 Message-Id: <20190311173702.24471-16-ncopa@alpinelinux.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190311173702.24471-1-ncopa@alpinelinux.org> References: <20190311173702.24471-1-ncopa@alpinelinux.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 15/15] eal/linux: use gettid(2) for 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. Use gettid(2) to get the kernel thread id instead. 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 --- This is not reallly a compile error, but the warning looked a bit scary, and code looked wrong, so I fixed it. lib/librte_eal/linuxapp/eal/eal_dev.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/librte_eal/linuxapp/eal/eal_dev.c b/lib/librte_eal/linuxapp/eal/eal_dev.c index 2830c8687..9ad6650cf 100644 --- a/lib/librte_eal/linuxapp/eal/eal_dev.c +++ b/lib/librte_eal/linuxapp/eal/eal_dev.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -30,6 +31,11 @@ static bool hotplug_handle; #define EAL_UEV_MSG_LEN 4096 #define EAL_UEV_MSG_ELEM_LEN 128 +#if !defined(__GLIBC__) +#include +#define gettid() syscall(SYS_gettid) +#endif + /* * spinlock for device hot-unplug failure handling. If it try to access bus or * device, such as handle sigbus on bus or handle memory failure for device @@ -67,7 +73,7 @@ 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); + (int)gettid(), info->si_addr); rte_spinlock_lock(&failure_handle_lock); ret = rte_bus_sigbus_handler(info->si_addr);