linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes
@ 2021-03-18 19:07 Xie He
  2021-03-19  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Xie He @ 2021-03-18 19:07 UTC (permalink / raw)
  To: Martin Schiller, David S. Miller, Jakub Kicinski, linux-x25,
	netdev, linux-kernel
  Cc: Xie He

When a virtual LAPB device's underlying Ethernet device closes, the LAPB
device is also closed.

However, currently the LAPB device is closed after the Ethernet device
closes. It would be better to close it before the Ethernet device closes.
This would allow the LAPB device to transmit a last frame to notify the
other side that it is disconnecting.

Signed-off-by: Xie He <xie.he.0141@gmail.com>
---
 drivers/net/wan/lapbether.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wan/lapbether.c b/drivers/net/wan/lapbether.c
index 8fda0446ff71..45d74285265a 100644
--- a/drivers/net/wan/lapbether.c
+++ b/drivers/net/wan/lapbether.c
@@ -421,8 +421,8 @@ static int lapbeth_device_event(struct notifier_block *this,
 		if (lapbeth_get_x25_dev(dev) == NULL)
 			lapbeth_new_device(dev);
 		break;
-	case NETDEV_DOWN:	
-		/* ethernet device closed -> close LAPB interface */
+	case NETDEV_GOING_DOWN:
+		/* ethernet device closes -> close LAPB interface */
 		lapbeth = lapbeth_get_x25_dev(dev);
 		if (lapbeth) 
 			dev_close(lapbeth->axdev);
-- 
2.27.0


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

* Re: [PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes
  2021-03-18 19:07 [PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes Xie He
@ 2021-03-19  2:20 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-03-19  2:20 UTC (permalink / raw)
  To: Xie He; +Cc: ms, davem, kuba, linux-x25, netdev, linux-kernel

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Thu, 18 Mar 2021 12:07:47 -0700 you wrote:
> When a virtual LAPB device's underlying Ethernet device closes, the LAPB
> device is also closed.
> 
> However, currently the LAPB device is closed after the Ethernet device
> closes. It would be better to close it before the Ethernet device closes.
> This would allow the LAPB device to transmit a last frame to notify the
> other side that it is disconnecting.
> 
> [...]

Here is the summary with links:
  - [net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes
    https://git.kernel.org/netdev/net-next/c/536e1004d273

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] 2+ messages in thread

end of thread, other threads:[~2021-03-19  2:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 19:07 [PATCH net-next] net: lapbether: Close the LAPB device before its underlying Ethernet device closes Xie He
2021-03-19  2:20 ` 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).