[dpdk-dev,V3,2/5] ethdev: add new eth_dev_ops function for mtr ops get

Message ID 1507301136-131382-3-git-send-email-cristian.dumitrescu@intel.com (mailing list archive)
State Superseded, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply patch file failure

Commit Message

Cristian Dumitrescu Oct. 6, 2017, 2:45 p.m. UTC
  Following similar approach as rte_flow and rte_tm for modularity reasons,
the ops for the new rte_mtr API are retrieved through a new eth_dev_ops
function.

Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
---
Changes in v3:
- None

Changes in v2:
-None

Changes in v1 (from RFC [1]):
- Removed ethdev API function to get the MTR ops, as it is not needed
  (input from Thomas)

[1] RFC: http://www.dpdk.org/ml/archives/dev/2017-May/066888.html

 lib/librte_ether/rte_ethdev.h | 6 ++++++
 1 file changed, 6 insertions(+)
  

Comments

Hemant Agrawal Oct. 12, 2017, 10:58 a.m. UTC | #1
On 10/6/2017 8:15 PM, Cristian Dumitrescu wrote:
> Following similar approach as rte_flow and rte_tm for modularity reasons,
> the ops for the new rte_mtr API are retrieved through a new eth_dev_ops
> function.
>
> Signed-off-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> ---
> Changes in v3:
> - None
>
> Changes in v2:
> -None
>
> Changes in v1 (from RFC [1]):
> - Removed ethdev API function to get the MTR ops, as it is not needed
>   (input from Thomas)
>
> [1] RFC: http://www.dpdk.org/ml/archives/dev/2017-May/066888.html
>
>  lib/librte_ether/rte_ethdev.h | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
> index 99cdd54..a5802b0 100644
> --- a/lib/librte_ether/rte_ethdev.h
> +++ b/lib/librte_ether/rte_ethdev.h
> @@ -1424,6 +1424,9 @@ typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
>  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_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
> +/**< @internal Get Trafffic Metering and Policing (MTR) operations */
> +
>  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 */
> @@ -1548,6 +1551,9 @@ struct eth_dev_ops {
>
>  	eth_tm_ops_get_t tm_ops_get;
>  	/**< Get Traffic Management (TM) operations. */
> +
> +	eth_mtr_ops_get_t mtr_ops_get;
> +	/**< Get Traffic Metering and Policing (MTR) operations. */
>  };
>
>  /**
>
Reviewed-by:  Hemant Agrawal <hemant.agrawal@nxp.com>
  

Patch

diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 99cdd54..a5802b0 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1424,6 +1424,9 @@  typedef int (*eth_filter_ctrl_t)(struct rte_eth_dev *dev,
 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_mtr_ops_get_t)(struct rte_eth_dev *dev, void *ops);
+/**< @internal Get Trafffic Metering and Policing (MTR) operations */
+
 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 */
@@ -1548,6 +1551,9 @@  struct eth_dev_ops {
 
 	eth_tm_ops_get_t tm_ops_get;
 	/**< Get Traffic Management (TM) operations. */
+
+	eth_mtr_ops_get_t mtr_ops_get;
+	/**< Get Traffic Metering and Policing (MTR) operations. */
 };
 
 /**