From: Cristian Dumitrescu Date: Mon, 12 Jun 2017 13:35:38 +0000 (+0100) Subject: ethdev: add traffic management ops get API X-Git-Tag: spdx-start~2521 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=530beded12bf9e59e5c20f6c258040904a84ed4e;p=dpdk.git ethdev: add traffic management ops get API The rte_flow feature breaks the monolithic approach for ethdev by introducing the new rte_flow API to ethdev using a plugin-like approach. Basically, the rte_flow API is still logically part of ethdev: - It extends the ethdev functionality: rte_flow is a new feature/ capability of ethdev; - all its functions work on an Ethernet device: the first parameter of the rte_flow functions is Ethernet device port ID. Also, the rte_flow API is a sort of capability plugin for ethdev: - the rte_flow API functions have their own name space: they are called rte_flow_operationXYZ() as opposed to rte_eth_dev_flow_operationXYZ()); - the rte_flow API functions are placed in separate files in the same librte_ether folder as opposed to rte_ethdev.[hc]. The way it works is by using the existing ethdev API function rte_eth_dev_filter_ctrl() to query the current Ethernet device port ID for the support of the rte_flow capability and return the pointer to the rte_flow operations when supported and NULL otherwise: struct rte_flow_ops *eth_flow_ops; int rte = rte_eth_dev_filter_ctrl(eth_port_id, RTE_ETH_FILTER_GENERIC, RTE_ETH_FILTER_GET, ð_flow_ops); This patch reuses the same approach for ethdev Traffic Management API. Signed-off-by: Cristian Dumitrescu Acked-by: Keith Wiles Acked-by: Jerin Jacob Acked-by: Hemant Agrawal --- diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index fd6baf37a7..f683727852 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -1416,6 +1416,9 @@ typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev, void *arg); /**< @internal Take operations to assigned filter type on an Ethernet device */ +typedef int (*eth_tm_ops_get_t)(struct rte_eth_dev *dev, void *ops); +/**< @internal Get Traffic Management (TM) operations on an Ethernet device */ + typedef int (*eth_get_dcb_info)(struct rte_eth_dev *dev, struct rte_eth_dcb_info *dcb_info); /**< @internal Get dcb information on an Ethernet device */ @@ -1536,6 +1539,9 @@ struct eth_dev_ops { /**< Get extended device statistic values by ID. */ eth_xstats_get_names_by_id_t xstats_get_names_by_id; /**< Get name of extended device statistics by ID. */ + + eth_tm_ops_get_t tm_ops_get; + /**< Get Traffic Management (TM) operations. */ }; /**