netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.r.fastabend@intel.com>
To: Dan Williams <dcbw@redhat.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>,
	Flavio Leitner <fbl@redhat.com>,
	John Fastabend <john.fastabend@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>,
	netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	bhutchings@solarflare.com, mirqus@gmail.com,
	greearb@candelatech.com
Subject: Re: [patch net-next 0/4] net: allow to change carrier from userspace
Date: Thu, 13 Dec 2012 11:09:03 -0800	[thread overview]
Message-ID: <50CA27CF.7010301@intel.com> (raw)
In-Reply-To: <1355423612.21918.34.camel@dcbw.foobar.com>

On 12/13/2012 10:33 AM, Dan Williams wrote:
> On Thu, 2012-12-13 at 10:20 -0800, Stephen Hemminger wrote:
>> On Thu, 13 Dec 2012 16:17:33 -0200
>> Flavio Leitner <fbl@redhat.com> wrote:
>>
>>> On Thu, 13 Dec 2012 10:09:33 -0800
>>> Stephen Hemminger <shemminger@vyatta.com> wrote:
>>>
>>>> On Thu, 13 Dec 2012 15:54:23 -0200
>>>> Flavio Leitner <fbl@redhat.com> wrote:
>>>>
>>>>> I am saying this because people are used to and there are scripts out
>>>>> there using something like:
>>>>> # ethtool <iface> | grep 'Link'
>>>>> to react an interface failure.
>>>>
>>>> Then the script is broken. It is asking about hardware state.
>>>
>>> I was talking about the team master interface, so it makes sense
>>> to check its 'hardware' state. Just think on 'bond0' interface
>>> with no slaves. It should report Link detected: no.
>>>
>>> See bond_release(), what happens if bond->slave_cnt == 0, for instance.
>>>
>>
>> I was thinking more that ethtool operation for reporting link on
>> the team device should use the proper check rather than just using netif_carrier_ok(),
>> the team ethtool operation for get_link should be check IFF_RUNNING flag
>> in dev->flags which is controlled by operstate transistions.
>
> That's not entirely sufficient, because not everything uses ethtool to
> deterine whether the link/carrier is active.  eg, anything listenting to
> netlink for IFF_RUNNING won't know anything about this.  I may have
> missed previous conversation, but IFF_RUNNING is AFAIK the sole
> mechanism to indicate to userspace that the link is operational and
> ready for general traffic.  Can the team drivers simply not set
> IFF_RUNNING until the interface is actually ready for general traffic?
>
> I'd just caution people to be careful when it comes to carrier/link
> states, as a lot of stuff relies on it, and people keep trying to
> slightly change the meaning of it.  We need it to be consistent across
> net interfaces and driver implementations, not have specific meanings to
> certain drivers that don't apply to others.
>
> If teamd needs to manage the carrier state of the teamX interface,
> perhaps instead of munging the actual carrier state itself, it can flip
> some team-private value that is one component of determining whether
> IFF_RUNNING gets set or not?
>
> Dan

Assuming the operstate documentation is correct IFF_RUNNING should only
be set if the operstate is up or unknown. Quoting the text again,

  32	ifinfomsg::if_flags & IFF_RUNNING:
  33	 Interface is in RFC2863 operational state UP or UNKNOWN. This is for
  34	 backward compatibility, routing daemons, dhcp clients can use this
  35	 flag to determine whether they should use the interface.

So my guess is having a team ethtool get_link handler AND managing the
operstate from teamd would satisfy the requirement. But maybe I missed
something.

.John

  reply	other threads:[~2012-12-13 19:09 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 [this message]
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=50CA27CF.7010301@intel.com \
    --to=john.r.fastabend@intel.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=dcbw@redhat.com \
    --cc=edumazet@google.com \
    --cc=fbl@redhat.com \
    --cc=greearb@candelatech.com \
    --cc=jiri@resnulli.us \
    --cc=john.fastabend@gmail.com \
    --cc=mirqus@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /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).