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=-8.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 E8C8BC282C2 for ; Thu, 7 Feb 2019 16:14:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B6D252175B for ; Thu, 7 Feb 2019 16:14:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mPY6EXa9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726512AbfBGQOm (ORCPT ); Thu, 7 Feb 2019 11:14:42 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:40898 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbfBGQOm (ORCPT ); Thu, 7 Feb 2019 11:14:42 -0500 Received: by mail-ed1-f65.google.com with SMTP id g22so321409edr.7 for ; Thu, 07 Feb 2019 08:14:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=27hW/Khdz/zlBK5fm2k2u0S3U/igsq6HyuI+bQZb2ag=; b=mPY6EXa9WpUTJQ27ox0w5+2HQV8aFS1fKVYry9F3VDkXF8AkwCnqCsYCviT2Midtj5 znWIG3V8yRcU0FolMT2BiaunZChGGkwEA1tNmqnkhMXbpJtLgg/guWTcBeEUeqrYre5n RlWuvhiOiVj2qurzAIFfUnI68W8pGGj0rxjUDNvTxeDIEc7vr5bb8rsTlBMhNk9ctRGe pTk02RD/DFII9wlBuukgedBXYcAugXs5TxKsPejKuEgfUQun0EHffbq/tYvecnwU22qr xBIaJ7+pn3xOLllbQTQF8BbIz8r6v23j8E0hq0LYg2Bg7EzYTne3bOUNDekmngTn+MoA cVfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=27hW/Khdz/zlBK5fm2k2u0S3U/igsq6HyuI+bQZb2ag=; b=cYS80VfIhep8fPd/Zhh9gQIW9vqlkGRgO81PnqoltpDgc8YelarV4NAxmaZ45py5Kh GVXPLNXP6Dw4O9VoctKKivCr+57AVT4B4+ptC9waffXZsYRd+HCcrUDLs8L5636iKi0p 5kMoAQN/YOsn/8w61UdjNErgDwOd82oraV0yUbPm1Etl2tVSK77dPG4KVUghpUhd3yXL doGeSJ5FB48mBnwa77huY7a9KoFx673VW4mqHMVCwMF38eMFDSzaKB1lc6+H9jgEXSFq Nf7VCtTY+t1RWN1gVDfLqVinZ4OdHtmM5hmjg6vDQmWUrZ7MFvEK8DbkQG+0h1eJhwLx FztQ== X-Gm-Message-State: AHQUAuY59NE5nAVJtdgphotDlvqQFzadsrSG03yc25zEHZq2ln4pXcci 21X+0mF53sZTKzXVrkOnR3LL4GmJ X-Google-Smtp-Source: AHgI3IaqKl7+PxKrGBSNr8Ll6moR2NP9EU4gtUezhlP0ZzMyCD2B1/gurfIU94Ej7g6MMXWXoO2KCA== X-Received: by 2002:a50:93c5:: with SMTP id o63mr13038910eda.20.1549556080111; Thu, 07 Feb 2019 08:14:40 -0800 (PST) Received: from Mindship-05.localdomain (ip5653397a.direct-adsl.nl. [86.83.57.122]) by smtp.gmail.com with ESMTPSA id v27sm4377427ejg.54.2019.02.07.08.14.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 07 Feb 2019 08:14:39 -0800 (PST) Date: Thu, 7 Feb 2019 17:14:32 +0100 From: Jouke Witteveen To: davem@davemloft.net Cc: netdev@vger.kernel.org Subject: [PATCH] Documentation: bring operstate documentation up-to-date Message-ID: <20190207161432.GA6060@Mindship-05.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Netlink has moved from bitmasks to group numbers long ago. Signed-off-by: Jouke Witteveen --- This has been salvaged from my earlier proposal to send uevents on link state changes. Can I get you to reconsider that proposal? A more pervasive version of the same idea was accepted in 2008 [1] but oddly enough never applied [2]. In the world of today, sending uevents would play very nicely with udev. [1] http://patchwork.ozlabs.org/patch/10134/ [2] https://www.spinics.net/lists/netdev/thrd522.html#81497 Documentation/networking/operstates.txt | 14 ++++++++------ net/sched/sch_generic.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt index 355c6d8ef8ad..b203d1334822 100644 --- a/Documentation/networking/operstates.txt +++ b/Documentation/networking/operstates.txt @@ -22,8 +22,9 @@ and changeable from userspace under certain rules. 2. Querying from userspace Both admin and operational state can be queried via the netlink -operation RTM_GETLINK. It is also possible to subscribe to RTMGRP_LINK -to be notified of updates. This is important for setting from userspace. +operation RTM_GETLINK. It is also possible to subscribe to RTNLGRP_LINK +to be notified of updates while the interface is admin up. This is +important for setting from userspace. These values contain interface state: @@ -101,8 +102,9 @@ because some driver controlled protocol establishment has to complete. Corresponding functions are netif_dormant_on() to set the flag, netif_dormant_off() to clear it and netif_dormant() to query. -On device allocation, networking core sets the flags equivalent to -netif_carrier_ok() and !netif_dormant(). +On device allocation, both flags __LINK_STATE_NOCARRIER and +__LINK_STATE_DORMANT are cleared, so the effective state is equivalent +to netif_carrier_ok() and !netif_dormant(). Whenever the driver CHANGES one of these flags, a workqueue event is @@ -133,11 +135,11 @@ netif_carrier_ok() && !netif_dormant() is set by the driver. Afterwards, the userspace application can set IFLA_OPERSTATE to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set netif_carrier_off() or netif_dormant_on(). Changes made by userspace -are multicasted on the netlink group RTMGRP_LINK. +are multicasted on the netlink group RTNLGRP_LINK. So basically a 802.1X supplicant interacts with the kernel like this: --subscribe to RTMGRP_LINK +-subscribe to RTNLGRP_LINK -set IFLA_LINKMODE to 1 via RTM_SETLINK -query RTM_GETLINK once to get initial state -if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 66ba2ce2320f..968a85fe4d4a 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c @@ -500,7 +500,7 @@ static void dev_watchdog_down(struct net_device *dev) * netif_carrier_on - set carrier * @dev: network device * - * Device has detected that carrier. + * Device has detected acquisition of carrier. */ void netif_carrier_on(struct net_device *dev) { -- 2.20.1