MCPcopy Index your code
hub / github.com/F-Stack/f-stack / ff_if_send_onepkt

Function ff_if_send_onepkt

lib/ff_memory.c:440–475  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438}
439
440int ff_if_send_onepkt(struct ff_dpdk_if_context *ctx, void *m, int total)
441{
442 struct rte_mbuf *head = NULL;
443 void *src_buf = NULL;
444 void *p_data = NULL;
445 struct lcore_conf *qconf = NULL;
446 unsigned len = 0;
447
448 if ( !m ){
449 rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_USER1, "ff_dpdk_if_send_ex input invalid NULL address.");
450 return 0;
451 }
452 p_data = ff_mbuf_mtod(m);
453 if ( ff_chk_vma((uint64_t)p_data)){
454 head = ff_bsd_to_rte(m, total);
455 }
456 else if ( (head = ff_extcl_to_rte(m)) == NULL ){
457 rte_panic("data address 0x%lx is out of page bound or not malloced by DPDK recver.", (uint64_t)p_data);
458 return 0;
459 }
460
461 if (head == NULL){
462 rte_log(RTE_LOG_CRIT, RTE_LOGTYPE_USER1, "ff_if_send_onepkt call ff_bsd_to_rte failed.");
463 ff_mbuf_free(m);
464 return 0;
465 }
466
467 ff_offload_set(ctx, m, head);
468 qconf = &lcore_conf;
469 len = qconf->tx_mbufs[ctx->port_id].len;
470 qconf->tx_mbufs[ctx->port_id].m_table[len] = head;
471 qconf->tx_mbufs[ctx->port_id].bsd_m_table[len] = m;
472 len++;
473
474 return len;
475}
476
477int ff_enq_tx_bsdmbuf(uint8_t portid, void *p_mbuf, int nb_segs)
478{

Callers 1

ff_dpdk_if_sendFunction · 0.85

Calls 7

rte_logFunction · 0.85
ff_mbuf_mtodFunction · 0.85
ff_chk_vmaFunction · 0.85
ff_bsd_to_rteFunction · 0.85
ff_extcl_to_rteFunction · 0.85
ff_mbuf_freeFunction · 0.85
ff_offload_setFunction · 0.85

Tested by

no test coverage detected