From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vps0.lunn.ch ([185.16.172.187]:41065 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751894AbeCXO5H (ORCPT ); Sat, 24 Mar 2018 10:57:07 -0400 Date: Sat, 24 Mar 2018 15:57:03 +0100 From: Andrew Lunn To: Saeed Mahameed Cc: "David S. Miller" , netdev@vger.kernel.org, Inbar Karmy , Michal Kubecek Subject: Re: [net-next 02/15] ethtool: Add support for configuring PFC stall prevention in ethtool Message-ID: <20180324145703.GC31941@lunn.ch> References: <20180323223925.21678-1-saeedm@mellanox.com> <20180323223925.21678-3-saeedm@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180323223925.21678-3-saeedm@mellanox.com> Sender: netdev-owner@vger.kernel.org List-ID: On Fri, Mar 23, 2018 at 03:39:12PM -0700, Saeed Mahameed wrote: > From: Inbar Karmy > > In the event where the device unexpectedly becomes unresponsive > for a long period of time, flow control mechanism may propagate > pause frames which will cause congestion spreading to the entire > network. > To prevent this scenario, when the device is stalled for a period > longer than a pre-configured timeout, flow control mechanisms are > automatically disabled. > > This patch adds support for the ETHTOOL_PFC_STALL_PREVENTION > as a tunable. > This API provides support for configuring flow control storm prevention > timeout (msec). > > Signed-off-by: Inbar Karmy > Cc: Michal Kubecek > Cc: Andrew Lunn > Signed-off-by: Saeed Mahameed > --- > include/uapi/linux/ethtool.h | 4 ++++ > net/core/ethtool.c | 6 ++++++ > 2 files changed, 10 insertions(+) > > diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h > index 20da156aaf64..9dc63a14a747 100644 > --- a/include/uapi/linux/ethtool.h > +++ b/include/uapi/linux/ethtool.h > @@ -217,10 +217,14 @@ struct ethtool_value { > __u32 data; > }; > > +#define PFC_STORM_PREVENTION_AUTO 0xffff > +#define PFC_STORM_PREVENTION_DISABLE 0 > + > enum tunable_id { > ETHTOOL_ID_UNSPEC, > ETHTOOL_RX_COPYBREAK, > ETHTOOL_TX_COPYBREAK, > + ETHTOOL_PFC_PREVENTION_TOUT, Hi Inbar Please could you add a comment here about the units. Ideally we want this file to be self documenting. Andrew