Skip to content

Rshim IOCTL stats #152

@mpodles

Description

@mpodles

Dear team,

I'm working on Bluefield 2 DPU devices and have received scripts that can access low-level statistics. I don't know how much of the details are neccesary but in brief what the script does is open a file descriptor to rshim.

self.rshim_fd = os.open(filename, os.O_RDWR)

with filename /dev/rshim0
and then the script tries to

adapted_addr = (channel << 16) | addr
buf= array.array("B", 16*[0])                                                                                                               
struct.pack_into('<LQ',buf, 0, adapted_addr, 0)                                                                                             
sys.stdout.flush()                                                                                                                          
fcntl.ioctl(self.rshim_fd, 1, buf) 
val=buf[4:12]                                                                                                                               
rv=struct.unpack("<Q",bytearray(val))[0] 

which results in
IOError: [Errno 25] Inappropriate ioctl for device

I've looped through all the others possible values instead of 1 and the error is the same.
The version:

rshim -v
rshim 2.0.20

If you need any additional info about what the script does we can go deeper into it. I would be grateful for any help.

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions