Thread (13 messages) 13 messages, 3 authors, 2024-08-01

Re: [PATCH net-next v2 1/2] selftests: net-drv: exercise queue stats when the device is down

From: Petr Machata <petrm@nvidia.com>
Date: 2024-08-01 21:39:33
Also in: linux-kselftest

Stanislav Fomichev [off-list ref] writes:
On 08/01, Petr Machata wrote:
quoted
Stanislav Fomichev [off-list ref] writes:
quoted
On 07/31, Jakub Kicinski wrote:
quoted
On Wed, 31 Jul 2024 13:34:58 +0200 Petr Machata wrote:
quoted
quoted
+        qstat = netfam.qstats_get({"ifindex": cfg.ifindex}, dump=True)
+    except NlError as e:
+        if e.error == 95:  
Could you do this as if e.error == errno.ENOTSUP?
just to be clear EOPNOTSUPP ..
That might be the reason it's coded explicitly as 95? :-D
Both exist, I just didn't notice the latter.
quoted
quoted
quoted
import errno
errno.ENOTSUP
95
quoted
quoted
quoted
errno.EOPNOTSUPP
95
I believe Jakub was talking about kernel's ENOTSUPP (524) vs EOPNOTSUPP (95):

$ grep ENOTSUPP include/linux/errno.h
#define ENOTSUPP        524     /* Operation is not supported */

$ grep EOPNOTSUPP include/uapi/asm-generic/errno.h
#define EOPNOTSUPP      95      /* Operation not supported on transport endpoint */

These two are frequently confused.

OTOH, ENOTSUP looks like a userspace/libc invention:

$ grep -w ENOTSUP /usr/include/bits/errno.h
# ifndef ENOTSUP
#  define ENOTSUP               EOPNOTSUPP

I'm gonna stick to kernel's EOPNOTSUPP to make it look similar to what
we have on the kernel side.
Yep, sounds good.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help