Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1231712pxu; Mon, 23 Nov 2020 15:24:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJwABZRWDBOndYZq53bTm1pXJE0e7mEcRSwl+ag829ofg20HVg+CFXxxENAKY6ffVRt2U4WD X-Received: by 2002:a17:906:4482:: with SMTP id y2mr1742287ejo.342.1606173860962; Mon, 23 Nov 2020 15:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606173860; cv=none; d=google.com; s=arc-20160816; b=bJ05R57AEqsp1rp7cg0tRYD0zA4JPThy6Bgfmk16v3XLKBhrHJfniGXEeX09TBnYtV yRYbIqoZ4A8971yXxjtjTv4a+3YnHhKvw9uqjniK3Eiif1Tn1R0bLb6kEPuH7uNmrD2s pzu1uhCTNbwWr78JYtK5CF2Yc3ZQfkEoWEXFsRsH7ARKinYp+1Y398Z/0z4QJdeuJgjL P+PPlw/eEuSuSYoGMK3uBEPD+ieq9/MLybRrYkUzTmtu59XYRVjF+x6POdCkRGhTPp8d FcdE61HrA6iIw/8s7sxiqbqvB9cJd/hryVP5BncpgxNCfJdw28pLQWzQmodDOs55NuhH e/2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=LoHYGvz7BTMS2beu4vcf2km2aXO54uIdqhk7iR0tRXo=; b=ziEqt4V3B06C6zTav9e0GmurYk5WW1Pkx9xOFKK+AWI2KrVES3E+XvvGrb0YQiGdlF 7HqVzxMBSlvgZKQqVJRRDNFpeGPO71lp3HuTGA9MCE5Kg8qQHErT5OLeQiYHeK1h0aT9 nD9DwK7QzF7CkGhTUMCN6+KxLx7Hl/mjRWfGPIw9XqTaqCon1BLqF9EXoJlTbtzjr94Q J4NsMAXRG78vPUJybh7TXty4pEoF7tDB3oeKjWA2+Bl9d/KqODNPAChEd+TKYs1Y3jSe l8m9jH7I5fq9CfqoiUjL9vmZjxJo/JVQjzwsuRuAJQ9f2BHWkjTjLfELcheLEiE4uvoW 4Zpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gjKK+jfD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c11si8512321edw.86.2020.11.23.15.23.58; Mon, 23 Nov 2020 15:24:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gjKK+jfD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726326AbgKWJg4 (ORCPT + 99 others); Mon, 23 Nov 2020 04:36:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbgKWJg4 (ORCPT ); Mon, 23 Nov 2020 04:36:56 -0500 Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CB30C0613CF; Mon, 23 Nov 2020 01:36:56 -0800 (PST) Received: by mail-pf1-x442.google.com with SMTP id b6so3935497pfp.7; Mon, 23 Nov 2020 01:36:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LoHYGvz7BTMS2beu4vcf2km2aXO54uIdqhk7iR0tRXo=; b=gjKK+jfD3wcBFkFwYwGRGqY2VZyOTNowyhcwkXXJVW+/62mwFrHik+SbBG3lqiQm2h nTwwxoOG+i61bAwRePrnuYSO+x30xWNAdkoTX8gvm/byF56yoyHaKJJ6LiRN+Nr6a9jn 8D8WsAfAPl97V9WhsxwPqL/VvYF4sE9noj2fPqngcfHh0hFueP7KPe0cNsBgmci2TDTV HFSEV0d3EoMQ79G6XeUbYxEmYvNRxetdoQTHTY3j4T6YPelQGEXB+xvw+74SvxIbj3Yr otwIUXJxxqQKcnhSYZt3l0h8zp/fe2LEZy1DZtpRRKojZSh1wZF8yuzI85v54vMZh6SR vVCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LoHYGvz7BTMS2beu4vcf2km2aXO54uIdqhk7iR0tRXo=; b=GI1UlJShwhzUlQnCJ4s9R4qxr1sbOnZ3dQBrMG2OCI+a57gVV0k5s3slKPKSxzNtHD Mc+bRcjHcr1VN8syqQwLCZQc8q/iWC3NcMQMG6GGp7rKBKZ9x4OSkWrOxI4VTewI2kP6 0VrNEZN4Z7gLIjsL3R00Isv7vPQUS2SQvNU5+mGokpvSfA2Zw+ATT6WzUxr0mOjzRMcY KHwNo9zdXlstrz0/eSjXvUOpjJ83jFVkOlcysnJwkxeEIk8gz7IUY+kE3jpYs6P+s5z/ Ifl7X+JqHY5TN1fOUYVx25M2ld+BOdV/1W81AyXSgII/6zYlSW30VRAtoqwdRC6qN/XL zyNQ== X-Gm-Message-State: AOAM532UObRyBp8tBz0HQwpsG7GLKiQw4wIxeBdhcFElERr1fFE4K1C6 6obU+J3Tcd5xHpzeRj8ZYb66SAa1rls0j7DQwzI= X-Received: by 2002:a65:560b:: with SMTP id l11mr27840038pgs.63.1606124215873; Mon, 23 Nov 2020 01:36:55 -0800 (PST) MIME-Version: 1.0 References: <20201120054036.15199-1-ms@dev.tdt.de> <20201120054036.15199-3-ms@dev.tdt.de> <87a620b6a55ea8386bffefca0a1f8b77@dev.tdt.de> In-Reply-To: From: Xie He Date: Mon, 23 Nov 2020 01:36:45 -0800 Message-ID: Subject: Re: [PATCH net-next v4 2/5] net/lapb: support netdev events To: Martin Schiller Cc: Andrew Hendry , "David S. Miller" , Jakub Kicinski , Linux X25 , Linux Kernel Network Developers , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 23, 2020 at 1:00 AM Martin Schiller wrote: > > AFAIK the carrier can't be up before the device is up. Therefore, there > will be a NETDEV_CHANGE event after the NETDEV_UP event. > > This is what I can see in my tests (with the HDLC interface). > > Is the behaviour different for e.g. lapbether? 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. 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?