summaryrefslogtreecommitdiffstats
path: root/net/core/ethtool.c
diff options
context:
space:
mode:
authorInbar Karmy <inbark@mellanox.com>2017-11-20 16:14:30 +0200
committerSaeed Mahameed <saeedm@mellanox.com>2018-03-26 13:46:46 -0700
commite1577c1c881b09e9f15a743a4a1907815b74d0f7 (patch)
tree611ccfe349918ef69ea4603ffc48eeb1c9aee1ee /net/core/ethtool.c
parent2fcb12df7d2fa5a004fc3e7f589e58a08f7ed8c9 (diff)
downloadop-kernel-dev-e1577c1c881b09e9f15a743a4a1907815b74d0f7.zip
op-kernel-dev-e1577c1c881b09e9f15a743a4a1907815b74d0f7.tar.gz
ethtool: Add support for configuring PFC stall prevention in ethtool
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 <inbark@mellanox.com> Cc: Michal Kubecek <mkubecek@suse.cz> Cc: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Diffstat (limited to 'net/core/ethtool.c')
-rw-r--r--net/core/ethtool.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 157cd9e..bb6e498 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -121,6 +121,7 @@ tunable_strings[__ETHTOOL_TUNABLE_COUNT][ETH_GSTRING_LEN] = {
[ETHTOOL_ID_UNSPEC] = "Unspec",
[ETHTOOL_RX_COPYBREAK] = "rx-copybreak",
[ETHTOOL_TX_COPYBREAK] = "tx-copybreak",
+ [ETHTOOL_PFC_PREVENTION_TOUT] = "pfc-prevention-tout",
};
static const char
@@ -2311,6 +2312,11 @@ static int ethtool_tunable_valid(const struct ethtool_tunable *tuna)
tuna->type_id != ETHTOOL_TUNABLE_U32)
return -EINVAL;
break;
+ case ETHTOOL_PFC_PREVENTION_TOUT:
+ if (tuna->len != sizeof(u16) ||
+ tuna->type_id != ETHTOOL_TUNABLE_U16)
+ return -EINVAL;
+ break;
default:
return -EINVAL;
}
OpenPOWER on IntegriCloud