igb/igc/ixgbe: use EOPNOTSUPP instead of ENOTSUPP
Subsystems (3)
cover igb/igc/ixgbe: use EOPNOTSUPP instead of ENOTSUPP
This series fixes inconsistent errno usage in igb/igc/ixgbe. The drivers return -ENOTSUPP instead of -EOPNOTSUPP in specific ethtool and PTP functions, therefore userland programs would get "Unknown error 524".
Use -EOPNOTSUPP instead of -ENOTSUPP to fix the issue.
This series covers all incorrect usage of ENOTSUPP in Intel ethernet drivers except the one in iavf, which should be targeted for iwl-next in a separate series since it's just a comment. [1]
For igb and igc, I used a simple reproducer for testing [2] on I350 and I226-V respectively.
Without this series:
# strace -e ioctl ./errno-repro ioctl(3, SIOCETHTOOL, 0x7ffcde13cec0) = -1 ENOTSUPP (Unknown error 524)
With this series:
# strace -e ioctl ./errno-repro ioctl(3, SIOCETHTOOL, 0x7ffd69a28c40) = -1 EOPNOTSUPP (Operation not supported)
For ixgbe, I used the testptp for testing on 82599ES. Without this series:
# strace -e ioctl ./testptp -d /dev/ptp1 -P 1 ioctl(3, PTP_ENABLE_PPS, 0x1) = -1 ENOTSUPP (Unknown error 524)
With this series:
# strace -e ioctl ./testptp -d /dev/ptp1 -P 1 ioctl(3, PTP_ENABLE_PPS, 0x1) = -1 EOPNOTSUPP (Operation not supported)
[1]
$ grep -nrI ENOTSUPP . ./igc/igc_ethtool.c:813: return -ENOTSUPP; ./igb/igb_ethtool.c:2284: return -ENOTSUPP; ./ixgbe/ixgbe_ptp.c:644: return -ENOTSUPP; ./iavf/iavf_main.c:2966: * if the error isn't -ENOTSUPP
[2]
#include <sys/ioctl.h>
#include <net/if.h>
#include <string.h>
#include <unistd.h>
#include <linux/sockios.h>
#include <linux/ethtool.h>
int main() {
int sock = socket(AF_INET, SOCK_DGRAM, 0);
struct ethtool_gstrings gstrings = {};
struct ifreq ifr;
int ret;
gstrings.cmd = ETHTOOL_GSTRINGS;
gstrings.string_set = ETH_SS_WOL_MODES;
ifr.ifr_data = (char*)&gstrings;
strcpy(ifr.ifr_name, "enp4s0");
ret = ioctl(sock, SIOCETHTOOL, &ifr);
close(sock);
return ret;}
Kohei Enju (3):
igb: use EOPNOTSUPP instead of ENOTSUPP in igb_get_sset_count()
igc: use EOPNOTSUPP instead of ENOTSUPP in
igc_ethtool_get_sset_count()
ixgbe: use EOPNOTSUPP instead of ENOTSUPP in
ixgbe_ptp_feature_enable()
drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.48.1
PATCH 1/3 igb: use EOPNOTSUPP instead of ENOTSUPP in igb_get_sset_count()
igb_get_sset_count() returns -ENOTSUPP when a given stringset is not supported, causing userland programs to get "Unknown error 524".
Since EOPNOTSUPP should be used when error is propagated to userland, return -EOPNOTSUPP instead of -ENOTSUPP.
--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +1 -1
@@ -2281,7 +2281,7 @@ static int igb_get_sset_count(struct net_device *netdev, int sset)case ETH_SS_PRIV_FLAGS :return IGB_PRIV_FLAGS_STR_LEN ;default : -return -ENOTSUPP ; +return -EOPNOTSUPP ; } }
Signature · 1 line
2.48.1
RE: [Intel-wired-lan] [PATCH iwl-net v1 1/3] igb: use EOPNOTSUPP instead of ENOTSUPP in igb_get_sset_count()
Quoted 47 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Monday, October 6, 2025 2:35 PM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Auke Kok <[email protected]>; Jeff Garzik <[email protected]>; Sasha Neftin <[email protected]>; Richard Cochran <[email protected]>; Keller, Jacob E <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v1 1/3] igb: use EOPNOTSUPP instead of ENOTSUPP inigb_get_sset_count()
igb_get_sset_count()returns-ENOTSUPPwhen a given stringset is not supported, causing userland programs to get "Unknown error 524".Since EOPNOTSUPP should be used when error is propagated to userland, return
-EOPNOTSUPPinstead of-ENOTSUPP.Fixes 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver")Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/igb/igb_ethtool.c +1
-2@@ -2281,7 +2281,7 @@ static int igb_get_sset_count(struct net_device *netdev, int sset)case ETH_SS_PRIV_FLAGS :return IGB_PRIV_FLAGS_STR_LEN ;default : -return -ENOTSUPP ; +return -EOPNOTSUPP ; } } --
Quoted 1 line
2.48.1
PATCH 2/3 igc: use EOPNOTSUPP instead of ENOTSUPP in igc_ethtool_get_sset_count()
In reply to Kohei Enjuigc_ethtool_get_sset_count() returns -ENOTSUPP when a given stringset is not supported, causing userland programs to get "Unknown error 524".
Since EOPNOTSUPP should be used when error is propagated to userland, return -EOPNOTSUPP instead of -ENOTSUPP.
--- drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/igc/igc_ethtool.c +1 -1
@@ -810,7 +810,7 @@ static int igc_ethtool_get_sset_count(struct net_device *netdev, int sset)case ETH_SS_PRIV_FLAGS :return IGC_PRIV_FLAGS_STR_LEN ;default : -return -ENOTSUPP ; +return -EOPNOTSUPP ; } }
Signature · 1 line
2.48.1
RE: [Intel-wired-lan] [PATCH iwl-net v1 2/3] igc: use EOPNOTSUPP instead of ENOTSUPP in igc_ethtool_get_sset_count()
Quoted 48 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Monday, October 6, 2025 2:35 PM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Auke Kok <[email protected]>; Jeff Garzik <[email protected]>; Sasha Neftin <[email protected]>; Richard Cochran <[email protected]>; Keller, Jacob E <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v1 2/3] igc: use EOPNOTSUPP instead of ENOTSUPP inigc_ethtool_get_sset_count()
igc_ethtool_get_sset_count()returns-ENOTSUPPwhen a given stringset is not supported, causing userland programs to get "Unknown error 524".Since EOPNOTSUPP should be used when error is propagated to userland, return
-EOPNOTSUPPinstead of-ENOTSUPP.Fixes 36b9fea60961 ("igc: Add support for statistics")Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/igc/igc_ethtool.c +1
-2@@ -810,7 +810,7 @@ static int igc_ethtool_get_sset_count(struct net_device *netdev, int sset)case ETH_SS_PRIV_FLAGS :return IGC_PRIV_FLAGS_STR_LEN ;default : -return -ENOTSUPP ; +return -EOPNOTSUPP ; } } --
Quoted 1 line
2.48.1
PATCH 3/3 ixgbe: use EOPNOTSUPP instead of ENOTSUPP in ixgbe_ptp_feature_enable()
In reply to Kohei EnjuWhen the requested PTP feature is not supported, ixgbe_ptp_feature_enable() returns -ENOTSUPP, causing userland programs to get "Unknown error 524".
Since EOPNOTSUPP should be used when error is propagated to userland, return -EOPNOTSUPP instead of -ENOTSUPP.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +1 -1
@@ -641,7 +641,7 @@ static int ixgbe_ptp_feature_enable(struct ptp_clock_info *ptp,* disabled */ if (rq->type !=PTP_CLK_REQ_PPS || !adapter->ptp_setup_sdp) -return -ENOTSUPP ; +return -EOPNOTSUPP ;if (on) adapter->flags2 |=IXGBE_FLAG2_PTP_PPS_ENABLED ;
Signature · 1 line
2.48.1
RE: [Intel-wired-lan] [PATCH iwl-net v1 3/3] ixgbe: use EOPNOTSUPP instead of ENOTSUPP in ixgbe_ptp_feature_enable()
Quoted 47 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Monday, October 6, 2025 2:35 PM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Auke Kok <[email protected]>; Jeff Garzik <[email protected]>; Sasha Neftin <[email protected]>; Richard Cochran <[email protected]>; Keller, Jacob E <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v1 3/3] ixgbe: use EOPNOTSUPP instead of ENOTSUPP inixgbe_ptp_feature_enable()When the requested PTP feature is not supported,
ixgbe_ptp_feature_enable()returns-ENOTSUPP, causing userland programs to get "Unknown error 524".Since EOPNOTSUPP should be used when error is propagated to userland, return
-EOPNOTSUPPinstead of-ENOTSUPP.Fixes 3a6a4edaa592 ("ixgbe: Hardware Timestamping + PTP HardwareClock (PHC)")
Signed-off-by Kohei Enju <[email protected]>--- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c +1
-1@@ -641,7 +641,7 @@ static int ixgbe_ptp_feature_enable(structptp_clock_info *ptp, * disabled */ if (rq->type !=PTP_CLK_REQ_PPS || !adapter->ptp_setup_sdp) -return -ENOTSUPP ; +return -EOPNOTSUPP ;if (on)
Quoted 3 lines
adapter->flags2|=IXGBE_FLAG2_PTP_PPS_ENABLED;
--
2.48.1
Quoted 69 lines · Kohei Enju
This series fixes inconsistent errno usage in igb/igc/ixgbe. The drivers return
-ENOTSUPPinstead of-EOPNOTSUPPin specific ethtool and PTP functions, therefore userland programs would get "Unknown error 524".Use
-EOPNOTSUPPinstead of-ENOTSUPPto fix the issue.This series covers all incorrect usage of ENOTSUPP in Intel ethernet drivers except the one in iavf, which should be targeted for iwl-next in a separate series since it's just a comment. [1]
For igb and igc, I used a simple reproducer for testing [2] on I350 and I226-V respectively.
Without this series:# strace -e ioctl ./errno-repro ioctl(3, SIOCETHTOOL, 0x7ffcde13cec0) = -1 ENOTSUPP (Unknown error 524)With this series:
# strace -e ioctl ./errno-repro ioctl(3, SIOCETHTOOL, 0x7ffd69a28c40) = -1 EOPNOTSUPP (Operation not supported)For ixgbe, I used the testptp for testing on 82599ES. Without this series:
# strace -e ioctl ./testptp -d /dev/ptp1 -P 1 ioctl(3, PTP_ENABLE_PPS, 0x1) = -1 ENOTSUPP (Unknown error 524)With this series:
# strace -e ioctl ./testptp -d /dev/ptp1 -P 1 ioctl(3, PTP_ENABLE_PPS, 0x1) = -1 EOPNOTSUPP (Operation not supported)[1]
$ grep -nrI ENOTSUPP . ./igc/igc_ethtool.c:813: return -ENOTSUPP; ./igb/igb_ethtool.c:2284: return -ENOTSUPP; ./ixgbe/ixgbe_ptp.c:644: return -ENOTSUPP; ./iavf/iavf_main.c:2966: * if the error isn't -ENOTSUPP[2]
#include <sys/ioctl.h>
#include <net/if.h>
#include <string.h>
#include <unistd.h>
#include <linux/sockios.h>
#include <linux/ethtool.h>int main() { int sock = socket(AF_INET, SOCK_DGRAM, 0); struct ethtool_gstrings gstrings = {}; struct ifreq ifr; int ret;gstrings.cmd = ETHTOOL_GSTRINGS; gstrings.string_set = ETH_SS_WOL_MODES; ifr.ifr_data = (char*)&gstrings; strcpy(ifr.ifr_name, "enp4s0"); ret = ioctl(sock, SIOCETHTOOL, &ifr); close(sock); return ret;}
Kohei Enju (3):
igb: use EOPNOTSUPP instead of ENOTSUPP inigb_get_sset_count()
igc: use EOPNOTSUPP instead of ENOTSUPP in
igc_ethtool_get_sset_count()
ixgbe: use EOPNOTSUPP instead of ENOTSUPP in
ixgbe_ptp_feature_enable()
Quoted 4 lines
drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Nice write-up and reproduction steps!
For the series:
Thanks,
Dawid
Jacob Keller
Reviewed-byQuoted 75 lines · Dawid Osuchowski
Quoted 69 lines · Kohei Enju
This series fixes inconsistent errno usage in igb/igc/ixgbe. The drivers return
-ENOTSUPPinstead of-EOPNOTSUPPin specific ethtool and PTP functions, therefore userland programs would get "Unknown error 524".Use
-EOPNOTSUPPinstead of-ENOTSUPPto fix the issue.This series covers all incorrect usage of ENOTSUPP in Intel ethernet drivers except the one in iavf, which should be targeted for iwl-next in a separate series since it's just a comment. [1]
For igb and igc, I used a simple reproducer for testing [2] on I350 and I226-V respectively.
Without this series:# strace -e ioctl ./errno-repro ioctl(3, SIOCETHTOOL, 0x7ffcde13cec0) = -1 ENOTSUPP (Unknown error 524)With this series:
# strace -e ioctl ./errno-repro ioctl(3, SIOCETHTOOL, 0x7ffd69a28c40) = -1 EOPNOTSUPP (Operation not supported)For ixgbe, I used the testptp for testing on 82599ES. Without this series:
# strace -e ioctl ./testptp -d /dev/ptp1 -P 1 ioctl(3, PTP_ENABLE_PPS, 0x1) = -1 ENOTSUPP (Unknown error 524)With this series:
# strace -e ioctl ./testptp -d /dev/ptp1 -P 1 ioctl(3, PTP_ENABLE_PPS, 0x1) = -1 EOPNOTSUPP (Operation not supported)[1]
$ grep -nrI ENOTSUPP . ./igc/igc_ethtool.c:813: return -ENOTSUPP; ./igb/igb_ethtool.c:2284: return -ENOTSUPP; ./ixgbe/ixgbe_ptp.c:644: return -ENOTSUPP; ./iavf/iavf_main.c:2966: * if the error isn't -ENOTSUPP[2]
#include <sys/ioctl.h>
#include <net/if.h>
#include <string.h>
#include <unistd.h>
#include <linux/sockios.h>
#include <linux/ethtool.h>int main() { int sock = socket(AF_INET, SOCK_DGRAM, 0); struct ethtool_gstrings gstrings = {}; struct ifreq ifr; int ret;gstrings.cmd = ETHTOOL_GSTRINGS; gstrings.string_set = ETH_SS_WOL_MODES; ifr.ifr_data = (char*)&gstrings; strcpy(ifr.ifr_name, "enp4s0"); ret = ioctl(sock, SIOCETHTOOL, &ifr); close(sock); return ret;}
Kohei Enju (3):
igb: use EOPNOTSUPP instead of ENOTSUPP inigb_get_sset_count()
igc: use EOPNOTSUPP instead of ENOTSUPP in
igc_ethtool_get_sset_count()
ixgbe: use EOPNOTSUPP instead of ENOTSUPP in
ixgbe_ptp_feature_enable()Quoted 4 lines
drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 +- drivers/net/ethernet/intel/igc/igc_ethtool.c | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_ptp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
Quoted 9 lines
Nice write-up and reproduction steps!
For the series:
Reviewed-by Dawid Osuchowski <[email protected]>Thanks,
Dawid
Agreed. Thanks for the work.
Quoted 30 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Kohei Enju
Sent: Monday, October 6, 2025 2:35 PM
To: [email protected]; [email protected]
Cc: Nguyen, Anthony L <[email protected]>; Kitszel, Przemyslaw <[email protected]>; Andrew Lunn <[email protected]>; David S. Miller <[email protected]>; Eric Dumazet <[email protected]>; Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>; Auke Kok <[email protected]>; Jeff Garzik <[email protected]>; Sasha Neftin <[email protected]>; Richard Cochran <[email protected]>; Keller, Jacob E <[email protected]>; [email protected]; Kohei Enju <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v1 0/3] igb/igc/ixgbe: use EOPNOTSUPP instead of ENOTSUPPThis series fixes inconsistent errno usage in igb/igc/ixgbe. The drivers return
-ENOTSUPPinstead of-EOPNOTSUPPin specific ethtool and PTP functions, therefore userland programs would get "Unknown error 524".Use
-EOPNOTSUPPinstead of-ENOTSUPPto fix the issue.This series covers all incorrect usage of ENOTSUPP in Intel ethernet drivers except the one in iavf, which should be targeted for iwl-next in a separate series since it's just a comment. [1]
...
Quoted 2 lines
--
2.48.1