Skip to contentSkip to conversation

net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err

PATCH Applied Sean Anderson 4 participants 4 messages Jun 11, 2024 – Jun 12, 2024

Subsystems (4)

v2 of 4 Applied 1/1 Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err

This error message can be triggered by userspace. Use NL_SET_ERR_MSG so the message is returned to the user and to avoid polluting the kernel logs. Additionally, change the return value from EFAULT to EBUSY to better reflect the error (which has nothing to do with addressing).

---

Changes in v2:
- Split off from stats series
- Document return value change

 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +3 -3
index c29809cd9201..5f98daa5b341 100644
@@ -1945,9 +1945,9 @@ axienet_ethtools_set_coalesce(struct net_device *ndev,
 	struct axienet_local *lp = netdev_priv(ndev);
 
 	if (netif_running(ndev)) {
-		netdev_err(ndev,
-			   "Please stop netif before applying configuration\n");
-		return -EFAULT;
+		NL_SET_ERR_MSG(extack,
+			       "Please stop netif before applying configuration");
+		return -EBUSY;
 	}
 
 	if (ecoalesce->rx_max_coalesced_frames)
Signature · 1 line
2.35.1.1320.gc452695387.dirty
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Sean Anderson

This error message can be triggered by userspace. Use NL_SET_ERR_MSG so the message is returned to the user and to avoid polluting the kernel logs. Additionally, change the return value from EFAULT to EBUSY to better reflect the error (which has nothing to do with addressing).

Andrew

maintainer Reviewed-by on v2 1/1
#2 lore raw
In reply to Sean Anderson
Quoted 13 lines

-----Original Message-----
From: Sean Anderson <[email protected]>
Sent: Tuesday, June 11, 2024 9:11 PM
To: Pandey, Radhey Shyam <[email protected]>; Andrew Lunn <[email protected]>; [email protected]
Cc: Jakub Kicinski <[email protected]>; [email protected]; Russell King <[email protected]>; Simek, Michal <[email protected]>; Paolo Abeni <[email protected]>; Eric Dumazet <[email protected]>; David S . Miller <[email protected]>; linux-arm- [email protected]; Sean Anderson <[email protected]>
Subject: [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err

Quoted 6 lines

This error message can be triggered by userspace. Use NL_SET_ERR_MSG so the message is returned to the user and to avoid polluting the kernel logs. Additionally, change the return value from EFAULT to EBUSY to better reflect the error (which has nothing to do with addressing).

Thanks!

Quoted 32 lines

---

Changes in v2:
- Split off from stats series
- Document return value change

 drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +3 -3
index c29809cd9201..5f98daa5b341 100644
@@ -1945,9 +1945,9 @@ axienet_ethtools_set_coalesce(struct net_device
 *ndev,
 	struct axienet_local *lp = netdev_priv(ndev);
 
 	if (netif_running(ndev)) {
-		netdev_err(ndev,
-			   "Please stop netif before applying
 configuration\n");
-		return -EFAULT;
+		NL_SET_ERR_MSG(extack,
+			       "Please stop netif before applying
 configuration");
+		return -EBUSY;
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +0 -1
 	}
 
 	if (ecoalesce->rx_max_coalesced_frames)
--

2.35.1.1320.gc452695387.dirty

#3 lore raw
In reply to Sean Anderson
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 11 Jun 2024 11:41:16 -0400 you wrote:

This error message can be triggered by userspace. Use NL_SET_ERR_MSG so the message is returned to the user and to avoid polluting the kernel logs. Additionally, change the return value from EFAULT to EBUSY to better reflect the error (which has nothing to do with addressing).

[...]

Here is the summary with links:
- [net-next,v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err

    https://git.kernel.org/netdev/net-next/c/32b06603f879

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html