|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
55 unsigned count = rte_mempool_avail_count (rmp);
56 unsigned free_count = rte_mempool_in_use_count (rmp);
59 "name=\"%s\" available = %7d allocated = %7d total = %7d\n",
82 .path =
"show dpdk buffer",
83 .short_help =
"show dpdk buffer",
100 err =
clib_sysfs_read (
"/proc/sys/fs/pipe-max-size",
"%u", &pipe_max_size);
105 if (pipe (fds) == -1)
109 #define F_SETPIPE_SZ (1024 + 7)
118 if (fcntl (fds[0], F_SETFL, O_NONBLOCK) == -1)
124 if ((
f = fdopen (fds[1],
"a")) == 0)
130 rte_dump_physmem_layout (
f);
139 n = read (fds[0], s +
len, n_try);
140 if (n < 0 && errno != EAGAIN)
145 _vec_len (s) =
len + (n < 0 ? 0 : n);
167 .path =
"show dpdk physmem",
168 .short_help =
"show dpdk physmem",
178 static u32 *allocated_buffers;
185 if (
unformat (input,
"allocate %d", &n_alloc))
201 _vec_len (allocated_buffers) =
first;
207 vec_len (allocated_buffers) + n_alloc - 1);
211 _vec_len (allocated_buffers) =
first + actual_alloc;
213 if (actual_alloc < n_alloc)
221 if (allocated_buffers &&
vec_len (allocated_buffers) == 0)
255 .path =
"test dpdk buffer",
256 .short_help =
"test dpdk buffer [allocate <nn>] [free <nn>]",
270 u32 hw_if_index = (
u32) ~ 0;
271 u32 nb_rx_desc = (
u32) ~ 0;
272 u32 nb_tx_desc = (
u32) ~ 0;
284 else if (
unformat (line_input,
"tx %d", &nb_tx_desc))
286 else if (
unformat (line_input,
"rx %d", &nb_rx_desc))
296 if (hw_if_index == (
u32) ~ 0)
305 if ((xd->
flags & DPDK_DEVICE_FLAG_PMD) == 0)
309 "number of descriptors can be set only for "
314 if ((nb_rx_desc == (
u32) ~ 0 || nb_rx_desc == xd->
nb_rx_desc) &&
321 if (nb_rx_desc != (
u32) ~ 0)
324 if (nb_tx_desc != (
u32) ~ 0)
350 .path =
"set dpdk interface descriptors",
351 .short_help =
"set dpdk interface descriptors <interface> [rx <nn>] [tx <nn>]",
361 #define _(a,b,c) vlib_cli_output (vm, "%-25s " b, a ":", c);
362 _(
"DPDK Version",
"%s", rte_version ());
381 .path =
"show dpdk version",
382 .short_help =
"show dpdk version",
format_function_t format_dpdk_device_errors
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
clib_error_t * dpdk_cli_init(vlib_main_t *vm)
void dpdk_cli_reference(void)
#define clib_error_return(e, args...)
static vlib_cli_command_t cmd_set_dpdk_if_desc
(constructor) VLIB_CLI_COMMAND (cmd_set_dpdk_if_desc)
static heap_elt_t * first(heap_header_t *h)
vlib_buffer_main_t * buffer_main
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static vlib_cli_command_t cmd_show_dpdk_buffer
(constructor) VLIB_CLI_COMMAND (cmd_show_dpdk_buffer)
void dpdk_device_setup(dpdk_device_t *xd)
dpdk_config_main_t dpdk_config_main
static clib_error_t * set_dpdk_if_desc(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
__clib_export clib_error_t * clib_sysfs_read(char *file_name, char *fmt,...)
static vlib_cli_command_t cmd_show_dpdk_physmem
(constructor) VLIB_CLI_COMMAND (cmd_show_dpdk_physmem)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
static clib_error_t * show_dpdk_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static __clib_warn_unused_result u32 vlib_buffer_alloc(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Allocate buffers into supplied array.
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
static vnet_hw_interface_t * vnet_get_hw_interface(vnet_main_t *vnm, u32 hw_if_index)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
#define VLIB_CLI_COMMAND(x,...)
unformat_function_t unformat_vnet_hw_interface
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
static clib_error_t * show_dpdk_version_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
struct rte_mempool ** dpdk_mempool_by_buffer_pool_index
#define vec_free(V)
Free vector's memory (no header).
vlib_buffer_pool_t * buffer_pools
#define VLIB_INIT_FUNCTION(x)
#define vec_foreach(var, vec)
Vector iterator.
#define clib_error_return_unix(e, args...)
#define vec_resize(V, N)
Resize a vector (no header, unspecified alignment) Add N elements to end of given vector V,...
static vlib_cli_command_t cmd_test_dpdk_buffer
(constructor) VLIB_CLI_COMMAND (cmd_test_dpdk_buffer)
static clib_error_t * test_dpdk_buffer(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static clib_error_t * show_dpdk_physmem(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static vlib_cli_command_t show_vpe_version_command
(constructor) VLIB_CLI_COMMAND (show_vpe_version_command)