rte_pktmbuf_detach(clone);
if (c_data != rte_pktmbuf_mtod(clone, char *))
GOTO_FAIL("clone was not detached properly\n");
rte_pktmbuf_detach(clone);
if (c_data != rte_pktmbuf_mtod(clone, char *))
GOTO_FAIL("clone was not detached properly\n");
rte_pktmbuf_detach(clone2);
if (c_data2 != rte_pktmbuf_mtod(clone2, char *))
GOTO_FAIL("clone2 was not detached properly\n");
rte_pktmbuf_detach(clone2);
if (c_data2 != rte_pktmbuf_mtod(clone2, char *))
GOTO_FAIL("clone2 was not detached properly\n");
printf("%s finished at lcore %u, "
"number of freed mbufs: %u\n",
__func__, lcore, free);
printf("%s finished at lcore %u, "
"number of freed mbufs: %u\n",
__func__, lcore, free);
* - increment it's reference up to N+1,
* - enqueue it N times into the ring for slave cores to free.
*/
* - increment it's reference up to N+1,
* - enqueue it N times into the ring for slave cores to free.
*/
i != n && (m = rte_pktmbuf_alloc(refcnt_pool)) != NULL;
i++) {
ref = RTE_MAX(rte_rand() % REFCNT_MAX_REF, 1UL);
i != n && (m = rte_pktmbuf_alloc(refcnt_pool)) != NULL;
i++) {
ref = RTE_MAX(rte_rand() % REFCNT_MAX_REF, 1UL);
/* check that all mbufs are back into mempool by now */
for (wn = 0; wn != REFCNT_MAX_TIMEOUT; wn++) {
/* check that all mbufs are back into mempool by now */
for (wn = 0; wn != REFCNT_MAX_TIMEOUT; wn++) {
refcnt_lcore[lcore] += tref;
printf("%s(lcore=%u, iter=%u) completed, "
"%u references processed\n",
__func__, lcore, iter, tref);
return;
}
refcnt_lcore[lcore] += tref;
printf("%s(lcore=%u, iter=%u) completed, "
"%u references processed\n",
__func__, lcore, iter, tref);
return;
}
if ((lnum = rte_lcore_count()) == 1) {
printf("skipping %s, number of lcores: %u is not enough\n",
__func__, lnum);
if ((lnum = rte_lcore_count()) == 1) {
printf("skipping %s, number of lcores: %u is not enough\n",
__func__, lnum);
}
printf("starting %s, at %u lcores\n", __func__, lnum);
}
printf("starting %s, at %u lcores\n", __func__, lnum);
SOCKET_ID_ANY)) == NULL) {
printf("%s: cannot allocate " MAKE_STRING(refcnt_pool) "\n",
__func__);
SOCKET_ID_ANY)) == NULL) {
printf("%s: cannot allocate " MAKE_STRING(refcnt_pool) "\n",
__func__);
}
if (refcnt_mbuf_ring == NULL &&
(refcnt_mbuf_ring = rte_ring_create("refcnt_mbuf_ring",
}
if (refcnt_mbuf_ring == NULL &&
(refcnt_mbuf_ring = rte_ring_create("refcnt_mbuf_ring",
-static struct test_command mbuf_cmd = {
- .command = "mbuf_autotest",
- .callback = test_mbuf,
-};
-REGISTER_TEST_COMMAND(mbuf_cmd);
+REGISTER_TEST_COMMAND(mbuf_autotest, test_mbuf);