ib_register_client get wrong devices. device->name print strange thing.

I wrote kernel module using infiniband.

first of all, I call ib_register_client function with ib_client who has .add function pointer.

ret = ib_register_client(&ib_client);

and here is my add_one function.

static void add_one(struct ib_device *device)

{

pr_info(“add_one called for device %s\n”, device->name);

This code supposed to print device name like “mlx5_0” but It printed out below.

[ 232.612704] add_one called for device P\xcf\xcd\xc0\xff\xff\xff\xff\x80\xce\xcd\xc0\xff\xff\xff\xff\x90\xce\xc0\xff\xff\xff\xff0\xce\xcd\xc0\xff\xff\xff\xff \xae\xcf\xc0\xff\xff\xff\xff\x90\xea\xce\xc0\xff\xff\xff\xff\xe0\xe6\xce\xc0\xff\xff\xff\xff\xa0\xe8\xce\xc0\xff\xff\xff\xff\xe0\xe8\xce\xc0\xff\xff\xff\xffP\xea\xce\xc0\xff\xff\xff\xff`

This is ibstat result.

CA ‘mlx5_0’

CA type: MT4119

Number of ports: 1

Firmware version: 16.28.1002

Hardware version: 0

Node GUID: 0x98039b0300034dd8

System image GUID: 0x98039b0300034dd8

Port 1:

State: Active

Physical state: LinkUp

Rate: 100

Base lid: 7

LMC: 0

SM lid: 2

Capability mask: 0x2651e848

Port GUID: 0x98039b0300034dd8

Link layer: InfiniBand

CA ‘mlx5_1’

CA type: MT4119

Number of ports: 1

Firmware version: 16.28.1002

Hardware version: 0

Node GUID: 0x98039b0300034dd9

System image GUID: 0x98039b0300034dd8

Port 1:

State: Down

Physical state: Disabled

Rate: 10

Base lid: 65535

LMC: 0

SM lid: 0

Capability mask: 0x2651e848

Port GUID: 0x98039b0300034dd9

Link layer: InfiniBand

I uninstall MLNXOFED driver 5-1.0.6.6 then it works. My system OS is Ubuntu18.04 but I compiled linux kernel 5.3 and boot with it. This can cause problem? What driver should I use?

Hi,

Interresting, MOFED 5.1 and above must works as well.

If you want me to investigate it, please open a case and provide a test case.

Regards

Marc