From: Tiwei Bie Date: Sun, 7 May 2017 13:33:33 +0000 (+0000) Subject: eal/bsd: fix ioport write operation X-Git-Tag: spdx-start~3238 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=3a6a04ec794465c786f789522d733dfa88451a18;p=dpdk.git eal/bsd: fix ioport write operation The first param of out*() on FreeBSD is port, and the second one is data. But they are reversed in DPDK. This patch fixes it. Fixes: 756ce64b1ecd ("eal: introduce PCI ioport API") Cc: stable@dpdk.org Signed-off-by: Tiwei Bie Acked-by: Bruce Richardson --- diff --git a/lib/librte_eal/bsdapp/eal/eal_pci.c b/lib/librte_eal/bsdapp/eal/eal_pci.c index 6294b7eab6..59ceb76650 100644 --- a/lib/librte_eal/bsdapp/eal/eal_pci.c +++ b/lib/librte_eal/bsdapp/eal/eal_pci.c @@ -618,13 +618,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; - outl(*(const uint32_t *)s, reg); + outl(reg, *(const uint32_t *)s); } else if (len >= 2) { size = 2; - outw(*(const uint16_t *)s, reg); + outw(reg, *(const uint16_t *)s); } else { size = 1; - outb(*s, reg); + outb(reg, *s); } } #else