Skip to contentSkip to conversation

igb/igc/ixgbe: use EOPNOTSUPP instead of ENOTSUPP

PATCH In review Kohei Enju 4 participants 10 messages Oct 6, 2025 – Oct 7, 2025

Subsystems (3)
lore
Share & tools
lore

Kohei Enju

author
#0 lore raw

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
author
#1 lore raw

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.

Fixes 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver")
---
 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
index f8a208c84f15..10e2445e0ded 100644
@@ -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
Reviewed-by on v1 1/3
#2 lore raw

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 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.

Fixes 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver")
---
 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
index f8a208c84f15..10e2445e0ded 100644
@@ -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

author
#3 lore raw

PATCH 2/3 igc: use EOPNOTSUPP instead of ENOTSUPP in igc_ethtool_get_sset_count()

In reply to Kohei Enju

igc_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.

Fixes 36b9fea60961 ("igc: Add support for statistics")
---
 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
index ca93629b1d3a..bb783042d1af 100644
@@ -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
Reviewed-by on v1 2/3
#4 lore raw

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 in igc_ethtool_get_sset_count()

igc_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.

Fixes 36b9fea60961 ("igc: Add support for statistics")
---
 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
index ca93629b1d3a..bb783042d1af 100644
@@ -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

author
#5 lore raw

PATCH 3/3 ixgbe: use EOPNOTSUPP instead of ENOTSUPP in ixgbe_ptp_feature_enable()

In reply to Kohei Enju

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 -EOPNOTSUPP instead of -ENOTSUPP.

Fixes 3a6a4edaa592 ("ixgbe: Hardware Timestamping + PTP Hardware Clock (PHC)")
---
 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
index 114dd88fc71c..6885d2343c48 100644
@@ -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
Reviewed-by on v1 3/3
#6 lore raw

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 in ixgbe_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 -EOPNOTSUPP instead of -ENOTSUPP.

Fixes 3a6a4edaa592 ("ixgbe: Hardware Timestamping + PTP Hardware

Clock (PHC)")

---
 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
index 114dd88fc71c..6885d2343c48 100644
@@ -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)
Quoted 3 lines

adapter->flags2 |= IXGBE_FLAG2_PTP_PPS_ENABLED;
--
2.48.1

Reviewed-by on the v1 series
#7 lore raw
In reply to Kohei Enju
Quoted 69 lines · Kohei Enju

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()

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

Reviewed-by
#8 lore raw
Quoted 75 lines · Dawid Osuchowski
Quoted 69 lines · Kohei Enju

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()

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:

Thanks,
Dawid

Agreed. Thanks for the work.

Reviewed-by on the v1 series
#9 lore raw
In reply to Kohei Enju
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 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]

...

Quoted 2 lines

--
2.48.1