patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 20.11] bus/pci: support I/O port operations with musl
@ 2021-05-28  9:21 Thomas Monjalon
  2021-05-31 11:32 ` Xueming(Steven) Li
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Monjalon @ 2021-05-28  9:21 UTC (permalink / raw)
  To: stable; +Cc: xuemingl, Natanael Copa, Andrew Rybchenko, David Marchand

[ upstream commit 204a7f44bc457b2c75c9eeb56468214664c830f0 ]

Add a fallback for non-GNU libc systems like musl libc for the
non-standard functions outl_p, outw_p and outb_p.

It solves the following errors when building with musl libc:
	pci_uio.c: undefined reference to 'outw_p'
	pci_uio.c: undefined reference to 'outl_p'
	pci_uio.c: undefined reference to 'outb_p'

Bugzilla ID: 35
Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API")
Cc: stable@dpdk.org

Reported-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: David Marchand <david.marchand@redhat.com>
---
 drivers/bus/pci/linux/pci_uio.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c
index f3305a2f28..624b2e2ecf 100644
--- a/drivers/bus/pci/linux/pci_uio.c
+++ b/drivers/bus/pci/linux/pci_uio.c
@@ -535,21 +535,33 @@ pci_uio_ioport_write(struct rte_pci_ioport *p,
 		if (len >= 4) {
 			size = 4;
 #if defined(RTE_ARCH_X86)
+#ifdef __GLIBC__
 			outl_p(*(const uint32_t *)s, reg);
+#else
+			outl(*(const uint32_t *)s, reg);
+#endif
 #else
 			*(volatile uint32_t *)reg = *(const uint32_t *)s;
 #endif
 		} else if (len >= 2) {
 			size = 2;
 #if defined(RTE_ARCH_X86)
+#ifdef __GLIBC__
 			outw_p(*(const uint16_t *)s, reg);
+#else
+			outw(*(const uint16_t *)s, reg);
+#endif
 #else
 			*(volatile uint16_t *)reg = *(const uint16_t *)s;
 #endif
 		} else {
 			size = 1;
 #if defined(RTE_ARCH_X86)
+#ifdef __GLIBC__
 			outb_p(*s, reg);
+#else
+			outb(*s, reg);
+#endif
 #else
 			*(volatile uint8_t *)reg = *s;
 #endif
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH 20.11] bus/pci: support I/O port operations with musl
  2021-05-28  9:21 [dpdk-stable] [PATCH 20.11] bus/pci: support I/O port operations with musl Thomas Monjalon
@ 2021-05-31 11:32 ` Xueming(Steven) Li
  0 siblings, 0 replies; 2+ messages in thread
From: Xueming(Steven) Li @ 2021-05-31 11:32 UTC (permalink / raw)
  To: NBU-Contact-Thomas Monjalon, stable
  Cc: Natanael Copa, Andrew Rybchenko, David Marchand

Thanks, applied into 20.11 work queue

> -----Original Message-----
> From: Thomas Monjalon <thomas@monjalon.net>
> Sent: Friday, May 28, 2021 5:21 PM
> To: stable@dpdk.org
> Cc: Xueming(Steven) Li <xuemingl@nvidia.com>; Natanael Copa <ncopa@alpinelinux.org>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; David Marchand <david.marchand@redhat.com>
> Subject: [PATCH 20.11] bus/pci: support I/O port operations with musl
> 
> [ upstream commit 204a7f44bc457b2c75c9eeb56468214664c830f0 ]
> 
> Add a fallback for non-GNU libc systems like musl libc for the non-standard functions outl_p, outw_p and outb_p.
> 
> It solves the following errors when building with musl libc:
> 	pci_uio.c: undefined reference to 'outw_p'
> 	pci_uio.c: undefined reference to 'outl_p'
> 	pci_uio.c: undefined reference to 'outb_p'
> 
> Bugzilla ID: 35
> Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API")
> Cc: stable@dpdk.org
> 
> Reported-by: Natanael Copa <ncopa@alpinelinux.org>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Acked-by: David Marchand <david.marchand@redhat.com>
> ---
>  drivers/bus/pci/linux/pci_uio.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index f3305a2f28..624b2e2ecf 100644
> --- a/drivers/bus/pci/linux/pci_uio.c
> +++ b/drivers/bus/pci/linux/pci_uio.c
> @@ -535,21 +535,33 @@ pci_uio_ioport_write(struct rte_pci_ioport *p,
>  		if (len >= 4) {
>  			size = 4;
>  #if defined(RTE_ARCH_X86)
> +#ifdef __GLIBC__
>  			outl_p(*(const uint32_t *)s, reg);
> +#else
> +			outl(*(const uint32_t *)s, reg);
> +#endif
>  #else
>  			*(volatile uint32_t *)reg = *(const uint32_t *)s;  #endif
>  		} else if (len >= 2) {
>  			size = 2;
>  #if defined(RTE_ARCH_X86)
> +#ifdef __GLIBC__
>  			outw_p(*(const uint16_t *)s, reg);
> +#else
> +			outw(*(const uint16_t *)s, reg);
> +#endif
>  #else
>  			*(volatile uint16_t *)reg = *(const uint16_t *)s;  #endif
>  		} else {
>  			size = 1;
>  #if defined(RTE_ARCH_X86)
> +#ifdef __GLIBC__
>  			outb_p(*s, reg);
> +#else
> +			outb(*s, reg);
> +#endif
>  #else
>  			*(volatile uint8_t *)reg = *s;
>  #endif
> --
> 2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-31 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28  9:21 [dpdk-stable] [PATCH 20.11] bus/pci: support I/O port operations with musl Thomas Monjalon
2021-05-31 11:32 ` Xueming(Steven) Li

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git