From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martin Schiller Subject: Re: [PATCH net-next v2 4/6] net/x25: support NETDEV_CHANGE notifier Date: Tue, 17 Nov 2020 13:30:24 +0100 Message-ID: <93e2a7226531ce6832241be1c4296b9d@dev.tdt.de> References: <20201116135522.21791-1-ms@dev.tdt.de> <20201116135522.21791-5-ms@dev.tdt.de> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Xie He Cc: Andrew Hendry , "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML On 2020-11-17 12:41, Xie He wrote: > On Mon, Nov 16, 2020 at 6:00 AM Martin Schiller wrote: >> >> This makes it possible to handle carrier lost and detection. >> In case of carrier lost, we shutdown layer 3 and flush all sessions. >> >> @@ -275,6 +275,19 @@ static int x25_device_event(struct notifier_block >> *this, unsigned long event, >> dev->name); >> x25_link_device_remove(dev); >> break; >> + case NETDEV_CHANGE: >> + pr_debug("X.25: got event NETDEV_CHANGE for >> device: %s\n", >> + dev->name); >> + if (!netif_carrier_ok(dev)) { >> + pr_debug("X.25: Carrier lost -> set >> link state down: %s\n", >> + dev->name); >> + nb = x25_get_neigh(dev); >> + if (nb) { >> + x25_link_terminated(nb); >> + x25_neigh_put(nb); >> + } >> + } >> + break; >> } >> } > > I think L2 will notify L3 if the L2 connection is terminated. Is this > patch necessary? Hmm... well I guess you're right. Admittedly, these patches were made about 7 - 8 years ago and I have to keep thinking about them. But I can't think of any situation where this patch should be necessary at the moment. I will drop this patch from the patch-set.