Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread David Miller
From: anurad...@cumulusnetworks.com
Date: Tue, 14 Jul 2015 13:43:18 -0700

 User space daemons can detect errors in the network that need to be
 notified to the switch device drivers.
 
 Drivers can react to this error state by doing a phy-down on the
 switch-port which would result in a carrier-off locally and on the directly
 connected switch. Doing that would prevent loops and black-holes in the
 network.

Series applied, thanks.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Scott Feldman
On Wed, Jul 15, 2015 at 8:53 AM, Anuradha Karuppiah
anurad...@cumulusnetworks.com wrote:
 On Tue, Jul 14, 2015 at 10:08 PM, Scott Feldman sfel...@gmail.com wrote:
 On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
 From: Anuradha Karuppiah anurad...@cumulusnetworks.com

 User space daemons can detect errors in the network that need to be
 notified to the switch device drivers.

 Drivers can react to this error state by doing a phy-down on the
 switch-port which would result in a carrier-off locally and on the directly
 connected switch. Doing that would prevent loops and black-holes in the
 network.

 Hi Anuradha,

 Since this is a switch-thingy, can you move this to switchdev port
 attribute rather than adding another ndo op?  I know you started this
 patch set before switchdev port attrs, but I think it's worthwhile
 moving it to switchdev since clearly the use-case is switch device
 drivers.   Let me know if you need help converting over to switchdev
 port attr.

 Also, is the sysfs interface necessary?  The netlink/iproute2
 interface seems sufficient.

 -scott

 Yes, for the current use case (MLAG) it would be better to isolate the
 changes to switchdev. Also if we go with the switchdev option are you
 thinking about dropping the netdev-proto_down bool attribute
 altogether and only keeping that info in the switch drivers that
 support the op?

Yes.

 You are right, the sysfs is not necessary. I can make it RO and just
 use it for displaying or drop it all together. What would you
 recommend?

Drop it if it's not needed/used.

On the iproute2 part, do we expect users to manually toggle this flag
from the cmdline?  Seems kind of weird to walk up to a box and say ip
link set dev DEV protodown on.  Isn't this more intended for external
agents (i.e. MLAG) to toggle?  I guess if there is a netlink attr for
the flag, there should be a user-interface.  But it seems like it'll
be a source of confusion for 99.999% of the users out there that
wonder what this knob does.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Anuradha Karuppiah
On Wed, Jul 15, 2015 at 11:29 AM, Scott Feldman sfel...@gmail.com wrote:
 On Wed, Jul 15, 2015 at 8:53 AM, Anuradha Karuppiah
 anurad...@cumulusnetworks.com wrote:
 On Tue, Jul 14, 2015 at 10:08 PM, Scott Feldman sfel...@gmail.com wrote:
 On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
 From: Anuradha Karuppiah anurad...@cumulusnetworks.com

 User space daemons can detect errors in the network that need to be
 notified to the switch device drivers.

 Drivers can react to this error state by doing a phy-down on the
 switch-port which would result in a carrier-off locally and on the directly
 connected switch. Doing that would prevent loops and black-holes in the
 network.

 Hi Anuradha,

 Since this is a switch-thingy, can you move this to switchdev port
 attribute rather than adding another ndo op?  I know you started this
 patch set before switchdev port attrs, but I think it's worthwhile
 moving it to switchdev since clearly the use-case is switch device
 drivers.   Let me know if you need help converting over to switchdev
 port attr.

 Also, is the sysfs interface necessary?  The netlink/iproute2
 interface seems sufficient.

 -scott

 Yes, for the current use case (MLAG) it would be better to isolate the
 changes to switchdev. Also if we go with the switchdev option are you
 thinking about dropping the netdev-proto_down bool attribute
 altogether and only keeping that info in the switch drivers that
 support the op?

 Yes.

 You are right, the sysfs is not necessary. I can make it RO and just
 use it for displaying or drop it all together. What would you
 recommend?

 Drop it if it's not needed/used.

 On the iproute2 part, do we expect users to manually toggle this flag
 from the cmdline?  Seems kind of weird to walk up to a box and say ip
 link set dev DEV protodown on.  Isn't this more intended for external
 agents (i.e. MLAG) to toggle?  I guess if there is a netlink attr for
 the flag, there should be a user-interface.  But it seems like it'll
 be a source of confusion for 99.999% of the users out there that
 wonder what this knob does.

The MLAG app currently does use the iproute2 interface for toggling
protodown. So I may not be able to drop the iproute2 config option
easily.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Scott Feldman
On Wed, Jul 15, 2015 at 11:36 AM, Anuradha Karuppiah
anurad...@cumulusnetworks.com wrote:
 On Wed, Jul 15, 2015 at 11:29 AM, Scott Feldman sfel...@gmail.com wrote:
 On Wed, Jul 15, 2015 at 8:53 AM, Anuradha Karuppiah
 anurad...@cumulusnetworks.com wrote:
 On Tue, Jul 14, 2015 at 10:08 PM, Scott Feldman sfel...@gmail.com wrote:
 On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
 From: Anuradha Karuppiah anurad...@cumulusnetworks.com

 User space daemons can detect errors in the network that need to be
 notified to the switch device drivers.

 Drivers can react to this error state by doing a phy-down on the
 switch-port which would result in a carrier-off locally and on the 
 directly
 connected switch. Doing that would prevent loops and black-holes in the
 network.

 Hi Anuradha,

 Since this is a switch-thingy, can you move this to switchdev port
 attribute rather than adding another ndo op?  I know you started this
 patch set before switchdev port attrs, but I think it's worthwhile
 moving it to switchdev since clearly the use-case is switch device
 drivers.   Let me know if you need help converting over to switchdev
 port attr.

 Also, is the sysfs interface necessary?  The netlink/iproute2
 interface seems sufficient.

 -scott

 Yes, for the current use case (MLAG) it would be better to isolate the
 changes to switchdev. Also if we go with the switchdev option are you
 thinking about dropping the netdev-proto_down bool attribute
 altogether and only keeping that info in the switch drivers that
 support the op?

 Yes.

 You are right, the sysfs is not necessary. I can make it RO and just
 use it for displaying or drop it all together. What would you
 recommend?

 Drop it if it's not needed/used.

 On the iproute2 part, do we expect users to manually toggle this flag
 from the cmdline?  Seems kind of weird to walk up to a box and say ip
 link set dev DEV protodown on.  Isn't this more intended for external
 agents (i.e. MLAG) to toggle?  I guess if there is a netlink attr for
 the flag, there should be a user-interface.  But it seems like it'll
 be a source of confusion for 99.999% of the users out there that
 wonder what this knob does.

 The MLAG app currently does use the iproute2 interface for toggling
 protodown. So I may not be able to drop the iproute2 config option
 easily.

It can send netlink msg directly as easy as doing exec ip link set
..., I assume.

Forgive me if I've asked this before: where is this MLAG app?
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Anuradha Karuppiah
On Wed, Jul 15, 2015 at 11:46 AM, Scott Feldman sfel...@gmail.com wrote:
 On Wed, Jul 15, 2015 at 11:36 AM, Anuradha Karuppiah
 anurad...@cumulusnetworks.com wrote:
 On Wed, Jul 15, 2015 at 11:29 AM, Scott Feldman sfel...@gmail.com wrote:
 On Wed, Jul 15, 2015 at 8:53 AM, Anuradha Karuppiah
 anurad...@cumulusnetworks.com wrote:
 On Tue, Jul 14, 2015 at 10:08 PM, Scott Feldman sfel...@gmail.com wrote:
 On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
 From: Anuradha Karuppiah anurad...@cumulusnetworks.com

 User space daemons can detect errors in the network that need to be
 notified to the switch device drivers.

 Drivers can react to this error state by doing a phy-down on the
 switch-port which would result in a carrier-off locally and on the 
 directly
 connected switch. Doing that would prevent loops and black-holes in the
 network.

 Hi Anuradha,

 Since this is a switch-thingy, can you move this to switchdev port
 attribute rather than adding another ndo op?  I know you started this
 patch set before switchdev port attrs, but I think it's worthwhile
 moving it to switchdev since clearly the use-case is switch device
 drivers.   Let me know if you need help converting over to switchdev
 port attr.

 Also, is the sysfs interface necessary?  The netlink/iproute2
 interface seems sufficient.

 -scott

 Yes, for the current use case (MLAG) it would be better to isolate the
 changes to switchdev. Also if we go with the switchdev option are you
 thinking about dropping the netdev-proto_down bool attribute
 altogether and only keeping that info in the switch drivers that
 support the op?

 Yes.

 You are right, the sysfs is not necessary. I can make it RO and just
 use it for displaying or drop it all together. What would you
 recommend?

 Drop it if it's not needed/used.

 On the iproute2 part, do we expect users to manually toggle this flag
 from the cmdline?  Seems kind of weird to walk up to a box and say ip
 link set dev DEV protodown on.  Isn't this more intended for external
 agents (i.e. MLAG) to toggle?  I guess if there is a netlink attr for
 the flag, there should be a user-interface.  But it seems like it'll
 be a source of confusion for 99.999% of the users out there that
 wonder what this knob does.

 The MLAG app currently does use the iproute2 interface for toggling
 protodown. So I may not be able to drop the iproute2 config option
 easily.

 It can send netlink msg directly as easy as doing exec ip link set
 ..., I assume.

 Forgive me if I've asked this before: where is this MLAG app?
We are in the process of making the app ready for open-sourcing and
upstreaming this patch set was part of that.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Andy Gospodarek
On Wed, Jul 15, 2015 at 11:29:55AM -0700, Scott Feldman wrote:
[...]
 
 On the iproute2 part, do we expect users to manually toggle this flag
 from the cmdline?  Seems kind of weird to walk up to a box and say ip
 link set dev DEV protodown on.  Isn't this more intended for external
 agents (i.e. MLAG) to toggle?  I guess if there is a netlink attr for
 the flag, there should be a user-interface.  But it seems like it'll
 be a source of confusion for 99.999% of the users out there that
 wonder what this knob does.

I would want to have it in iproute2 the event that I killed an app that
set this flag for me.  This would allow me to clear the bit and use the
interface as I pleased.  I would not want to have to reboot just to use
my device again.

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Scott Feldman
On Wed, Jul 15, 2015 at 9:24 AM, Andy Gospodarek
go...@cumulusnetworks.com wrote:
 On Tue, Jul 14, 2015 at 10:08:35PM -0700, Scott Feldman wrote:
 On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
  From: Anuradha Karuppiah anurad...@cumulusnetworks.com
 
  User space daemons can detect errors in the network that need to be
  notified to the switch device drivers.
 
  Drivers can react to this error state by doing a phy-down on the
  switch-port which would result in a carrier-off locally and on the directly
  connected switch. Doing that would prevent loops and black-holes in the
  network.

 Hi Anuradha,

 Since this is a switch-thingy, can you move this to switchdev port
 attribute rather than adding another ndo op?  I know you started this
 patch set before switchdev port attrs, but I think it's worthwhile
 moving it to switchdev since clearly the use-case is switch device
 drivers.   Let me know if you need help converting over to switchdev
 port attr.

 If it is switchdev-only that would prevent people from using commodity
 hardware (classic servers + NICs) from being able to build something
 similar to what can be done with rocker.

That's not true.  There is nothing preventing a classic NIC driver
from implementing some/all switchdev ops if the device can do
forwarding offload or other switchy-things.

This patchset is about a switch feature (MLAG was the example
use-case), so let's move this under switchdev.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Andy Gospodarek
On Wed, Jul 15, 2015 at 10:34:04AM -0700, Scott Feldman wrote:
 On Wed, Jul 15, 2015 at 9:24 AM, Andy Gospodarek
 go...@cumulusnetworks.com wrote:
  On Tue, Jul 14, 2015 at 10:08:35PM -0700, Scott Feldman wrote:
  On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
   From: Anuradha Karuppiah anurad...@cumulusnetworks.com
  
   User space daemons can detect errors in the network that need to be
   notified to the switch device drivers.
  
   Drivers can react to this error state by doing a phy-down on the
   switch-port which would result in a carrier-off locally and on the 
   directly
   connected switch. Doing that would prevent loops and black-holes in the
   network.
 
  Hi Anuradha,
 
  Since this is a switch-thingy, can you move this to switchdev port
  attribute rather than adding another ndo op?  I know you started this
  patch set before switchdev port attrs, but I think it's worthwhile
  moving it to switchdev since clearly the use-case is switch device
  drivers.   Let me know if you need help converting over to switchdev
  port attr.
 
  If it is switchdev-only that would prevent people from using commodity
  hardware (classic servers + NICs) from being able to build something
  similar to what can be done with rocker.
 
 That's not true.  There is nothing preventing a classic NIC driver
 from implementing some/all switchdev ops if the device can do
 forwarding offload or other switchy-things.

I thought the point of the switchdev ops were to provide
offload-specific capabilities not just switch-specific functions.
Having it in switchdev seems misplaced architecturally and seems
less likely to have it accepted by NIC drivers that desire this
functionality.

 This patchset is about a switch feature (MLAG was the example
 use-case), so let's move this under switchdev.

As you have stated the need for it was evidenced when using a non-LACP
multi-chassis bond as there was no viable way to tell a device connectad
via a static bond that the traffic it received would be dropped.

Generally, the use-case for the proto-down feature is to have a way to
tell a connected device to stop sending traffic towards our device in a
particular scenario.  I'm certain there are times when an endpoint might
also want to take down an interface to get an upstream device to stop
sending traffic without dealing with all the baggage that comes with
taking an inteface admin down.

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread David Miller
From: Andy Gospodarek go...@cumulusnetworks.com
Date: Wed, 15 Jul 2015 12:24:35 -0400

 If it is switchdev-only that would prevent people from using commodity
 hardware (classic servers + NICs) from being able to build something
 similar to what can be done with rocker.

Agreed, this isn't switchdev specific at all.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Anuradha Karuppiah
On Tue, Jul 14, 2015 at 10:08 PM, Scott Feldman sfel...@gmail.com wrote:
 On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
 From: Anuradha Karuppiah anurad...@cumulusnetworks.com

 User space daemons can detect errors in the network that need to be
 notified to the switch device drivers.

 Drivers can react to this error state by doing a phy-down on the
 switch-port which would result in a carrier-off locally and on the directly
 connected switch. Doing that would prevent loops and black-holes in the
 network.

 Hi Anuradha,

 Since this is a switch-thingy, can you move this to switchdev port
 attribute rather than adding another ndo op?  I know you started this
 patch set before switchdev port attrs, but I think it's worthwhile
 moving it to switchdev since clearly the use-case is switch device
 drivers.   Let me know if you need help converting over to switchdev
 port attr.

 Also, is the sysfs interface necessary?  The netlink/iproute2
 interface seems sufficient.

 -scott

Yes, for the current use case (MLAG) it would be better to isolate the
changes to switchdev. Also if we go with the switchdev option are you
thinking about dropping the netdev-proto_down bool attribute
altogether and only keeping that info in the switch drivers that
support the op?

You are right, the sysfs is not necessary. I can make it RO and just
use it for displaying or drop it all together. What would you
recommend?

Anuradha.
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-15 Thread Andy Gospodarek
On Tue, Jul 14, 2015 at 10:08:35PM -0700, Scott Feldman wrote:
 On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
  From: Anuradha Karuppiah anurad...@cumulusnetworks.com
 
  User space daemons can detect errors in the network that need to be
  notified to the switch device drivers.
 
  Drivers can react to this error state by doing a phy-down on the
  switch-port which would result in a carrier-off locally and on the directly
  connected switch. Doing that would prevent loops and black-holes in the
  network.
 
 Hi Anuradha,
 
 Since this is a switch-thingy, can you move this to switchdev port
 attribute rather than adding another ndo op?  I know you started this
 patch set before switchdev port attrs, but I think it's worthwhile
 moving it to switchdev since clearly the use-case is switch device
 drivers.   Let me know if you need help converting over to switchdev
 port attr.

If it is switchdev-only that would prevent people from using commodity
hardware (classic servers + NICs) from being able to build something
similar to what can be done with rocker.

It is a fact that many smaller providers build forwarding devices like
this, so I'd hate to limit functionality to just switchdev-based
devices.

My vote would be to keep this as a base netdev function as proposed.

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-14 Thread anuradhak
From: Anuradha Karuppiah anurad...@cumulusnetworks.com

User space daemons can detect errors in the network that need to be
notified to the switch device drivers.

Drivers can react to this error state by doing a phy-down on the
switch-port which would result in a carrier-off locally and on the directly
connected switch. Doing that would prevent loops and black-holes in the
network.

One such use case is the multi-chassis LAG application -

1. The MLAG application runs on peer switches (say Switch0 and Switch1)
   synchronizing states, forwarding entries etc. between the two
   switches over the peer-link (this is a link directly connecting the
   two switches).
2. An MLAG election process designates one of the switches as a primary
   (for e.g. Switch0 is primary and Switch1 is secondary).
3. The peer link plays a critical role in allowing Switch0-Switch1 to
   function as a single LAG partner to the downstream dual-connected
   servers. When the peer-link between the switches goes down we have a
   split-brain situation. Switch0 and Switch1 are no longer in sync and
   are acting independently. This can result in traffic loops and
   traffic black-holing in the network.
4. To prevent these problems the MLAG application on the secondary
   switch phy-downs the MLAG ports on detecting the peer-link down.
   This will be seen as a carrier down on servers that are
   dual-connected to Switch0 and Switch1.
5. Specifically a dual-connected server will see a carrier-down on the
   port connected to the MLAG secondary, Switch1, and will stop using
   that port for traffic TX. So traffic black holing is prevented.

v6 to v7:
   Removed some unnecessary code in response to review comments.

v5 to v6:
   Replaced proto_flags with a simple proto_down boolean attribute in
   response to Dave's comments.

v4 to v5:
   Changed the ip link display format for protodown to match the set as
   recommended by Stephen. 

v3 to v4:
   I have moved protodown out of IFF_XXX and introduced a separate
   proto_flags field with IF_PROTOF_DOWN bit being used by apps to notify
   switch port errors. This is in response to Stephen's comments that
   adding a new IFF_XXX may break user space.

   I have used rocker as the sample switch driver. And to test this
   functionality I used the qemu-rocker patch that Scott sent out in
   response to the v3 posting (needed to set link up/down when phy is
   enabled/disabled).

v1 to v2:
   Based on Dave's suggestion I have moved out aggregating of error bits
   across applications to a user space framework. This patch now simply
   notifies an aggregated error bit to drivers enabling them to handle
   the error gracefully.


Anuradha Karuppiah (4):
  net core: Add protodown support.
  netlink: changes for setting and clearing protodown via netlink.
  rocker: Handle protodown notifications.
  ip link: proto_down config and display.

Signed-off-by: Anuradha Karuppiah anurad...@cumulusnetworks.com
Signed-off-by: Andy Gospodarek go...@cumulusnetworks.com
Signed-off-by: Roopa Prabhu ro...@cumulusnetworks.com
Signed-off-by: Wilson Kok w...@cumulusnetworks.com

 drivers/net/ethernet/rocker/rocker.c |   19 ++-
 include/linux/netdevice.h|   14 ++
 include/uapi/linux/if_link.h |1 +
 net/core/dev.c   |   20 
 net/core/net-sysfs.c |   14 ++
 net/core/rtnetlink.c |   16 ++--
 6 files changed, 81 insertions(+), 3 deletions(-)

-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH net-next v7 0/4] net: Introduce protodown flag.

2015-07-14 Thread Scott Feldman
On Tue, Jul 14, 2015 at 1:43 PM,  anurad...@cumulusnetworks.com wrote:
 From: Anuradha Karuppiah anurad...@cumulusnetworks.com

 User space daemons can detect errors in the network that need to be
 notified to the switch device drivers.

 Drivers can react to this error state by doing a phy-down on the
 switch-port which would result in a carrier-off locally and on the directly
 connected switch. Doing that would prevent loops and black-holes in the
 network.

Hi Anuradha,

Since this is a switch-thingy, can you move this to switchdev port
attribute rather than adding another ndo op?  I know you started this
patch set before switchdev port attrs, but I think it's worthwhile
moving it to switchdev since clearly the use-case is switch device
drivers.   Let me know if you need help converting over to switchdev
port attr.

Also, is the sysfs interface necessary?  The netlink/iproute2
interface seems sufficient.

-scott
--
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html