netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err
@ 2024-06-11 15:41 Sean Anderson
  2024-06-11 15:55 ` Andrew Lunn
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sean Anderson @ 2024-06-11 15:41 UTC (permalink / raw)
  To: Radhey Shyam Pandey, Andrew Lunn, netdev
  Cc: Jakub Kicinski, linux-kernel, Russell King, Michal Simek,
	Paolo Abeni, Eric Dumazet, David S . Miller, linux-arm-kernel,
	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).

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
---

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

diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index c29809cd9201..5f98daa5b341 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -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)
-- 
2.35.1.1320.gc452695387.dirty


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err
  2024-06-11 15:41 [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err Sean Anderson
@ 2024-06-11 15:55 ` Andrew Lunn
  2024-06-11 19:05 ` Pandey, Radhey Shyam
  2024-06-12 23:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2024-06-11 15:55 UTC (permalink / raw)
  To: Sean Anderson
  Cc: Radhey Shyam Pandey, netdev, Jakub Kicinski, linux-kernel,
	Russell King, Michal Simek, Paolo Abeni, Eric Dumazet,
	David S . Miller, linux-arm-kernel

On Tue, Jun 11, 2024 at 11:41:16AM -0400, Sean Anderson 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).
> 
> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err
  2024-06-11 15:41 [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err Sean Anderson
  2024-06-11 15:55 ` Andrew Lunn
@ 2024-06-11 19:05 ` Pandey, Radhey Shyam
  2024-06-12 23:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: Pandey, Radhey Shyam @ 2024-06-11 19:05 UTC (permalink / raw)
  To: Sean Anderson, Andrew Lunn, netdev@vger.kernel.org
  Cc: Jakub Kicinski, linux-kernel@vger.kernel.org, Russell King,
	Simek, Michal, Paolo Abeni, Eric Dumazet, David S . Miller,
	linux-arm-kernel@lists.infradead.org

> -----Original Message-----
> From: Sean Anderson <sean.anderson@linux.dev>
> Sent: Tuesday, June 11, 2024 9:11 PM
> To: Pandey, Radhey Shyam <radhey.shyam.pandey@amd.com>; Andrew
> Lunn <andrew@lunn.ch>; netdev@vger.kernel.org
> Cc: Jakub Kicinski <kuba@kernel.org>; linux-kernel@vger.kernel.org; Russell
> King <linux@armlinux.org.uk>; Simek, Michal <michal.simek@amd.com>;
> Paolo Abeni <pabeni@redhat.com>; Eric Dumazet <edumazet@google.com>;
> David S . Miller <davem@davemloft.net>; linux-arm-
> kernel@lists.infradead.org; Sean Anderson <sean.anderson@linux.dev>
> Subject: [PATCH net-next v2] 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).
> 
> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>

Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Thanks!
> ---
> 
> 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(-)
> 
> diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> index c29809cd9201..5f98daa5b341 100644
> --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
> @@ -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)
> --
> 2.35.1.1320.gc452695387.dirty


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err
  2024-06-11 15:41 [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err Sean Anderson
  2024-06-11 15:55 ` Andrew Lunn
  2024-06-11 19:05 ` Pandey, Radhey Shyam
@ 2024-06-12 23:10 ` patchwork-bot+netdevbpf
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-06-12 23:10 UTC (permalink / raw)
  To: Sean Anderson
  Cc: radhey.shyam.pandey, andrew, netdev, kuba, linux-kernel, linux,
	michal.simek, pabeni, edumazet, davem, linux-arm-kernel

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

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).
> 
> Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-06-12 23:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-11 15:41 [PATCH net-next v2] net: xilinx: axienet: Use NL_SET_ERR_MSG instead of netdev_err Sean Anderson
2024-06-11 15:55 ` Andrew Lunn
2024-06-11 19:05 ` Pandey, Radhey Shyam
2024-06-12 23:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).