[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1584458246-29370-3-git-send-email-vasundhara-v.volam@broadcom.com>
Date: Tue, 17 Mar 2020 20:47:24 +0530
From: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, Pavan Chebbi <pavan.chebbi@...adcom.com>,
Jiri Pirko <jiri@...lanox.com>,
Vasundhara Volam <vasundhara-v.volam@...adcom.com>,
Michael Chan <michael.chan@...adcom.com>
Subject: [PATCH net-next 09/11] devlink: Add new enable_ecn generic device param
From: Pavan Chebbi <pavan.chebbi@...adcom.com>
Add new device parameter to enable/disable handling of Explicit
Congestion Notification(ECN) in the device.
This patch also addresses comments from Jiri Pirko, to update the
devlink-info.rst documentation.
Cc: Jiri Pirko <jiri@...lanox.com>
Signed-off-by: Pavan Chebbi <pavan.chebbi@...adcom.com>
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@...adcom.com>
Signed-off-by: Michael Chan <michael.chan@...adcom.com>
---
Documentation/networking/devlink/devlink-params.rst | 5 +++++
include/net/devlink.h | 4 ++++
net/core/devlink.c | 5 +++++
3 files changed, 14 insertions(+)
diff --git a/Documentation/networking/devlink/devlink-params.rst b/Documentation/networking/devlink/devlink-params.rst
index da2f85c..0e6c965 100644
--- a/Documentation/networking/devlink/devlink-params.rst
+++ b/Documentation/networking/devlink/devlink-params.rst
@@ -106,3 +106,8 @@ own name.
* - ``region_snapshot_enable``
- Boolean
- Enable capture of ``devlink-region`` snapshots.
+ * - ``enable_ecn``
+ - Boolean
+ - Enable handling of Explicit Congestion Notification(ECN) in the device.
+ When enabled hardware may set the code point to Congestion
+ Encountered(CE) before dropping the packet.
diff --git a/include/net/devlink.h b/include/net/devlink.h
index e130d24..825a8f9 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -404,6 +404,7 @@ enum devlink_param_generic_id {
DEVLINK_PARAM_GENERIC_ID_FW_LOAD_POLICY,
DEVLINK_PARAM_GENERIC_ID_RESET_DEV_ON_DRV_PROBE,
DEVLINK_PARAM_GENERIC_ID_ENABLE_ROCE,
+ DEVLINK_PARAM_GENERIC_ID_ENABLE_ECN,
/* add new param generic ids above here*/
__DEVLINK_PARAM_GENERIC_ID_MAX,
@@ -441,6 +442,9 @@ enum devlink_param_generic_id {
#define DEVLINK_PARAM_GENERIC_ENABLE_ROCE_NAME "enable_roce"
#define DEVLINK_PARAM_GENERIC_ENABLE_ROCE_TYPE DEVLINK_PARAM_TYPE_BOOL
+#define DEVLINK_PARAM_GENERIC_ENABLE_ECN_NAME "enable_ecn"
+#define DEVLINK_PARAM_GENERIC_ENABLE_ECN_TYPE DEVLINK_PARAM_TYPE_BOOL
+
#define DEVLINK_PARAM_GENERIC(_id, _cmodes, _get, _set, _validate) \
{ \
.id = DEVLINK_PARAM_GENERIC_ID_##_id, \
diff --git a/net/core/devlink.c b/net/core/devlink.c
index f51bebc..116d887 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -3012,6 +3012,11 @@ static int devlink_nl_cmd_flash_update(struct sk_buff *skb,
.name = DEVLINK_PARAM_GENERIC_ENABLE_ROCE_NAME,
.type = DEVLINK_PARAM_GENERIC_ENABLE_ROCE_TYPE,
},
+ {
+ .id = DEVLINK_PARAM_GENERIC_ID_ENABLE_ECN,
+ .name = DEVLINK_PARAM_GENERIC_ENABLE_ECN_NAME,
+ .type = DEVLINK_PARAM_GENERIC_ENABLE_ECN_TYPE,
+ },
};
static int devlink_param_generic_verify(const struct devlink_param *param)
--
1.8.3.1
Powered by blists - more mailing lists