LCOV - code coverage report
Current view: top level - lib/ethdev - rte_tm.c (source / functions) Hit Total Coverage
Test: Code coverage Lines: 0 171 0.0 %
Date: 2025-05-01 17:49:45 Functions: 0 32 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 138 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* SPDX-License-Identifier: BSD-3-Clause
       2                 :            :  * Copyright(c) 2017 Intel Corporation
       3                 :            :  */
       4                 :            : 
       5                 :            : #include <stdint.h>
       6                 :            : 
       7                 :            : #include <eal_export.h>
       8                 :            : #include <rte_errno.h>
       9                 :            : #include "ethdev_trace.h"
      10                 :            : #include "rte_ethdev.h"
      11                 :            : #include "rte_tm_driver.h"
      12                 :            : #include "rte_tm.h"
      13                 :            : 
      14                 :            : /* Get generic traffic manager operations structure from a port. */
      15                 :            : const struct rte_tm_ops *
      16                 :          0 : rte_tm_ops_get(uint16_t port_id, struct rte_tm_error *error)
      17                 :            : {
      18                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
      19                 :            :         const struct rte_tm_ops *ops;
      20                 :            : 
      21         [ #  # ]:          0 :         if (!rte_eth_dev_is_valid_port(port_id)) {
      22                 :          0 :                 rte_tm_error_set(error,
      23                 :            :                         ENODEV,
      24                 :            :                         RTE_TM_ERROR_TYPE_UNSPECIFIED,
      25                 :            :                         NULL,
      26                 :            :                         rte_strerror(ENODEV));
      27                 :          0 :                 return NULL;
      28                 :            :         }
      29                 :            : 
      30   [ #  #  #  # ]:          0 :         if ((dev->dev_ops->tm_ops_get == NULL) ||
      31                 :          0 :                 (dev->dev_ops->tm_ops_get(dev, &ops) != 0) ||
      32         [ #  # ]:          0 :                 (ops == NULL)) {
      33                 :          0 :                 rte_tm_error_set(error,
      34                 :            :                         ENOSYS,
      35                 :            :                         RTE_TM_ERROR_TYPE_UNSPECIFIED,
      36                 :            :                         NULL,
      37                 :            :                         rte_strerror(ENOSYS));
      38                 :          0 :                 return NULL;
      39                 :            :         }
      40                 :            : 
      41                 :            :         return ops;
      42                 :            : }
      43                 :            : 
      44                 :            : #define RTE_TM_FUNC(port_id, func)                      \
      45                 :            : __extension__ ({                                        \
      46                 :            :         const struct rte_tm_ops *ops =                  \
      47                 :            :                 rte_tm_ops_get(port_id, error);         \
      48                 :            :         if (ops == NULL)                                \
      49                 :            :                 return -rte_errno;                      \
      50                 :            :                                                         \
      51                 :            :         if (ops->func == NULL)                               \
      52                 :            :                 return -rte_tm_error_set(error,         \
      53                 :            :                         ENOSYS,                         \
      54                 :            :                         RTE_TM_ERROR_TYPE_UNSPECIFIED,  \
      55                 :            :                         NULL,                           \
      56                 :            :                         rte_strerror(ENOSYS));          \
      57                 :            :                                                         \
      58                 :            :         ops->func;                                   \
      59                 :            : })
      60                 :            : 
      61                 :            : /* Get number of leaf nodes */
      62                 :            : RTE_EXPORT_SYMBOL(rte_tm_get_number_of_leaf_nodes)
      63                 :            : int
      64                 :          0 : rte_tm_get_number_of_leaf_nodes(uint16_t port_id,
      65                 :            :         uint32_t *n_leaf_nodes,
      66                 :            :         struct rte_tm_error *error)
      67                 :            : {
      68                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
      69                 :            :         const struct rte_tm_ops *ops =
      70                 :          0 :                 rte_tm_ops_get(port_id, error);
      71                 :            : 
      72         [ #  # ]:          0 :         if (ops == NULL)
      73                 :          0 :                 return -rte_errno;
      74                 :            : 
      75         [ #  # ]:          0 :         if (n_leaf_nodes == NULL) {
      76                 :          0 :                 rte_tm_error_set(error,
      77                 :            :                         EINVAL,
      78                 :            :                         RTE_TM_ERROR_TYPE_UNSPECIFIED,
      79                 :            :                         NULL,
      80                 :            :                         rte_strerror(EINVAL));
      81                 :          0 :                 return -rte_errno;
      82                 :            :         }
      83                 :            : 
      84         [ #  # ]:          0 :         *n_leaf_nodes = dev->data->nb_tx_queues;
      85                 :            : 
      86                 :          0 :         rte_tm_trace_get_number_of_leaf_nodes(port_id, *n_leaf_nodes);
      87                 :            : 
      88                 :          0 :         return 0;
      89                 :            : }
      90                 :            : 
      91                 :            : /* Check node type (leaf or non-leaf) */
      92                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_type_get)
      93                 :            : int
      94                 :          0 : rte_tm_node_type_get(uint16_t port_id,
      95                 :            :         uint32_t node_id,
      96                 :            :         int *is_leaf,
      97                 :            :         struct rte_tm_error *error)
      98                 :            : {
      99                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     100                 :            :         int ret;
     101   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_type_get)(dev,
     102                 :            :                 node_id, is_leaf, error);
     103                 :            : 
     104         [ #  # ]:          0 :         rte_tm_trace_node_type_get(port_id, node_id, *is_leaf, ret);
     105                 :            : 
     106                 :          0 :         return ret;
     107                 :            : }
     108                 :            : 
     109                 :            : /* Get capabilities */
     110                 :            : RTE_EXPORT_SYMBOL(rte_tm_capabilities_get)
     111                 :          0 : int rte_tm_capabilities_get(uint16_t port_id,
     112                 :            :         struct rte_tm_capabilities *cap,
     113                 :            :         struct rte_tm_error *error)
     114                 :            : {
     115                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     116                 :            :         int ret;
     117   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, capabilities_get)(dev,
     118                 :            :                 cap, error);
     119                 :            : 
     120                 :          0 :         rte_tm_trace_capabilities_get(port_id, cap, ret);
     121                 :            : 
     122                 :          0 :         return ret;
     123                 :            : }
     124                 :            : 
     125                 :            : /* Get level capabilities */
     126                 :            : RTE_EXPORT_SYMBOL(rte_tm_level_capabilities_get)
     127                 :          0 : int rte_tm_level_capabilities_get(uint16_t port_id,
     128                 :            :         uint32_t level_id,
     129                 :            :         struct rte_tm_level_capabilities *cap,
     130                 :            :         struct rte_tm_error *error)
     131                 :            : {
     132                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     133                 :            :         int ret;
     134   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, level_capabilities_get)(dev,
     135                 :            :                 level_id, cap, error);
     136                 :            : 
     137                 :          0 :         rte_tm_trace_level_capabilities_get(port_id, level_id, cap, ret);
     138                 :            : 
     139                 :          0 :         return ret;
     140                 :            : }
     141                 :            : 
     142                 :            : /* Get node capabilities */
     143                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_capabilities_get)
     144                 :          0 : int rte_tm_node_capabilities_get(uint16_t port_id,
     145                 :            :         uint32_t node_id,
     146                 :            :         struct rte_tm_node_capabilities *cap,
     147                 :            :         struct rte_tm_error *error)
     148                 :            : {
     149                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     150                 :            :         int ret;
     151   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_capabilities_get)(dev,
     152                 :            :                 node_id, cap, error);
     153                 :            : 
     154                 :          0 :         rte_tm_trace_node_capabilities_get(port_id, node_id, cap, ret);
     155                 :            : 
     156                 :          0 :         return ret;
     157                 :            : }
     158                 :            : 
     159                 :            : /* Add WRED profile */
     160                 :            : RTE_EXPORT_SYMBOL(rte_tm_wred_profile_add)
     161                 :          0 : int rte_tm_wred_profile_add(uint16_t port_id,
     162                 :            :         uint32_t wred_profile_id,
     163                 :            :         const struct rte_tm_wred_params *profile,
     164                 :            :         struct rte_tm_error *error)
     165                 :            : {
     166                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     167                 :            :         int ret;
     168   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, wred_profile_add)(dev,
     169                 :            :                 wred_profile_id, profile, error);
     170                 :            : 
     171                 :          0 :         rte_tm_trace_wred_profile_add(port_id, wred_profile_id, profile, ret);
     172                 :            : 
     173                 :          0 :         return ret;
     174                 :            : }
     175                 :            : 
     176                 :            : /* Delete WRED profile */
     177                 :            : RTE_EXPORT_SYMBOL(rte_tm_wred_profile_delete)
     178                 :          0 : int rte_tm_wred_profile_delete(uint16_t port_id,
     179                 :            :         uint32_t wred_profile_id,
     180                 :            :         struct rte_tm_error *error)
     181                 :            : {
     182                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     183                 :            :         int ret;
     184   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, wred_profile_delete)(dev,
     185                 :            :                 wred_profile_id, error);
     186                 :            : 
     187                 :          0 :         rte_tm_trace_wred_profile_delete(port_id, wred_profile_id, ret);
     188                 :            : 
     189                 :          0 :         return ret;
     190                 :            : }
     191                 :            : 
     192                 :            : /* Add/update shared WRED context */
     193                 :            : RTE_EXPORT_SYMBOL(rte_tm_shared_wred_context_add_update)
     194                 :          0 : int rte_tm_shared_wred_context_add_update(uint16_t port_id,
     195                 :            :         uint32_t shared_wred_context_id,
     196                 :            :         uint32_t wred_profile_id,
     197                 :            :         struct rte_tm_error *error)
     198                 :            : {
     199                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     200                 :            :         int ret;
     201   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, shared_wred_context_add_update)(dev,
     202                 :            :                 shared_wred_context_id, wred_profile_id, error);
     203                 :            : 
     204                 :          0 :         rte_tm_trace_shared_wred_context_add_update(port_id,
     205                 :            :                                                     shared_wred_context_id,
     206                 :            :                                                     wred_profile_id, ret);
     207                 :            : 
     208                 :          0 :         return ret;
     209                 :            : }
     210                 :            : 
     211                 :            : /* Delete shared WRED context */
     212                 :            : RTE_EXPORT_SYMBOL(rte_tm_shared_wred_context_delete)
     213                 :          0 : int rte_tm_shared_wred_context_delete(uint16_t port_id,
     214                 :            :         uint32_t shared_wred_context_id,
     215                 :            :         struct rte_tm_error *error)
     216                 :            : {
     217                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     218                 :            :         int ret;
     219   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, shared_wred_context_delete)(dev,
     220                 :            :                 shared_wred_context_id, error);
     221                 :            : 
     222                 :          0 :         rte_tm_trace_shared_wred_context_delete(port_id,
     223                 :            :                                                 shared_wred_context_id, ret);
     224                 :            : 
     225                 :          0 :         return ret;
     226                 :            : }
     227                 :            : 
     228                 :            : /* Add shaper profile */
     229                 :            : RTE_EXPORT_SYMBOL(rte_tm_shaper_profile_add)
     230                 :          0 : int rte_tm_shaper_profile_add(uint16_t port_id,
     231                 :            :         uint32_t shaper_profile_id,
     232                 :            :         const struct rte_tm_shaper_params *profile,
     233                 :            :         struct rte_tm_error *error)
     234                 :            : {
     235                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     236                 :            :         int ret;
     237   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, shaper_profile_add)(dev,
     238                 :            :                 shaper_profile_id, profile, error);
     239                 :            : 
     240                 :          0 :         rte_tm_trace_shaper_profile_add(port_id, shaper_profile_id, profile,
     241                 :            :                                         ret);
     242                 :            : 
     243                 :          0 :         return ret;
     244                 :            : }
     245                 :            : 
     246                 :            : /* Delete WRED profile */
     247                 :            : RTE_EXPORT_SYMBOL(rte_tm_shaper_profile_delete)
     248                 :          0 : int rte_tm_shaper_profile_delete(uint16_t port_id,
     249                 :            :         uint32_t shaper_profile_id,
     250                 :            :         struct rte_tm_error *error)
     251                 :            : {
     252                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     253                 :            :         int ret;
     254   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, shaper_profile_delete)(dev,
     255                 :            :                 shaper_profile_id, error);
     256                 :            : 
     257                 :          0 :         rte_tm_trace_shaper_profile_delete(port_id, shaper_profile_id, ret);
     258                 :            : 
     259                 :          0 :         return ret;
     260                 :            : }
     261                 :            : 
     262                 :            : /* Add shared shaper */
     263                 :            : RTE_EXPORT_SYMBOL(rte_tm_shared_shaper_add_update)
     264                 :          0 : int rte_tm_shared_shaper_add_update(uint16_t port_id,
     265                 :            :         uint32_t shared_shaper_id,
     266                 :            :         uint32_t shaper_profile_id,
     267                 :            :         struct rte_tm_error *error)
     268                 :            : {
     269                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     270                 :            :         int ret;
     271   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, shared_shaper_add_update)(dev,
     272                 :            :                 shared_shaper_id, shaper_profile_id, error);
     273                 :            : 
     274                 :          0 :         rte_tm_trace_shared_shaper_add_update(port_id, shared_shaper_id,
     275                 :            :                                               shaper_profile_id, ret);
     276                 :            : 
     277                 :          0 :         return ret;
     278                 :            : }
     279                 :            : 
     280                 :            : /* Delete shared shaper */
     281                 :            : RTE_EXPORT_SYMBOL(rte_tm_shared_shaper_delete)
     282                 :          0 : int rte_tm_shared_shaper_delete(uint16_t port_id,
     283                 :            :         uint32_t shared_shaper_id,
     284                 :            :         struct rte_tm_error *error)
     285                 :            : {
     286                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     287                 :            :         int ret;
     288   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, shared_shaper_delete)(dev,
     289                 :            :                 shared_shaper_id, error);
     290                 :            : 
     291                 :          0 :         rte_tm_trace_shared_shaper_delete(port_id, shared_shaper_id, ret);
     292                 :            : 
     293                 :          0 :         return ret;
     294                 :            : }
     295                 :            : 
     296                 :            : /* Add node to port traffic manager hierarchy */
     297                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_add)
     298                 :          0 : int rte_tm_node_add(uint16_t port_id,
     299                 :            :         uint32_t node_id,
     300                 :            :         uint32_t parent_node_id,
     301                 :            :         uint32_t priority,
     302                 :            :         uint32_t weight,
     303                 :            :         uint32_t level_id,
     304                 :            :         const struct rte_tm_node_params *params,
     305                 :            :         struct rte_tm_error *error)
     306                 :            : {
     307                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     308                 :            :         int ret;
     309   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_add)(dev,
     310                 :            :                 node_id, parent_node_id, priority, weight, level_id,
     311                 :            :                 params, error);
     312                 :            : 
     313                 :          0 :         rte_tm_trace_node_add(port_id, node_id, parent_node_id, priority,
     314                 :            :                               weight, level_id, params, ret);
     315                 :            : 
     316                 :          0 :         return ret;
     317                 :            : }
     318                 :            : 
     319                 :            : RTE_EXPORT_EXPERIMENTAL_SYMBOL(rte_tm_node_query, 24.11)
     320                 :          0 : int rte_tm_node_query(uint16_t port_id,
     321                 :            :         uint32_t node_id,
     322                 :            :         uint32_t *parent_node_id,
     323                 :            :         uint32_t *priority,
     324                 :            :         uint32_t *weight,
     325                 :            :         uint32_t *level_id,
     326                 :            :         struct rte_tm_node_params *params,
     327                 :            :         struct rte_tm_error *error)
     328                 :            : {
     329                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     330                 :            :         int ret;
     331                 :            : 
     332   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_query)(dev,
     333                 :            :                 node_id, parent_node_id, priority, weight, level_id,
     334                 :            :                 params, error);
     335                 :            : 
     336                 :          0 :         rte_tm_trace_node_query(port_id, node_id, parent_node_id, priority,
     337                 :            :                               weight, level_id, params, ret);
     338                 :            : 
     339                 :          0 :         return ret;
     340                 :            : }
     341                 :            : 
     342                 :            : /* Delete node from traffic manager hierarchy */
     343                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_delete)
     344                 :          0 : int rte_tm_node_delete(uint16_t port_id,
     345                 :            :         uint32_t node_id,
     346                 :            :         struct rte_tm_error *error)
     347                 :            : {
     348                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     349                 :            :         int ret;
     350   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_delete)(dev,
     351                 :            :                 node_id, error);
     352                 :            : 
     353                 :          0 :         rte_tm_trace_node_delete(port_id, node_id, ret);
     354                 :            : 
     355                 :          0 :         return ret;
     356                 :            : }
     357                 :            : 
     358                 :            : /* Suspend node */
     359                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_suspend)
     360                 :          0 : int rte_tm_node_suspend(uint16_t port_id,
     361                 :            :         uint32_t node_id,
     362                 :            :         struct rte_tm_error *error)
     363                 :            : {
     364                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     365                 :            :         int ret;
     366   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_suspend)(dev,
     367                 :            :                 node_id, error);
     368                 :            : 
     369                 :          0 :         rte_tm_trace_node_suspend(port_id, node_id, ret);
     370                 :            : 
     371                 :          0 :         return ret;
     372                 :            : }
     373                 :            : 
     374                 :            : /* Resume node */
     375                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_resume)
     376                 :          0 : int rte_tm_node_resume(uint16_t port_id,
     377                 :            :         uint32_t node_id,
     378                 :            :         struct rte_tm_error *error)
     379                 :            : {
     380                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     381                 :            :         int ret;
     382   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_resume)(dev,
     383                 :            :                 node_id, error);
     384                 :            : 
     385                 :          0 :         rte_tm_trace_node_resume(port_id, node_id, ret);
     386                 :            : 
     387                 :          0 :         return ret;
     388                 :            : }
     389                 :            : 
     390                 :            : /* Commit the initial port traffic manager hierarchy */
     391                 :            : RTE_EXPORT_SYMBOL(rte_tm_hierarchy_commit)
     392                 :          0 : int rte_tm_hierarchy_commit(uint16_t port_id,
     393                 :            :         int clear_on_fail,
     394                 :            :         struct rte_tm_error *error)
     395                 :            : {
     396                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     397                 :            :         int ret;
     398   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, hierarchy_commit)(dev,
     399                 :            :                 clear_on_fail, error);
     400                 :            : 
     401                 :          0 :         rte_tm_trace_hierarchy_commit(port_id, clear_on_fail, ret);
     402                 :            : 
     403                 :          0 :         return ret;
     404                 :            : }
     405                 :            : 
     406                 :            : /* Update node parent  */
     407                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_parent_update)
     408                 :          0 : int rte_tm_node_parent_update(uint16_t port_id,
     409                 :            :         uint32_t node_id,
     410                 :            :         uint32_t parent_node_id,
     411                 :            :         uint32_t priority,
     412                 :            :         uint32_t weight,
     413                 :            :         struct rte_tm_error *error)
     414                 :            : {
     415                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     416                 :            :         int ret;
     417   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_parent_update)(dev,
     418                 :            :                 node_id, parent_node_id, priority, weight, error);
     419                 :            : 
     420                 :          0 :         rte_tm_trace_node_parent_update(port_id, node_id, parent_node_id,
     421                 :            :                                         priority, weight, ret);
     422                 :            : 
     423                 :          0 :         return ret;
     424                 :            : }
     425                 :            : 
     426                 :            : /* Update node private shaper */
     427                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_shaper_update)
     428                 :          0 : int rte_tm_node_shaper_update(uint16_t port_id,
     429                 :            :         uint32_t node_id,
     430                 :            :         uint32_t shaper_profile_id,
     431                 :            :         struct rte_tm_error *error)
     432                 :            : {
     433                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     434                 :            :         int ret;
     435   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_shaper_update)(dev,
     436                 :            :                 node_id, shaper_profile_id, error);
     437                 :            : 
     438                 :          0 :         rte_tm_trace_node_shaper_update(port_id, node_id, shaper_profile_id,
     439                 :            :                                         ret);
     440                 :            : 
     441                 :          0 :         return ret;
     442                 :            : }
     443                 :            : 
     444                 :            : /* Update node shared shapers */
     445                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_shared_shaper_update)
     446                 :          0 : int rte_tm_node_shared_shaper_update(uint16_t port_id,
     447                 :            :         uint32_t node_id,
     448                 :            :         uint32_t shared_shaper_id,
     449                 :            :         int add,
     450                 :            :         struct rte_tm_error *error)
     451                 :            : {
     452                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     453                 :            :         int ret;
     454   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_shared_shaper_update)(dev,
     455                 :            :                 node_id, shared_shaper_id, add, error);
     456                 :            : 
     457                 :          0 :         rte_tm_trace_node_shared_shaper_update(port_id, node_id,
     458                 :            :                                                shared_shaper_id, add, ret);
     459                 :            : 
     460                 :          0 :         return ret;
     461                 :            : }
     462                 :            : 
     463                 :            : /* Update node stats */
     464                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_stats_update)
     465                 :          0 : int rte_tm_node_stats_update(uint16_t port_id,
     466                 :            :         uint32_t node_id,
     467                 :            :         uint64_t stats_mask,
     468                 :            :         struct rte_tm_error *error)
     469                 :            : {
     470                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     471                 :            :         int ret;
     472   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_stats_update)(dev,
     473                 :            :                 node_id, stats_mask, error);
     474                 :            : 
     475                 :          0 :         rte_tm_trace_node_stats_update(port_id, node_id, stats_mask, ret);
     476                 :            : 
     477                 :          0 :         return ret;
     478                 :            : }
     479                 :            : 
     480                 :            : /* Update WFQ weight mode */
     481                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_wfq_weight_mode_update)
     482                 :          0 : int rte_tm_node_wfq_weight_mode_update(uint16_t port_id,
     483                 :            :         uint32_t node_id,
     484                 :            :         int *wfq_weight_mode,
     485                 :            :         uint32_t n_sp_priorities,
     486                 :            :         struct rte_tm_error *error)
     487                 :            : {
     488                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     489                 :            :         int ret;
     490   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_wfq_weight_mode_update)(dev,
     491                 :            :                 node_id, wfq_weight_mode, n_sp_priorities, error);
     492                 :            : 
     493                 :          0 :         rte_tm_trace_node_wfq_weight_mode_update(port_id, node_id,
     494                 :            :                                                  wfq_weight_mode,
     495                 :            :                                                  n_sp_priorities, ret);
     496                 :            : 
     497                 :          0 :         return ret;
     498                 :            : }
     499                 :            : 
     500                 :            : /* Update node congestion management mode */
     501                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_cman_update)
     502                 :          0 : int rte_tm_node_cman_update(uint16_t port_id,
     503                 :            :         uint32_t node_id,
     504                 :            :         enum rte_tm_cman_mode cman,
     505                 :            :         struct rte_tm_error *error)
     506                 :            : {
     507                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     508                 :            :         int ret;
     509   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_cman_update)(dev,
     510                 :            :                 node_id, cman, error);
     511                 :            : 
     512                 :          0 :         rte_tm_trace_node_cman_update(port_id, node_id, cman, ret);
     513                 :            : 
     514                 :          0 :         return ret;
     515                 :            : }
     516                 :            : 
     517                 :            : /* Update node private WRED context */
     518                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_wred_context_update)
     519                 :          0 : int rte_tm_node_wred_context_update(uint16_t port_id,
     520                 :            :         uint32_t node_id,
     521                 :            :         uint32_t wred_profile_id,
     522                 :            :         struct rte_tm_error *error)
     523                 :            : {
     524                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     525                 :            :         int ret;
     526   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_wred_context_update)(dev,
     527                 :            :                 node_id, wred_profile_id, error);
     528                 :            : 
     529                 :          0 :         rte_tm_trace_node_wred_context_update(port_id, node_id, wred_profile_id,
     530                 :            :                                               ret);
     531                 :            : 
     532                 :          0 :         return ret;
     533                 :            : }
     534                 :            : 
     535                 :            : /* Update node shared WRED context */
     536                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_shared_wred_context_update)
     537                 :          0 : int rte_tm_node_shared_wred_context_update(uint16_t port_id,
     538                 :            :         uint32_t node_id,
     539                 :            :         uint32_t shared_wred_context_id,
     540                 :            :         int add,
     541                 :            :         struct rte_tm_error *error)
     542                 :            : {
     543                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     544                 :            :         int ret;
     545   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_shared_wred_context_update)(dev,
     546                 :            :                 node_id, shared_wred_context_id, add, error);
     547                 :            : 
     548                 :          0 :         rte_tm_trace_node_shared_wred_context_update(port_id, node_id,
     549                 :            :                                                      shared_wred_context_id,
     550                 :            :                                                      add, ret);
     551                 :            : 
     552                 :          0 :         return ret;
     553                 :            : }
     554                 :            : 
     555                 :            : /* Read and/or clear stats counters for specific node */
     556                 :            : RTE_EXPORT_SYMBOL(rte_tm_node_stats_read)
     557                 :          0 : int rte_tm_node_stats_read(uint16_t port_id,
     558                 :            :         uint32_t node_id,
     559                 :            :         struct rte_tm_node_stats *stats,
     560                 :            :         uint64_t *stats_mask,
     561                 :            :         int clear,
     562                 :            :         struct rte_tm_error *error)
     563                 :            : {
     564                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     565                 :            :         int ret;
     566   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, node_stats_read)(dev,
     567                 :            :                 node_id, stats, stats_mask, clear, error);
     568                 :            : 
     569         [ #  # ]:          0 :         rte_tm_trace_node_stats_read(port_id, node_id, stats, *stats_mask,
     570                 :            :                                      clear, ret);
     571                 :            : 
     572                 :          0 :         return ret;
     573                 :            : }
     574                 :            : 
     575                 :            : /* Packet marking - VLAN DEI */
     576                 :            : RTE_EXPORT_SYMBOL(rte_tm_mark_vlan_dei)
     577                 :          0 : int rte_tm_mark_vlan_dei(uint16_t port_id,
     578                 :            :         int mark_green,
     579                 :            :         int mark_yellow,
     580                 :            :         int mark_red,
     581                 :            :         struct rte_tm_error *error)
     582                 :            : {
     583                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     584                 :            :         int ret;
     585   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, mark_vlan_dei)(dev,
     586                 :            :                 mark_green, mark_yellow, mark_red, error);
     587                 :            : 
     588                 :          0 :         rte_tm_trace_mark_vlan_dei(port_id, mark_green, mark_yellow, mark_red,
     589                 :            :                                    ret);
     590                 :            : 
     591                 :          0 :         return ret;
     592                 :            : }
     593                 :            : 
     594                 :            : /* Packet marking - IPv4/IPv6 ECN */
     595                 :            : RTE_EXPORT_SYMBOL(rte_tm_mark_ip_ecn)
     596                 :          0 : int rte_tm_mark_ip_ecn(uint16_t port_id,
     597                 :            :         int mark_green,
     598                 :            :         int mark_yellow,
     599                 :            :         int mark_red,
     600                 :            :         struct rte_tm_error *error)
     601                 :            : {
     602                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     603                 :            :         int ret;
     604   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, mark_ip_ecn)(dev,
     605                 :            :                 mark_green, mark_yellow, mark_red, error);
     606                 :            : 
     607                 :          0 :         rte_tm_trace_mark_ip_ecn(port_id, mark_green, mark_yellow, mark_red,
     608                 :            :                                  ret);
     609                 :            : 
     610                 :          0 :         return ret;
     611                 :            : }
     612                 :            : 
     613                 :            : /* Packet marking - IPv4/IPv6 DSCP */
     614                 :            : RTE_EXPORT_SYMBOL(rte_tm_mark_ip_dscp)
     615                 :          0 : int rte_tm_mark_ip_dscp(uint16_t port_id,
     616                 :            :         int mark_green,
     617                 :            :         int mark_yellow,
     618                 :            :         int mark_red,
     619                 :            :         struct rte_tm_error *error)
     620                 :            : {
     621                 :          0 :         struct rte_eth_dev *dev = &rte_eth_devices[port_id];
     622                 :            :         int ret;
     623   [ #  #  #  # ]:          0 :         ret = RTE_TM_FUNC(port_id, mark_ip_dscp)(dev,
     624                 :            :                 mark_green, mark_yellow, mark_red, error);
     625                 :            : 
     626                 :          0 :         rte_tm_trace_mark_ip_dscp(port_id, mark_green, mark_yellow, mark_red,
     627                 :            :                                   ret);
     628                 :            : 
     629                 :          0 :         return ret;
     630                 :            : }

Generated by: LCOV version 1.14