public inbox for netdev@vger.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: Wed, 12 Dec 2012 10:54:48 -0800	[thread overview]
Message-ID: <20121212105448.490aca5c@nehalam.linuxnetplumber.net> (raw)
In-Reply-To: <20121212184925.GD3060@minipsycho.orion>

On Wed, 12 Dec 2012 19:49:26 +0100
Jiri Pirko <jiri@resnulli•us> wrote:

> Wed, Dec 12, 2012 at 07:36:32PM CET, shemminger@vyatta•com wrote:
> >On Wed, 12 Dec 2012 19:25:56 +0100
> >Jiri Pirko <jiri@resnulli•us> wrote:
> >
> >> Wed, Dec 12, 2012 at 07:12:08PM CET, shemminger@vyatta•com wrote:
> >> >On Wed, 12 Dec 2012 19:10:17 +0100
> >> >Jiri Pirko <jiri@resnulli•us> wrote:
> >> >
> >> >> ># ip li show dev dummy0
> >> >> >12: dummy0: <NO-CARRIER,BROADCAST,NOARP,UP,LOWER_UP> mtu 1500 qdisc noqueue state DORMANT mode DORMANT   
> >> >> 
> >> >> if you mean this "NO-CARRIER"
> >> >> it has no direct relation with netif_carrier_ok().
> >> >
> >> >It is the same value (IFF_RUNNING) that is visible from user space.
> >> 
> >> static inline bool netif_carrier_ok(const struct net_device *dev)
> >> {
> >> 	        return !test_bit(__LINK_STATE_NOCARRIER, &dev->state);
> >> }
> >> 
> >> So netif_carrier[ok/on/off] are working with on __LINK_STATE_NOCARRIER
> >> bit. Not with IFF_RUNNING flag.
> >
> >What is the code path that you are worried about netif_carrier_ok being set or clear?
> >The interaction here is complex, and right now LINK_STATE_NOCARRIER is purely
> >controlled by the driver, your patch changes that, but before acking I want
> >to make sure why it is required.
> 
> This patchset would provide a possibility to set or clear the carrier
> from userspace. For dummy device it would serve for direct emulation
> of link fail.
> 
> Also for team deriver, that would serve for teamd (userspace part) to
> set the carrier actually on or off (in case of LACP runner for example
> this is required).
> 

You want to able to control the dummy device, so that you can test carrier
management in the team device. Another alternative is to use carrier control
on a virtual device. Vmware can do it, there were patches to do this with KVM/QEMU
not sure if they ever got incorporated.

Since this is a specific feature of the dummy device which is specialized for
testing, maybe it should just be done by adding device specific ioctl rather
than letting it creep in as a general facility.

  reply	other threads:[~2012-12-12 18:56 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 [this message]
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
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=20121212105448.490aca5c@nehalam.linuxnetplumber.net \
    --to=shemminger@vyatta$(echo .)com \
    --cc=bhutchings@solarflare$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=fbl@redhat$(echo .)com \
    --cc=greearb@candelatech$(echo .)com \
    --cc=jiri@resnulli$(echo .)us \
    --cc=mirqus@gmail$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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