c1656328db
This patch implements the changes proposed in the deprecation note[1]. Replace multiple color definitions in various places such as rte_meter.h, rte_tm.h and rte_mtr.h with single rte_color defined in rte_meter.h. This is simple search and replace exercise without any implementation change. [1] https://mails.dpdk.org/archives/dev/2019-January/123861.html Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
30 lines
643 B
C
30 lines
643 B
C
/* SPDX-License-Identifier: BSD-3-Clause
|
|
* Copyright(c) 2010-2014 Intel Corporation
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include "rte_policer.h"
|
|
|
|
int
|
|
rte_phb_config(struct rte_phb *phb_table, uint32_t phb_table_index,
|
|
enum rte_color pre_meter, enum rte_color post_meter, enum rte_phb_action action)
|
|
{
|
|
struct rte_phb *phb = NULL;
|
|
|
|
/* User argument checking */
|
|
if (phb_table == NULL) {
|
|
return -1;
|
|
}
|
|
|
|
if ((pre_meter > RTE_COLOR_RED) || (post_meter > RTE_COLOR_RED) || (pre_meter > post_meter)) {
|
|
return -2;
|
|
}
|
|
|
|
/* Set action in PHB table entry */
|
|
phb = &phb_table[phb_table_index];
|
|
phb->actions[pre_meter][post_meter] = action;
|
|
|
|
|
|
return 0;
|
|
}
|