29 #include <sys/mount.h> 49 #define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__) 52 #define vl_api_version(n,v) static u32 api_version=(v); 59 vl_print (handle, (char *)s); \ 69 vl_api_sw_interface_set_dpdk_hqos_pipe_reply_t *rmp;
88 rv = rte_sched_pipe_config (xd->
hqos_ht->
hqos, subport, pipe, profile);
92 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_PIPE_REPLY);
100 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_pipe ");
104 s =
format (s,
"subport %u pipe %u profile %u ",
114 vl_api_sw_interface_set_dpdk_hqos_subport_reply_t *rmp;
119 struct rte_sched_subport_params p;
123 p.tb_rate = ntohl (mp->
tb_rate);
124 p.tb_size = ntohl (mp->
tb_size);
125 p.tc_rate[0] = ntohl (mp->
tc_rate[0]);
126 p.tc_rate[1] = ntohl (mp->
tc_rate[1]);
127 p.tc_rate[2] = ntohl (mp->
tc_rate[2]);
128 p.tc_rate[3] = ntohl (mp->
tc_rate[3]);
140 rv = rte_sched_subport_config (xd->
hqos_ht->
hqos, subport, &p);
144 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_SUBPORT_REPLY);
152 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_subport ");
158 "subport %u rate %u bkt_size %u tc0 %u tc1 %u tc2 %u tc3 %u period %u",
171 vl_api_sw_interface_set_dpdk_hqos_tctbl_reply_t *rmp;
180 u32 tc = ntohl (mp->
tc);
193 if (tc >= RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE)
196 rv = VNET_API_ERROR_INVALID_VALUE;
199 if (queue >= RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS)
202 rv = VNET_API_ERROR_INVALID_VALUE;
212 rv = VNET_API_ERROR_INVALID_VALUE_2;
218 int worker_thread_count = tr->
count;
220 val = tc * RTE_SCHED_QUEUES_PER_TRAFFIC_CLASS + queue;
221 for (i = 0; i < worker_thread_count; i++)
227 REPLY_MACRO (VL_API_SW_INTERFACE_SET_DPDK_HQOS_TCTBL_REPLY);
235 s =
format (0,
"SCRIPT: sw_interface_set_dpdk_hqos_tctbl ");
239 s =
format (s,
"entry %u tc %u queue %u",
245 #define foreach_dpdk_plugin_api_msg \ 246 _(SW_INTERFACE_SET_DPDK_HQOS_PIPE, sw_interface_set_dpdk_hqos_pipe) \ 247 _(SW_INTERFACE_SET_DPDK_HQOS_SUBPORT, sw_interface_set_dpdk_hqos_subport) \ 248 _(SW_INTERFACE_SET_DPDK_HQOS_TCTBL, sw_interface_set_dpdk_hqos_tctbl) 256 vl_msg_api_set_handlers((VL_API_##N + dm->msg_id_base), \ 258 vl_api_##n##_t_handler, \ 260 vl_api_##n##_t_endian, \ 261 vl_api_##n##_t_print, \ 262 sizeof(vl_api_##n##_t), 1); 268 #define vl_msg_name_crc_list 270 #undef vl_msg_name_crc_list 275 #define _(id,n,crc) \ 276 vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + dm->msg_id_base); 277 foreach_vl_msg_name_crc_dpdk;
301 name =
format (0,
"dpdk_%08x%c", api_version, 0);
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 setup_message_id_table(dpdk_main_t *dm, api_main_t *am)
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 clib_error_t * dpdk_plugin_api_hookup(vlib_main_t *vm)
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)
struct rte_sched_port * hqos
vl_api_interface_index_t sw_if_index
#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)
dpdk_device_hqos_per_worker_thread_t * hqos_wt
API main structure, used by both vpp and binary API clients.
#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)
#define vec_free(V)
Free vector's memory (no header).
DPDK interface HQoS tctbl entry set request.
#define clib_warning(format, args...)
#define foreach_dpdk_plugin_api_msg
Bitmaps built as vectors of machine words.
dpdk_device_hqos_per_hqos_thread_t * hqos_ht
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 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)
CLIB vectors are ubiquitous dynamically resized arrays with by user defined "headers".
#define VALIDATE_SW_IF_INDEX(mp)
u16 vl_msg_api_get_msg_ids(const char *name, int n)