-/*-
- * SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2014 Intel Corporation
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
*/
#include <stdio.h>
ev.queue_id = t->qid[0];
ev.op = RTE_EVENT_OP_NEW;
ev.mbuf = mbufs[i];
- mbufs[i]->seqn = MAGIC_SEQN + i;
+ *rte_event_pmd_selftest_seqn(mbufs[i]) = MAGIC_SEQN + i;
/* generate pkt and enqueue */
err = rte_event_enqueue_burst(evdev, t->port[rx_port], &ev, 1);
rte_event_dev_dump(evdev, stdout);
return -1;
}
- seq = deq_ev[i].mbuf->seqn - MAGIC_SEQN;
+ seq = *rte_event_pmd_selftest_seqn(deq_ev[i].mbuf) - MAGIC_SEQN;
if (seq != (i-1)) {
PMD_DRV_LOG(ERR, " seq test failed ! eq is %d , "
ev.op = RTE_EVENT_OP_NEW;
ev.flow_id = 1;
ev.mbuf = mbufs[i];
- mbufs[i]->seqn = MAGIC_SEQN + i;
+ *rte_event_pmd_selftest_seqn(mbufs[i]) = MAGIC_SEQN + i;
/* generate pkt and enqueue */
err = rte_event_enqueue_burst(evdev, t->port[rx_port], &ev, 1);
return -1;
}
- for (int j = 0; j < 3; j++) {
+ int j;
+ for (j = 0; j < 3; j++) {
deq_ev[j].op = RTE_EVENT_OP_FORWARD;
deq_ev[j].queue_id = t->qid[1];
}
check_statistics(void)
{
int num_ports = 3; /* Hard-coded for this app */
+ int i;
- for (int i = 0; i < num_ports; i++) {
+ for (i = 0; i < num_ports; i++) {
int num_stats, num_stats_returned;
num_stats = rte_event_dev_xstats_names_get(0,
uint32_t deq_pkts;
struct rte_mbuf *mbufs[3];
RTE_SET_USED(mbufs);
- RTE_SET_USED(i);
/* Create instance with 3 ports */
if (init(t, 2, tx_port + 1) < 0 ||
ev.queue_id = t->qid[0];
ev.op = RTE_EVENT_OP_NEW;
ev.mbuf = mbufs[i];
- mbufs[i]->seqn = 1234 + i;
+ *rte_event_pmd_selftest_seqn(mbufs[i]) = 1234 + i;
/* generate pkt and enqueue */
err = rte_event_enqueue_burst(evdev, t->port[rx_port], &ev, 1);
static int
single_link(struct test *t)
{
- /* const uint8_t rx_port = 0; */
- /* const uint8_t w1_port = 1; */
- /* const uint8_t w3_port = 3; */
const uint8_t tx_port = 2;
int err;
- int i;
struct rte_mbuf *mbufs[3];
RTE_SET_USED(mbufs);
- RTE_SET_USED(i);
/* Create instance with 5 ports */
if (init(t, 2, tx_port+1) < 0 ||
}
- /* Start the devicea */
+ /* Start the device */
if (!err) {
if (rte_event_dev_start(evdev) < 0) {
PMD_DRV_LOG(ERR, "%s:%d: Error with start call\n",
/* turn on stats by default */
if (rte_vdev_init(eventdev_name, "do_validation=1") < 0) {
PMD_DRV_LOG(ERR, "Error creating eventdev\n");
+ free(t);
return -1;
}
evdev = rte_event_dev_get_dev_id(eventdev_name);
if (evdev < 0) {
PMD_DRV_LOG(ERR, "Error finding newly created eventdev\n");
+ free(t);
return -1;
}
}
rte_socket_id());
if (!eventdev_func_mempool) {
PMD_DRV_LOG(ERR, "ERROR creating mempool\n");
+ free(t);
return -1;
}
}
ret = single_link_w_stats(t);
/*
- * Free test instance, leaving mempool initialized, and a pointer to it
- * in static eventdev_func_mempool, as it is re-used on re-runs
+ * Free test instance, free mempool
*/
+ rte_mempool_free(t->mbuf_pool);
free(t);
if (ret != 0)