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

Function mbuf_from_data_create

dpdk/app/test/test_pdcp.c:1145–1164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1143}
1144
1145static struct rte_mbuf*
1146mbuf_from_data_create(uint8_t *data, uint16_t data_len)
1147{
1148 const struct pdcp_testsuite_params *ts_params = &testsuite_params;
1149 struct rte_mbuf *mbuf;
1150 uint8_t *input_text;
1151
1152 mbuf = rte_pktmbuf_alloc(ts_params->mbuf_pool);
1153 if (mbuf == NULL) {
1154 RTE_LOG(ERR, USER1, "Could not create mbuf\n");
1155 return NULL;
1156 }
1157
1158 memset(rte_pktmbuf_mtod(mbuf, uint8_t *), 0, rte_pktmbuf_tailroom(mbuf));
1159
1160 input_text = (uint8_t *)rte_pktmbuf_append(mbuf, data_len);
1161 memcpy(input_text, data, data_len);
1162
1163 return mbuf;
1164}
1165
1166static int
1167test_attempt_single(struct pdcp_test_conf *t_conf)

Callers 2

test_attempt_singleFunction · 0.85

Calls 3

rte_pktmbuf_allocFunction · 0.85
rte_pktmbuf_appendFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected