MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pipeline_port_out_create

Function pipeline_port_out_create

dpdk/examples/ip_pipeline/pipeline.c:371–573  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371int
372pipeline_port_out_create(const char *pipeline_name,
373 struct port_out_params *params)
374{
375 struct rte_pipeline_port_out_params p;
376
377 union {
378 struct rte_port_ethdev_writer_params ethdev;
379 struct rte_port_ring_writer_params ring;
380 struct rte_port_sched_writer_params sched;
381 struct rte_port_fd_writer_params fd;
382 struct rte_port_sink_params sink;
383 struct rte_port_sym_crypto_writer_params sym_crypto;
384 } pp;
385
386 union {
387 struct rte_port_ethdev_writer_nodrop_params ethdev;
388 struct rte_port_ring_writer_nodrop_params ring;
389 struct rte_port_fd_writer_nodrop_params fd;
390 struct rte_port_sym_crypto_writer_nodrop_params sym_crypto;
391 } pp_nodrop;
392
393 struct pipeline *pipeline;
394 uint32_t port_id;
395 int status;
396
397 memset(&p, 0, sizeof(p));
398 memset(&pp, 0, sizeof(pp));
399 memset(&pp_nodrop, 0, sizeof(pp_nodrop));
400
401 /* Check input params */
402 if ((pipeline_name == NULL) ||
403 (params == NULL) ||
404 (params->burst_size == 0) ||
405 (params->burst_size > RTE_PORT_IN_BURST_SIZE_MAX))
406 return -1;
407
408 pipeline = pipeline_find(pipeline_name);
409 if (pipeline == NULL)
410 return -1;
411
412 switch (params->type) {
413 case PORT_OUT_TXQ:
414 {
415 struct link *link;
416
417 link = link_find(params->dev_name);
418 if (link == NULL)
419 return -1;
420
421 if (params->txq.queue_id >= link->n_txq)
422 return -1;
423
424 pp.ethdev.port_id = link->port_id;
425 pp.ethdev.queue_id = params->txq.queue_id;
426 pp.ethdev.tx_burst_sz = params->burst_size;
427
428 pp_nodrop.ethdev.port_id = link->port_id;

Callers 1

cmd_pipeline_port_outFunction · 0.85

Calls 8

memsetFunction · 0.85
link_findFunction · 0.85
swq_findFunction · 0.85
tmgr_port_findFunction · 0.85
tap_findFunction · 0.85
pipeline_findFunction · 0.70
cryptodev_findFunction · 0.70

Tested by

no test coverage detected