blob: 10d5fe8a4b2fd7d90c9feb22a6b6a1d4651814f3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/* 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;
}
|