[openfabrics-ewg] FW: Mstflint - not working on ppc64 andwhendriver is not loaded on AMD

Michael S. Tsirkin mst at mellanox.co.il
Thu Sep 28 06:40:30 PDT 2006


Quoting r. Moshe Kazir <moshek at voltaire.com>:
> 
> Quoting r. Moshe Kazir <moshek at voltaire.com>:
> > Subject: RE: FW: Mstflint - not working on ppc64 andwhendriver is not 
> > loaded on AMD
> > 
> > 
> >  # ls /sys/class/infiniband/mthca0/device/resource0
> > /sys/class/infiniband/mthca0/device/resource0
> 
> OK, so can you try this please:
> 
> strace -f -v -o log  mstflint -d
> /sys/class/infiniband/mthca0/device/resource0 q
> 
> cat log
> 
> -- 
> MST



> 30463 open("/sys/class/infiniband/mthca0/device/resource0", O_RDWR|O_SYNC|O_LARGEFILE) = 3
> 30463 mmap2(NULL, 1048576, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = -1 EINVAL (Invalid argument)

So we see that mmap is failing with EINVAL.
But why? We seem to be passing all valid parameters to it.

I'm looking at arch/ppc/kernel/pci.c at the moment.
It seems that EINVAL is returned if __pci_mmap_make_offset
fails, and that seems to be only looking for a valid resource size.

Are you up to finding the root cause of the problem in arch/ppc/kernel/pci.c?

Maybe the resource offsets are wrong? What does
cat /sys/class/infiniband/mthca0/device/resource
show?

Maybe there's some problem to map a full megabyte?
Here's a test that only maps 4K. Could you strace it please?

>>>>>>>>>>>

#define _XOPEN_SOURCE 500
#define _FILE_OFFSET_BITS 64

#include <stdio.h>

#include <unistd.h>

#include <netinet/in.h>
#include <endian.h>
#include <byteswap.h>
#include <errno.h>
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>

#include <sys/pci.h>
#include <sys/ioctl.h>

#include <sys/mman.h>
#include <sys/pci.h>
#include <sys/stat.h>
/* #include <sys/ioctl.h>
 * #include <sys/types.h> */

int main()
{
        int fd;
        unsigned value;
        volatile void *ptr;
        fd = open("/proc/bus/pci/00/00.0" ,O_RDWR | O_SYNC);

        /* ioctl(fd, PCIIOC_MMAP_IS_MEM); */
        ptr = mmap(NULL, 0x1000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xf0000);
        memcpy(&value, (void*)(ptr + 0x14), sizeof value);
        printf("0x%x\n");
        return 0;
}



-- 
MST




More information about the ewg mailing list