29 #include <sys/mount.h> 39 #include <dpdk/api/dpdk.api_enum.h> 40 #include <dpdk/api/dpdk.api_types.h> 48 vl_api_sw_interface_set_dpdk_hqos_pipe_reply_t *rmp;
67 rv = rte_sched_pipe_config (xd->hqos_ht->hqos, subport, pipe, profile);
71 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_PIPE_REPLY);
79 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_pipe ");
83 s =
format (s,
"subport %u pipe %u profile %u ",
93 vl_api_sw_interface_set_dpdk_hqos_subport_reply_t *rmp;
98 struct rte_sched_subport_params p;
102 p.tb_rate = ntohl (mp->
tb_rate);
103 p.tb_size = ntohl (mp->
tb_size);
104 p.tc_rate[0] = ntohl (mp->
tc_rate[0]);
105 p.tc_rate[1] = ntohl (mp->
tc_rate[1]);
106 p.tc_rate[2] = ntohl (mp->
tc_rate[2]);
107 p.tc_rate[3] = ntohl (mp->
tc_rate[3]);
119 rv = rte_sched_subport_config (xd->hqos_ht->hqos, subport, &p);
123 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_SUBPORT_REPLY);
131 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_subport ");
137 "subport %u rate %u bkt_size %u tc0 %u tc1 %u tc2 %u tc3 %u period %u",
150 vl_api_sw_interface_set_dpdk_hqos_tctbl_reply_t *rmp;
159 u32 tc = ntohl (mp->
tc);
172 if (tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)
175 rv = VNET_API_ERROR_INVALID_VALUE;
178 if (queue >= RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS)
181 rv = VNET_API_ERROR_INVALID_VALUE;
191 rv = VNET_API_ERROR_INVALID_VALUE_2;
197 int worker_thread_count = tr->
count;
199 val = tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + queue;
200 for (i = 0; i < worker_thread_count; i++)
201 xd->hqos_wt[worker_thread_first + i].hqos_tc_table[entry] = val;
206 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_TCTBL_REPLY);
214 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_tctbl ");
218 s =
format (s,
"entry %u tc %u queue %u",
224 #include <dpdk/api/dpdk.api.c> DPDK interface HQoS subport parameters set request.
static void vl_api_sw_interface_set_dpdk_hqos_tctbl_t_handler(vl_api_sw_interface_set_dpdk_hqos_tctbl_t *mp)
static void * vl_api_sw_interface_set_dpdk_hqos_tctbl_t_print(vl_api_sw_interface_set_dpdk_hqos_tctbl_t *mp, void *handle)
static vnet_hw_interface_t * vnet_get_sup_hw_interface(vnet_main_t *vnm, u32 sw_if_index)
Optimized string handling code, including c11-compliant "safe C library" variants.
static clib_error_t * dpdk_api_init(vlib_main_t *vm)
#define VLIB_INIT_FUNCTION(x)
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static void vl_api_sw_interface_set_dpdk_hqos_subport_t_handler(vl_api_sw_interface_set_dpdk_hqos_subport_t *mp)
vl_api_interface_index_t sw_if_index
#define BAD_SW_IF_INDEX_LABEL
static void * vl_api_sw_interface_set_dpdk_hqos_pipe_t_print(vl_api_sw_interface_set_dpdk_hqos_pipe_t *mp, void *handle)
sll srl srl sll sra u16x4 i
DPDK interface HQoS tctbl entry set request.
#define clib_warning(format, args...)
Bitmaps built as vectors of machine words.
vl_api_interface_index_t sw_if_index
uword * thread_registrations_by_name
#define hash_get_mem(h, key)
static vlib_thread_main_t * vlib_get_thread_main()
DPDK interface HQoS pipe profile set request.
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
static void vl_api_sw_interface_set_dpdk_hqos_pipe_t_handler(vl_api_sw_interface_set_dpdk_hqos_pipe_t *mp)
static void * vl_api_sw_interface_set_dpdk_hqos_subport_t_print(vl_api_sw_interface_set_dpdk_hqos_subport_t *mp, void *handle)
vl_api_interface_index_t sw_if_index
vl_api_interface_index_t sw_if_index
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
#define VALIDATE_SW_IF_INDEX(mp)