Enable metering and policing support for softnic.
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_thread.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_cli.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_flow.c
+SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += rte_eth_softnic_meter.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += parser.c
SRCS-$(CONFIG_RTE_LIBRTE_PMD_SOFTNIC) += conn.c
'rte_eth_softnic_thread.c',
'rte_eth_softnic_cli.c',
'rte_eth_softnic_flow.c',
+ 'rte_eth_softnic_meter.c',
'parser.c',
'conn.c')
deps += ['pipeline', 'port', 'table', 'sched']
#include <rte_errno.h>
#include <rte_ring.h>
#include <rte_tm_driver.h>
+#include <rte_mtr_driver.h>
#include "rte_eth_softnic.h"
#include "rte_eth_softnic_internals.h"
return 0;
}
+static int
+pmd_mtr_ops_get(struct rte_eth_dev *dev __rte_unused, void *arg)
+{
+ *(const struct rte_mtr_ops **)arg = &pmd_mtr_ops;
+
+ return 0;
+}
+
static const struct eth_dev_ops pmd_ops = {
.dev_configure = pmd_dev_configure,
.dev_start = pmd_dev_start,
.tx_queue_setup = pmd_tx_queue_setup,
.filter_ctrl = pmd_filter_ctrl,
.tm_ops_get = pmd_tm_ops_get,
+ .mtr_ops_get = pmd_mtr_ops_get,
};
static uint16_t
extern const struct rte_flow_ops pmd_flow_ops;
+/**
+ * Meter
+ */
+extern const struct rte_mtr_ops pmd_mtr_ops;
+
/**
* MEMPOOL
*/
--- /dev/null
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2018 Intel Corporation
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <rte_mtr.h>
+#include <rte_mtr_driver.h>
+
+#include "rte_eth_softnic_internals.h"
+
+const struct rte_mtr_ops pmd_mtr_ops = {
+ .capabilities_get = NULL,
+
+ .meter_profile_add = NULL,
+ .meter_profile_delete = NULL,
+
+ .create = NULL,
+ .destroy = NULL,
+ .meter_enable = NULL,
+ .meter_disable = NULL,
+
+ .meter_profile_update = NULL,
+ .meter_dscp_table_update = NULL,
+ .policer_actions_update = NULL,
+ .stats_update = NULL,
+
+ .stats_read = NULL,
+};