@@ -122,6 +122,11 @@ enum devlink_command {
DEVLINK_CMD_TRAP_POLICER_NEW,
DEVLINK_CMD_TRAP_POLICER_DEL,
+ DEVLINK_CMD_METRIC_GET, /* can dump */
+ DEVLINK_CMD_METRIC_SET,
+ DEVLINK_CMD_METRIC_NEW,
+ DEVLINK_CMD_METRIC_DEL,
+
/* add new commands above here */
__DEVLINK_CMD_MAX,
DEVLINK_CMD_MAX = __DEVLINK_CMD_MAX - 1
@@ -272,6 +277,14 @@ enum {
DEVLINK_ATTR_TRAP_METADATA_TYPE_FA_COOKIE,
};
+/**
+ * enum devlink_metric_type - Metric type.
+ * @DEVLINK_METRIC_TYPE_COUNTER: Counter. Monotonically increasing.
+ */
+enum devlink_metric_type {
+ DEVLINK_METRIC_TYPE_COUNTER,
+};
+
enum devlink_attr {
/* don't change the order or add anything between, this is ABI! */
DEVLINK_ATTR_UNSPEC,
@@ -458,6 +471,12 @@ enum devlink_attr {
DEVLINK_ATTR_PORT_LANES, /* u32 */
DEVLINK_ATTR_PORT_SPLITTABLE, /* u8 */
+ DEVLINK_ATTR_METRIC_NAME, /* string */
+ /* enum devlink_metric_type */
+ DEVLINK_ATTR_METRIC_TYPE, /* u8 */
+ DEVLINK_ATTR_METRIC_COUNTER_VALUE, /* u64 */
+ DEVLINK_ATTR_METRIC_GROUP, /* u32 */
+
/* add new attributes above here, update the policy in devlink.c */
__DEVLINK_ATTR_MAX,