-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOError: [Errno 25] Inappropriate ioctl for device #17
Comments
I've never see that before, it suggests your kernel is too old or something is wrong with the ioctl execution.. What kernel version is that? |
this is Redhat 7.4, running kernel 4.11.0-44.5.1.el7a.ppc64le. |
That kernel is certainly new enough. Is this a big endian power 9? I guess the ioctl must be malformed. Can you strace 'ibtool sminfo' ? |
Actually, it is little-endian, as shown from ppc64le designation.
|
No idea. This is the line: ioctl(3, _IOC(0, 0x1b, 0x03, 0x00), 0) = -1 ENOTTY (Inappropriate ioctl for device) And that looks perfectly OK to me. The kernel shouldn't fail it. Hmm. sminfo silently ignores failures here. Can you strace sminfo and look for that ioctl please? |
It seems trying different path:
|
Huh. PPC has a different definition for IOC_NONE for some reason. Does this fix it for you? diff --git a/rdma/umad.py b/rdma/umad.py
index 76ff470714dae0..f9e2a9201778d2 100644
--- a/rdma/umad.py
+++ b/rdma/umad.py
@@ -55,7 +55,7 @@ class UMAD(rdma.tools.SysFSDevice,rdma.madtransactor.MADTransactor):
IB_IOCTL_MAGIC = 0x1b
IB_USER_MAD_REGISTER_AGENT = rdma.tools._IOC(3,IB_IOCTL_MAGIC,1,28);
IB_USER_MAD_UNREGISTER_AGENT = rdma.tools._IOC(1,IB_IOCTL_MAGIC,2,4);
- IB_USER_MAD_ENABLE_PKEY = rdma.tools._IOC(0,IB_IOCTL_MAGIC,3,0);
+ IB_USER_MAD_ENABLE_PKEY = rdma.tools._IOC(1,IB_IOCTL_MAGIC,3,0);
# typedef struct ib_user_mad {
# uint32_t agent_id; The others are wrong too though. Not totally sure how best to fix this though. |
I tried that - doesn't seem to fix the problem ...
This strace output is a bit different though. |
It shouldn't be IOC_READ that would be '2'.. Ugh PPC also has a different _IOC_SIZEBITS. diff --git a/rdma/tools.py b/rdma/tools.py
index 11dd79a6b6bb81..9b72220158a13a 100644
--- a/rdma/tools.py
+++ b/rdma/tools.py
@@ -8,7 +8,7 @@ import collections;
def _IOC(dir,type,nr,size):
"""Emulate the C _IOC macro"""
- return (((dir) << (0 + 8 + 8 + 14)) | # (_IOC_SIZESHIFT+_IOC_SIZEBITS)
+ return (((dir) << (0 + 8 + 8 + 13)) | # (_IOC_SIZESHIFT+_IOC_SIZEBITS)
((type) << (0 + 8)) | # (_IOC_NRSHIFT+_IOC_NRBITS)
((nr) << 0) |
((size) << ((0 + 8) + 8))); # (_IOC_TYPESHIFT+_IOC_TYPEBITS)
diff --git a/rdma/umad.py b/rdma/umad.py
index 76ff470714dae0..f9e2a9201778d2 100644
--- a/rdma/umad.py
+++ b/rdma/umad.py
@@ -55,7 +55,7 @@ class UMAD(rdma.tools.SysFSDevice,rdma.madtransactor.MADTransactor):
IB_IOCTL_MAGIC = 0x1b
IB_USER_MAD_REGISTER_AGENT = rdma.tools._IOC(3,IB_IOCTL_MAGIC,1,28);
IB_USER_MAD_UNREGISTER_AGENT = rdma.tools._IOC(1,IB_IOCTL_MAGIC,2,4);
- IB_USER_MAD_ENABLE_PKEY = rdma.tools._IOC(0,IB_IOCTL_MAGIC,3,0);
+ IB_USER_MAD_ENABLE_PKEY = rdma.tools._IOC(1,IB_IOCTL_MAGIC,3,0);
# typedef struct ib_user_mad {
# uint32_t agent_id; |
still, strace:
|
So the fix for this is going to be to use one of the python IOCTL libraries out there, for instance this code https://github.com/olavmrk/python-ioctl |
I am trying out this
if I just ran
what am I missing? thanks
The text was updated successfully, but these errors were encountered: