From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62406C63798 for ; Mon, 23 Nov 2020 10:38:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1232F2076E for ; Mon, 23 Nov 2020 10:38:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728681AbgKWKin (ORCPT ); Mon, 23 Nov 2020 05:38:43 -0500 Received: from mxout70.expurgate.net ([194.37.255.70]:52431 "EHLO mxout70.expurgate.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727444AbgKWKim (ORCPT ); Mon, 23 Nov 2020 05:38:42 -0500 Received: from [127.0.0.1] (helo=localhost) by relay.expurgate.net with smtp (Exim 4.90) (envelope-from ) id 1kh9Ey-0006Lm-RV; Mon, 23 Nov 2020 11:38:36 +0100 Received: from [195.243.126.94] (helo=securemail.tdt.de) by relay.expurgate.net with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90) (envelope-from ) id 1kh9Ex-0007AY-QM; Mon, 23 Nov 2020 11:38:35 +0100 Received: from securemail.tdt.de (localhost [127.0.0.1]) by securemail.tdt.de (Postfix) with ESMTP id 60F53240041; Mon, 23 Nov 2020 11:38:35 +0100 (CET) Received: from mail.dev.tdt.de (unknown [10.2.4.42]) by securemail.tdt.de (Postfix) with ESMTP id D7AE8240040; Mon, 23 Nov 2020 11:38:34 +0100 (CET) Received: from mail.dev.tdt.de (localhost [IPv6:::1]) by mail.dev.tdt.de (Postfix) with ESMTP id 7EC19203C7; Mon, 23 Nov 2020 11:38:34 +0100 (CET) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 23 Nov 2020 11:38:34 +0100 From: Martin Schiller To: Xie He Cc: Andrew Hendry , "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML Subject: Re: [PATCH net-next v4 2/5] net/lapb: support netdev events Organization: TDT AG In-Reply-To: References: <20201120054036.15199-1-ms@dev.tdt.de> <20201120054036.15199-3-ms@dev.tdt.de> <87a620b6a55ea8386bffefca0a1f8b77@dev.tdt.de> Message-ID: <16b7e74e6e221f43420da7836659d7df@dev.tdt.de> X-Sender: ms@dev.tdt.de User-Agent: Roundcube Webmail/1.3.15 X-purgate: clean X-purgate-ID: 151534::1606127916-000074F7-5C8CC61A/0/0 X-purgate-type: clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-11-23 11:08, Xie He wrote: > On Mon, Nov 23, 2020 at 1:36 AM Xie He wrote: >> >> Some drivers don't support carrier status and will never change it. >> Their carrier status will always be UP. There will not be a >> NETDEV_CHANGE event. Well, one could argue that we would have to repair these drivers, but I don't think that will get us anywhere. From this point of view it will be the best to handle the NETDEV_UP in the lapb event handler and establish the link analog to the NETDEV_CHANGE event if the carrier is UP. >> >> lapbether doesn't change carrier status. I also have my own virtual >> HDLC WAN driver (for testing) which also doesn't change carrier >> status. >> >> I just tested with lapbether. When I bring up the interface, there >> will only be NETDEV_PRE_UP and then NETDEV_UP. There will not be >> NETDEV_CHANGE. The carrier status is alway UP. >> >> I haven't tested whether a device can receive NETDEV_CHANGE when it is >> down. It's possible for a device driver to call netif_carrier_on when >> the interface is down. Do you know what will happen if a device driver >> calls netif_carrier_on when the interface is down? > > I just did a test on lapbether and saw there would be no NETDEV_CHANGE > event when the netif is down, even if netif_carrier_on/off is called. > So we can rest assured of this part.