netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Linux kernel netdev mailing list <netdev@vger.kernel.org>
Subject: confusing comment, explanation of @IFF_RUNNING in if.h
Date: Sun, 26 Aug 2018 04:13:25 -0400 (EDT)	[thread overview]
Message-ID: <alpine.LFD.2.21.1808260410530.31293@localhost.localdomain> (raw)


  more annoying pedantry ... from include/uapi/linux/if.h:

    * @IFF_RUNNING: interface RFC2863 OPER_UP. Volatile.

however, both the code in net/core/dev.c:

/**
 *      netif_oper_up - test if device is operational
 *      @dev: network device
 *
 * Check if carrier is operational
 */
static inline bool netif_oper_up(const struct net_device *dev)
{
        return (dev->operstate == IF_OPER_UP ||
                dev->operstate == IF_OPER_UNKNOWN /* backward compat */);
}

and the explanation in operstates.txt:

  ifinfomsg::if_flags & IFF_RUNNING:
    Interface is in RFC2863 operational state UP or UNKNOWN.

suggests IFF_RUNNING represents *either* of the operational states UP
or UNKNOWN, not just UP as the comment in if.h claims. is this
misleading? or is this a deliberate explanation somehow taking into
account that the UNKNOWN state is for backward compatibility (whatever
that means)?

  i ask since, in my testing, when the interface should have been up,
the attribute file "operstate" for that interface showed "unknown",
and i wondered how worried i should be about that.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                  http://crashcourse.ca/dokuwiki

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

             reply	other threads:[~2018-08-26 11:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-26  8:13 Robert P. J. Day [this message]
2018-08-26 19:20 ` confusing comment, explanation of @IFF_RUNNING in if.h Andrew Lunn
2018-08-26 19:20   ` Robert P. J. Day
2018-08-26 19:28     ` Andrew Lunn
2018-08-26 19:30       ` Robert P. J. Day
2018-08-26 20:51     ` Stephen Hemminger
2018-08-27  6:20       ` Robert P. J. Day
2018-08-27  7:11         ` Oliver Hartkopp
2018-08-27  8:04           ` Robert P. J. Day

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LFD.2.21.1808260410530.31293@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).