|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
18 #include <sys/types.h>
21 #include <sys/ioctl.h>
25 #include <vppinfra/linux/syscall.h>
31 #define MV_SYS_DMA_MEM_SZ (2 << 20)
33 #define NUM_HIFS_RSVD 4
35 #define NUM_BPOOLS_RSVD 7
50 pp2_hif_deinit (ptd->
hif);
55 mv_sys_dma_mem_destroy ();
64 struct pp2_init_params init_params = { 0 };
74 rv = pp2_init (&init_params);
88 struct pp2_hif_params hif_params = { 0 };
91 hif_params.match = (
char *) s;
92 hif_params.out_size = 2048;
93 if (pp2_hif_init (&hif_params, &ptd->
hif))
129 pp2_ppio_disable (ppif->
ppio);
130 pp2_ppio_deinit (ppif->
ppio);
152 pp2_bpool_get_num_buffs (inq->
bpool, &n_bufs);
155 struct pp2_buff_inf binf;
159 u32 bi = binf.cookie;
163 pp2_bpool_deinit (inq->
bpool);
182 struct pp2_bpool_params bpool_params = { 0 };
183 struct pp2_ppio_params ppio_params = { 0 };
184 struct pp2_ppio_inq_params inq_params = { 0 };
187 u8 pp2_id, port_id, *s = 0;
189 u8 n_outqs, n_inqs = 1;
194 args->
rv = VNET_API_ERROR_INIT_FAILED;
196 " is bigger than number of output "
197 "queues (%u)", PP2_PPIO_MAX_NUM_OUTQS);
210 args->
rv = VNET_API_ERROR_INIT_FAILED;
221 for (
i = 0;
i < n_inqs;
i++)
226 for (
i = 0;
i < n_outqs;
i++)
233 if (pp2_netdev_get_ppio_info ((
char *) args->
name, &pp2_id, &port_id))
235 args->
rv = VNET_API_ERROR_INVALID_INTERFACE;
242 s =
format (s,
"pool-%d:%d%c", pp2_id, pp2_id + 8, 0);
243 bpool_params.match = (
char *) s;
246 if (pp2_bpool_init (&bpool_params, &ppif->
inqs[0].
bpool))
248 args->
rv = VNET_API_ERROR_INIT_FAILED;
254 s =
format (s,
"ppio-%d:%d%c", pp2_id, port_id, 0);
255 ppio_params.match = (
char *) s;
256 ppio_params.type = PP2_PPIO_T_NIC;
257 inq_params.size = args->
rx_q_sz;
258 ppio_params.inqs_params.num_tcs = 1;
259 ppio_params.inqs_params.tcs_params[0].pkt_offset = 0;
260 ppio_params.inqs_params.tcs_params[0].num_in_qs = n_inqs;
261 ppio_params.inqs_params.tcs_params[0].inqs_params = &inq_params;
262 ppio_params.inqs_params.tcs_params[0].pools[0][0] = ppif->
inqs[0].
bpool;
263 ppio_params.outqs_params.num_outqs = n_outqs;
264 for (
i = 0;
i < n_outqs;
i++)
266 ppio_params.outqs_params.outqs_params[
i].weight = 1;
267 ppio_params.outqs_params.outqs_params[
i].size = args->
tx_q_sz;
269 if (pp2_ppio_init (&ppio_params, &ppif->
ppio))
271 args->
rv = VNET_API_ERROR_INIT_FAILED;
279 args->
rv = VNET_API_ERROR_INIT_FAILED;
292 args->
rv = VNET_API_ERROR_INVALID_REGISTRATION;
331 rv = pp2_ppio_enable (ppif->
ppio);
333 rv = pp2_ppio_disable (ppif->
ppio);
337 is_up ?
"enable" :
"disable");
352 struct pp2_ppio_statistics
stats;
354 pp2_ppio_get_statistics (ppif->
ppio, &
stats, 1);
386 .name =
"Marvell PPv2 interface",
#define vec_reset_length(v)
Reset vector length to zero NULL-pointer tolerant.
#define VNET_HW_IF_RXQ_THREAD_ANY
static void vlib_buffer_free(vlib_main_t *vm, u32 *buffers, u32 n_buffers)
Free buffers Frees the entire buffer chain for each buffer.
struct _vnet_device_class vnet_device_class_t
static uword vlib_node_add_next(vlib_main_t *vm, uword node, uword next_node)
int vnet_hw_if_set_rx_queue_mode(vnet_main_t *vnm, u32 queue_index, vnet_hw_if_rx_mode mode)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void mrvl_pp2_main_deinit()
#define clib_error_return(e, args...)
vnet_device_class_t ppa2_device_class
@ VNET_SW_INTERFACE_FLAG_ADMIN_UP
#define pool_put(P, E)
Free an object E in pool P.
@ VNET_HW_IF_RX_MODE_POLLING
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
u32 per_interface_next_index
mrvl_pp2_main_t mrvl_pp2_main
@ VNET_HW_INTERFACE_FLAG_LINK_UP
vl_api_ikev2_sa_stats_t stats
static clib_error_t * mrvl_pp2_main_init()
format_function_t format_mrvl_pp2_interface
format_function_t format_mrvl_pp2_interface_name
static clib_error_t * mrvl_pp2_interface_admin_up_down(vnet_main_t *vnm, u32 hw_if_index, u32 flags)
static u32 mrvl_pp2_eth_flag_change(vnet_main_t *vnm, vnet_hw_interface_t *hi, u32 flags)
static void mrvl_pp2_clear_interface_counters(u32 instance)
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
VNET_DEVICE_CLASS(mrvl_pp2_device_class,)
#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)
vnet_main_t * vnet_get_main(void)
#define vec_validate_aligned(V, I, A)
Make sure vector is long enough for given index (no header, specified alignment)
uword mrvl_pp2_interface_tx(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
#define MV_SYS_DMA_MEM_SZ
#define vec_foreach_index(var, v)
Iterate over vector indices.
struct pp2_ppio_desc * descs
void vnet_hw_if_update_runtime_data(vnet_main_t *vnm, u32 hw_if_index)
sll srl srl sll sra u16x4 i
#define CLIB_CACHE_LINE_BYTES
vl_api_mac_address_t mac_addr
static clib_error_t * mrvl_pp2_init(vlib_main_t *vm)
vnet_device_class_t mrvl_pp2_device_class
#define vec_free(V)
Free vector's memory (no header).
mrvl_pp2_if_t * interfaces
description fragment has unexpected format
static vnet_sw_interface_t * vnet_get_hw_sw_interface(vnet_main_t *vnm, u32 hw_if_index)
static_always_inline u32 vlib_buffer_get_default_data_size(vlib_main_t *vm)
#define VLIB_INIT_FUNCTION(x)
void ethernet_delete_interface(vnet_main_t *vnm, u32 hw_if_index)
#define foreach_mrvl_pp2_tx_func_error
#define vec_foreach(var, vec)
Vector iterator.
static uword pool_elts(void *v)
Number of active elements in a pool.
mrvl_pp2_per_thread_data_t * per_thread_data
u32 vnet_hw_if_register_rx_queue(vnet_main_t *vnm, u32 hw_if_index, u32 queue_id, u32 thread_index)
static vlib_main_t * vlib_get_main(void)
void mrvl_pp2_delete_if(mrvl_pp2_if_t *ppif)
#define pool_get_zero(P, E)
Allocate an object E from a pool P and zero it.
clib_error_t * vnet_hw_interface_set_flags(vnet_main_t *vnm, u32 hw_if_index, vnet_hw_interface_flags_t flags)
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
void mrvl_pp2_create_if(mrvl_pp2_create_if_args_t *args)
static vlib_thread_main_t * vlib_get_thread_main()
#define MRVL_PP2_IF_F_ADMIN_UP
clib_error_t * ethernet_register_interface(vnet_main_t *vnm, u32 dev_class_index, u32 dev_instance, const u8 *address, u32 *hw_if_index_return, ethernet_flag_change_function_t flag_change)
static char * mrvl_pp2_tx_func_error_strings[]
void vnet_hw_if_set_input_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
static void mrvl_pp2_set_interface_next_node(vnet_main_t *vnm, u32 hw_if_index, u32 node_index)
vl_api_wireguard_peer_flags_t flags