All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Jiri Pirko <jiri@resnulli.us>
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	bhutchings@solarflare.com, mirqus@gmail.com,
	greearb@candelatech.com, fbl@redhat.com
Subject: Re: [patch net-next 0/4] net: allow to change carrier from userspace
Date: Mon, 17 Dec 2012 22:49:57 -0800	[thread overview]
Message-ID: <20121217224957.70775f99@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20121216105451.GA1546@minipsycho.orion>

On Sun, 16 Dec 2012 11:54:51 +0100
Jiri Pirko <jiri@resnulli.us> wrote:

> 
> I see that the patchset is in state "Rejected" in patchwork.
> Stephen convinced me for a moment that the problem can be handled by operstate.
> As it turned out (in last 3-4 emails in thread) operstate use would not
> be an option.
> 
> So how should I proceed? Should I repost the patchset? Anyone has any other
> comments?
> 
> thanks.

Don't take my comments so far as negative. Devices to need to be more controllable
from userspace. But I have concerns about introducing a new way to change state causing
more races.  For example, changing carrier state should cause netlink events to fire and
these should post to routing daemons etc. Also, what happens if some confused developer
mixes operstate and direct carrier control.

The root cause of all this confusion is that their are three ways of expressing
the same state, and they are controlled through different paths:
  a. Old BSD style flag bit IFF_RUNNING
  b. LINK_STATE bit in kernel (netif_carrier_ok)
  c. RFC2863 operational state

The operstate stuff is the most complete, but is the weakest in implementation:
  a. kernel drivers check netif_carrier_ok when they should be using netif_dormant
     (bridge is one example). But what will break if this changes?
  b. lower device state is not tracked correctly by tunnels and a few other layered devices
  c. dormant from kernel space was never used by much.

The good news is that the old BSD style IFF_RUNNING bit is the most commonly
used bit by applications and it works correctly in either carrier or operstate mode.

  reply	other threads:[~2012-12-18  6:51 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-12 10:58 [patch net-next 0/4] net: allow to change carrier from userspace Jiri Pirko
2012-12-12 10:58 ` [patch net-next 1/4] net: add change_carrier netdev op Jiri Pirko
2012-12-12 10:58 ` [patch net-next 2/4] net: allow to change carrier via sysfs Jiri Pirko
2012-12-12 10:58 ` [patch net-next 3/4] rtnl: expose carrier value with possibility to set it Jiri Pirko
2012-12-12 10:58 ` [patch net-next 4/4] dummy: implement carrier change Jiri Pirko
2012-12-12 16:15 ` [patch net-next 0/4] net: allow to change carrier from userspace Stephen Hemminger
2012-12-12 17:05   ` Jiri Pirko
2012-12-12 17:27     ` Stephen Hemminger
2012-12-12 18:10       ` Jiri Pirko
2012-12-12 18:12         ` Stephen Hemminger
2012-12-12 18:25           ` Jiri Pirko
2012-12-12 18:36             ` Stephen Hemminger
2012-12-12 18:49               ` Jiri Pirko
2012-12-12 18:54                 ` Stephen Hemminger
2012-12-12 19:06                   ` Jiri Pirko
2012-12-12 19:34                     ` Stephen Hemminger
2012-12-13 16:17                       ` Jiri Pirko
2012-12-13 17:15                         ` John Fastabend
2012-12-13 17:54                           ` Flavio Leitner
2012-12-13 18:09                             ` Stephen Hemminger
2012-12-13 18:17                               ` Flavio Leitner
2012-12-13 18:20                                 ` Stephen Hemminger
2012-12-13 18:33                                   ` Dan Williams
2012-12-13 19:09                                     ` John Fastabend
2012-12-13 21:32                                       ` Jiri Pirko
2012-12-14 14:41                                   ` Jiri Pirko
2012-12-14 16:12                                     ` Stephen Hemminger
2012-12-14 16:35                                       ` Jiri Pirko
2012-12-14 16:59                                         ` Stephen Hemminger
2012-12-14 17:13                                           ` Jiri Pirko
2012-12-14 17:23                                             ` Stephen Hemminger
2012-12-14 17:35                                               ` Jiri Pirko
2012-12-16 10:54 ` Jiri Pirko
2012-12-18  6:49   ` Stephen Hemminger [this message]
2012-12-18  9:31     ` Jiri Pirko

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=20121217224957.70775f99@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fbl@redhat.com \
    --cc=greearb@candelatech.com \
    --cc=jiri@resnulli.us \
    --cc=mirqus@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.