[dpdk-dev,1/2] eal/bsd: fix ioport write operation
Checks
Commit Message
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 <tiwei.bie@intel.com>
---
lib/librte_eal/bsdapp/eal/eal_pci.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On Sun, May 07, 2017 at 01:33:33PM +0000, Tiwei Bie wrote:
> 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 <tiwei.bie@intel.com> ---
How was this bug discovered so that we can verify that it is fixed?. Is
this in use by virtio or was it just discovered via code inspection?
/Bruce
On Mon, May 08, 2017 at 09:55:01AM +0100, Bruce Richardson wrote:
> On Sun, May 07, 2017 at 01:33:33PM +0000, Tiwei Bie wrote:
> > 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 <tiwei.bie@intel.com> ---
> How was this bug discovered so that we can verify that it is fixed?. Is
> this in use by virtio or was it just discovered via code inspection?
>
The virtio PMD in legacy mode doesn't work FreeBSD, and I tried to
fix this issue. And then I found this bug.
Best regards,
Tiwei Bie
On Mon, May 08, 2017 at 05:07:36PM +0800, Tiwei Bie wrote:
> On Mon, May 08, 2017 at 09:55:01AM +0100, Bruce Richardson wrote:
> > On Sun, May 07, 2017 at 01:33:33PM +0000, Tiwei Bie wrote:
> > > 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 <tiwei.bie@intel.com> ---
> > How was this bug discovered so that we can verify that it is fixed?. Is
> > this in use by virtio or was it just discovered via code inspection?
> >
>
> The virtio PMD in legacy mode doesn't work FreeBSD, and I tried to
> fix this issue. And then I found this bug.
>
> Best regards,
> Tiwei Bie
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
@@ -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