return (*dev->dev_ops->queue_setup)(dev, queue_id, queue_conf);
}
-uint8_t
-rte_event_queue_count(uint8_t dev_id)
-{
- struct rte_eventdev *dev;
-
- dev = &rte_eventdevs[dev_id];
- return dev->data->nb_queues;
-}
-
uint8_t
rte_event_queue_priority(uint8_t dev_id, uint8_t queue_id)
{
return 0;
}
-uint8_t
-rte_event_port_count(uint8_t dev_id)
+int
+rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
+ uint32_t *attr_value)
{
struct rte_eventdev *dev;
+ if (!attr_value)
+ return -EINVAL;
+ RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
dev = &rte_eventdevs[dev_id];
- return dev->data->nb_ports;
+
+ switch (attr_id) {
+ case RTE_EVENT_DEV_ATTR_PORT_COUNT:
+ *attr_value = dev->data->nb_ports;
+ break;
+ case RTE_EVENT_DEV_ATTR_QUEUE_COUNT:
+ *attr_value = dev->data->nb_queues;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
}
int
uint32_t *attr_value)
{
struct rte_eventdev *dev;
+
+ if (!attr_value)
+ return -EINVAL;
+
RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
dev = &rte_eventdevs[dev_id];
if (!is_valid_port(dev, port_id)) {
int
rte_event_dev_info_get(uint8_t dev_id, struct rte_event_dev_info *dev_info);
+/**
+ * The count of ports.
+ */
+#define RTE_EVENT_DEV_ATTR_PORT_COUNT 0
+/**
+ * The count of queues.
+ */
+#define RTE_EVENT_DEV_ATTR_QUEUE_COUNT 1
+
+/**
+ * Get an attribute from a device.
+ *
+ * @param dev_id Eventdev id
+ * @param attr_id The attribute ID to retrieve
+ * @param[out] attr_value A pointer that will be filled in with the attribute
+ * value if successful.
+ *
+ * @retval 0 Successfully retrieved attribute value
+ * -EINVAL Invalid device or *attr_id* provided, or *attr_value*
+ * is NULL
+ */
+int
+rte_event_dev_attr_get(uint8_t dev_id, uint32_t attr_id,
+ uint32_t *attr_value);
+
+
/* Event device configuration bitmap flags */
#define RTE_EVENT_DEV_CFG_PER_DEQUEUE_TIMEOUT (1ULL << 0)
/**< Override the global *dequeue_timeout_ns* and use per dequeue timeout in ns.
rte_event_port_setup(uint8_t dev_id, uint8_t port_id,
const struct rte_event_port_conf *port_conf);
-/**
- * Get the number of ports on a specific event device
- *
- * @param dev_id
- * Event device identifier.
- * @return
- * - The number of configured ports
- */
-uint8_t
-rte_event_port_count(uint8_t dev_id);
-
/**
* The queue depth of the port on the enqueue side
*/
rte_event_port_default_conf_get;
rte_event_port_setup;
- rte_event_port_count;
rte_event_port_link;
rte_event_port_unlink;
rte_event_port_links_get;
rte_event_queue_default_conf_get;
rte_event_queue_setup;
- rte_event_queue_count;
rte_event_queue_priority;
rte_event_dequeue_timeout_ticks;
DPDK_17.11 {
global:
+ rte_event_dev_attr_get;
rte_event_port_attr_get;
} DPDK_17.08;
ret = rte_event_queue_default_conf_get(TEST_DEV_ID, 0, NULL);
TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
- for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+
+ for (i = 0; i < (int)queue_count; i++) {
ret = rte_event_queue_default_conf_get(TEST_DEV_ID, i,
&qconf);
TEST_ASSERT_SUCCESS(ret, "Failed to get queue%d info", i);
ret = rte_event_queue_setup(TEST_DEV_ID, 0, &qconf);
TEST_ASSERT_SUCCESS(ret, "Failed to setup queue0");
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
- for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+ for (i = 0; i < (int)queue_count; i++) {
ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i);
}
ret = rte_event_dev_info_get(TEST_DEV_ID, &info);
TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info");
- TEST_ASSERT_EQUAL(rte_event_queue_count(TEST_DEV_ID),
- info.max_event_queues, "Wrong queue count");
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+ TEST_ASSERT_EQUAL(queue_count, info.max_event_queues,
+ "Wrong queue count");
return TEST_SUCCESS;
}
ret = rte_event_dev_info_get(TEST_DEV_ID, &info);
TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info");
- for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+
+ for (i = 0; i < (int)queue_count; i++) {
ret = rte_event_queue_default_conf_get(TEST_DEV_ID, i,
&qconf);
TEST_ASSERT_SUCCESS(ret, "Failed to get queue%d def conf", i);
TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i);
}
- for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+ for (i = 0; i < (int)queue_count; i++) {
priority = rte_event_queue_priority(TEST_DEV_ID, i);
+
if (info.event_dev_cap & RTE_EVENT_DEV_CAP_QUEUE_QOS)
TEST_ASSERT_EQUAL(priority,
i % RTE_EVENT_DEV_PRIORITY_LOWEST,
ret = rte_event_port_default_conf_get(TEST_DEV_ID, 0, NULL);
TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
+ uint32_t port_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &port_count), "Port count get failed");
+
ret = rte_event_port_default_conf_get(TEST_DEV_ID,
- rte_event_port_count(TEST_DEV_ID) + 1, NULL);
+ port_count + 1, NULL);
TEST_ASSERT(ret == -EINVAL, "Expected -EINVAL, %d", ret);
- for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) {
+ for (i = 0; i < (int)port_count; i++) {
ret = rte_event_port_default_conf_get(TEST_DEV_ID, i,
&pconf);
TEST_ASSERT_SUCCESS(ret, "Failed to get port%d info", i);
ret = rte_event_port_setup(TEST_DEV_ID, 0, &pconf);
TEST_ASSERT_SUCCESS(ret, "Failed to setup port0");
+ uint32_t port_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &port_count), "Port count get failed");
- for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) {
+ for (i = 0; i < (int)port_count; i++) {
ret = rte_event_port_setup(TEST_DEV_ID, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
}
ret = rte_event_dev_info_get(TEST_DEV_ID, &info);
TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info");
- TEST_ASSERT_EQUAL(rte_event_port_count(TEST_DEV_ID),
- info.max_event_ports, "Wrong port count");
+ uint32_t port_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &port_count), "Port count get failed");
+ TEST_ASSERT_EQUAL(port_count, info.max_event_ports, "Wrong port count");
return TEST_SUCCESS;
}
ret = eventdev_configure_setup();
TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev");
- for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+ for (i = 0; i < (int)queue_count; i++) {
ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i);
}
- for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) {
+ uint32_t port_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &port_count), "Port count get failed");
+
+ for (i = 0; i < (int)port_count; i++) {
ret = rte_event_port_setup(TEST_DEV_ID, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
}
ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
- TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
- "Failed to link port, device %d", TEST_DEV_ID);
+ TEST_ASSERT(ret == (int)queue_count, "Failed to link port, device %d",
+ TEST_DEV_ID);
ret = rte_event_dev_start(TEST_DEV_ID);
TEST_ASSERT_SUCCESS(ret, "Failed to start device%d", TEST_DEV_ID);
ret = eventdev_configure_setup();
TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev");
- for (i = 0; i < rte_event_queue_count(TEST_DEV_ID); i++) {
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+ for (i = 0; i < (int)queue_count; i++) {
ret = rte_event_queue_setup(TEST_DEV_ID, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup queue%d", i);
}
- for (i = 0; i < rte_event_port_count(TEST_DEV_ID); i++) {
+ uint32_t port_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &port_count), "Port count get failed");
+
+ for (i = 0; i < (int)port_count; i++) {
ret = rte_event_port_setup(TEST_DEV_ID, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup port%d", i);
}
ret = rte_event_port_link(TEST_DEV_ID, 0, NULL, NULL, 0);
- TEST_ASSERT(ret == rte_event_queue_count(TEST_DEV_ID),
- "Failed to link port, device %d", TEST_DEV_ID);
+ TEST_ASSERT(ret == (int)queue_count, "Failed to link port, device %d",
+ TEST_DEV_ID);
ret = rte_event_dev_start(TEST_DEV_ID);
TEST_ASSERT_SUCCESS(ret, "Failed to start device%d", TEST_DEV_ID);
TEST_ASSERT(ret >= 0, "Failed to link with NULL device%d",
TEST_DEV_ID);
- nb_queues = rte_event_queue_count(TEST_DEV_ID);
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+ nb_queues = queue_count;
for (i = 0; i < nb_queues; i++) {
queues[i] = i;
priorities[i] = RTE_EVENT_DEV_PRIORITY_NORMAL;
TEST_ASSERT(ret >= 0, "Failed to unlink with NULL device%d",
TEST_DEV_ID);
- nb_queues = rte_event_queue_count(TEST_DEV_ID);
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+ nb_queues = queue_count;
for (i = 0; i < nb_queues; i++)
queues[i] = i;
static int
test_eventdev_link_get(void)
{
- int ret, nb_queues, i;
+ int ret, i;
uint8_t queues[RTE_EVENT_MAX_QUEUES_PER_DEV];
uint8_t priorities[RTE_EVENT_MAX_QUEUES_PER_DEV];
TEST_ASSERT(ret >= 0, "Failed to link with NULL device%d",
TEST_DEV_ID);
- nb_queues = rte_event_queue_count(TEST_DEV_ID);
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(TEST_DEV_ID,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT, &queue_count),
+ "Queue count get failed");
+ const int nb_queues = queue_count;
for (i = 0; i < nb_queues; i++)
queues[i] = i;
TEST_ASSERT(ret == 0, "(%d)Wrong link get=%d", TEST_DEV_ID, ret);
/* link all queues and get the links */
- nb_queues = rte_event_queue_count(TEST_DEV_ID);
for (i = 0; i < nb_queues; i++) {
queues[i] = i;
priorities[i] = RTE_EVENT_DEV_PRIORITY_NORMAL;
ret = rte_event_port_unlink(TEST_DEV_ID, 0, NULL, 0);
TEST_ASSERT(ret == nb_queues, "Failed to unlink(device%d) ret=%d",
TEST_DEV_ID, ret);
+
/* 4links and 2 unlinks */
- nb_queues = rte_event_queue_count(TEST_DEV_ID);
if (nb_queues >= 4) {
for (i = 0; i < 4; i++) {
queues[i] = i;
ret = rte_event_dev_configure(evdev, &dev_conf);
TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev");
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+
if (mode == TEST_EVENTDEV_SETUP_PRIORITY) {
- if (rte_event_queue_count(evdev) > 8) {
+ if (queue_count > 8) {
printf("test expects the unique priority per queue\n");
return -ENOTSUP;
}
* RTE_EVENT_DEV_PRIORITY_LOWEST
*/
uint8_t step = (RTE_EVENT_DEV_PRIORITY_LOWEST + 1) /
- rte_event_queue_count(evdev);
- for (i = 0; i < rte_event_queue_count(evdev); i++) {
+ queue_count;
+ for (i = 0; i < (int)queue_count; i++) {
struct rte_event_queue_conf queue_conf;
ret = rte_event_queue_default_conf_get(evdev, i,
} else {
/* Configure event queues with default priority */
- for (i = 0; i < rte_event_queue_count(evdev); i++) {
+ for (i = 0; i < (int)queue_count; i++) {
ret = rte_event_queue_setup(evdev, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%d", i);
}
}
/* Configure event ports */
- for (i = 0; i < rte_event_port_count(evdev); i++) {
+ uint32_t port_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &port_count), "Port count get failed");
+ for (i = 0; i < (int)port_count; i++) {
ret = rte_event_port_setup(evdev, i, NULL);
TEST_ASSERT_SUCCESS(ret, "Failed to setup port=%d", i);
ret = rte_event_port_link(evdev, i, NULL, NULL, 0);
unsigned int i;
int ret;
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+
ret = rte_event_dev_info_get(evdev, &info);
TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info");
for (i = 0; i < total_events; i++) {
rte_rand() % (RTE_EVENT_TYPE_CPU + 1) /* event_type */,
rte_rand() % 256 /* sub_event_type */,
rte_rand() % (RTE_SCHED_TYPE_PARALLEL + 1),
- rte_rand() % rte_event_queue_count(evdev) /* queue */,
+ rte_rand() % queue_count /* queue */,
0 /* port */,
1 /* events */);
if (ret)
}
/*
- * Inject 0..MAX_EVENTS events over 0..rte_event_queue_count() with modulus
+ * Inject 0..MAX_EVENTS events over 0..queue_count with modulus
* operation
*
* For example, Inject 32 events over 0..7 queues
static int
validate_queue_priority(uint32_t index, uint8_t port, struct rte_event *ev)
{
- uint32_t range = MAX_EVENTS / rte_event_queue_count(evdev);
- uint32_t expected_val = (index % range) * rte_event_queue_count(evdev);
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+ uint32_t range = MAX_EVENTS / queue_count;
+ uint32_t expected_val = (index % range) * queue_count;
expected_val += ev->queue_id;
RTE_SET_USED(port);
TEST_ASSERT_EQUAL(ev->mbuf->seqn, expected_val,
"seqn=%d index=%d expected=%d range=%d nb_queues=%d max_event=%d",
ev->mbuf->seqn, index, expected_val, range,
- rte_event_queue_count(evdev), MAX_EVENTS);
+ queue_count, MAX_EVENTS);
return 0;
}
int i, max_evts_roundoff;
/* See validate_queue_priority() comments for priority validate logic */
- max_evts_roundoff = MAX_EVENTS / rte_event_queue_count(evdev);
- max_evts_roundoff *= rte_event_queue_count(evdev);
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+ max_evts_roundoff = MAX_EVENTS / queue_count;
+ max_evts_roundoff *= queue_count;
for (i = 0; i < max_evts_roundoff; i++) {
struct rte_event ev = {.event = 0, .u64 = 0};
TEST_ASSERT_NOT_NULL(m, "mempool alloc failed");
m->seqn = i;
- queue = i % rte_event_queue_count(evdev);
+ queue = i % queue_count;
update_event_and_validation_attr(m, &ev, 0, RTE_EVENT_TYPE_CPU,
0, RTE_SCHED_TYPE_PARALLEL, queue, 0);
rte_event_enqueue_burst(evdev, 0, &ev, 1);
test_multi_queue_enq_multi_port_deq(void)
{
const unsigned int total_events = MAX_EVENTS;
- uint8_t nr_ports;
+ uint32_t nr_ports;
int ret;
ret = generate_random_events(total_events);
if (ret)
return TEST_FAILED;
- nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1);
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &nr_ports), "Port count get failed");
+ nr_ports = RTE_MIN(nr_ports, rte_lcore_count() - 1);
if (!nr_ports) {
printf("%s: Not enough ports=%d or workers=%d\n", __func__,
- rte_event_port_count(evdev), rte_lcore_count() - 1);
+ nr_ports, rte_lcore_count() - 1);
return TEST_SUCCESS;
}
{
int i, nr_links, ret;
+ uint32_t port_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &port_count), "Port count get failed");
+
/* Unlink all connections that created in eventdev_setup */
- for (i = 0; i < rte_event_port_count(evdev); i++) {
+ for (i = 0; i < (int)port_count; i++) {
ret = rte_event_port_unlink(evdev, i, NULL, 0);
TEST_ASSERT(ret >= 0, "Failed to unlink all queues port=%d", i);
}
- nr_links = RTE_MIN(rte_event_port_count(evdev),
- rte_event_queue_count(evdev));
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+
+ nr_links = RTE_MIN(port_count, queue_count);
const unsigned int total_events = MAX_EVENTS / nr_links;
/* Link queue x to port x and inject events to queue x through port x */
test_queue_to_port_multi_link(void)
{
int ret, port0_events = 0, port1_events = 0;
- uint8_t nr_queues, nr_ports, queue, port;
+ uint8_t queue, port;
+ uint32_t nr_queues = 0;
+ uint32_t nr_ports = 0;
+
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &nr_queues), "Queue count get failed");
- nr_queues = rte_event_queue_count(evdev);
- nr_ports = rte_event_port_count(evdev);
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &nr_queues), "Queue count get failed");
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &nr_ports), "Port count get failed");
if (nr_ports < 2) {
printf("%s: Not enough ports to test ports=%d\n",
uint8_t out_sched_type)
{
const unsigned int total_events = MAX_EVENTS;
- uint8_t nr_ports;
+ uint32_t nr_ports;
int ret;
- nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1);
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &nr_ports), "Port count get failed");
+ nr_ports = RTE_MIN(nr_ports, rte_lcore_count() - 1);
if (!nr_ports) {
printf("%s: Not enough ports=%d or workers=%d\n", __func__,
- rte_event_port_count(evdev), rte_lcore_count() - 1);
+ nr_ports, rte_lcore_count() - 1);
return TEST_SUCCESS;
}
uint8_t out_sched_type)
{
const unsigned int total_events = MAX_EVENTS;
- uint8_t nr_ports;
+ uint32_t nr_ports;
int ret;
- nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1);
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &nr_ports), "Port count get failed");
+
+ nr_ports = RTE_MIN(nr_ports, rte_lcore_count() - 1);
- if (rte_event_queue_count(evdev) < 2 || !nr_ports) {
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+ if (queue_count < 2 || !nr_ports) {
printf("%s: Not enough queues=%d ports=%d or workers=%d\n",
- __func__, rte_event_queue_count(evdev),
- rte_event_port_count(evdev), rte_lcore_count() - 1);
+ __func__, queue_count, nr_ports,
+ rte_lcore_count() - 1);
return TEST_SUCCESS;
}
static int
launch_multi_port_max_stages_random_sched_type(int (*fn)(void *))
{
- uint8_t nr_ports;
+ uint32_t nr_ports;
int ret;
- nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1);
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &nr_ports), "Port count get failed");
+ nr_ports = RTE_MIN(nr_ports, rte_lcore_count() - 1);
if (!nr_ports) {
printf("%s: Not enough ports=%d or workers=%d\n", __func__,
- rte_event_port_count(evdev), rte_lcore_count() - 1);
+ nr_ports, rte_lcore_count() - 1);
return TEST_SUCCESS;
}
struct rte_event ev;
uint16_t valid_event;
uint8_t port = param->port;
- uint8_t nr_queues = rte_event_queue_count(evdev);
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+ uint8_t nr_queues = queue_count;
rte_atomic32_t *total_events = param->total_events;
while (rte_atomic32_read(total_events) > 0) {
struct rte_event ev;
uint16_t valid_event;
uint8_t port = param->port;
- uint8_t nr_queues = rte_event_queue_count(evdev);
+ uint32_t queue_count;
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_QUEUE_COUNT,
+ &queue_count), "Queue count get failed");
+ uint8_t nr_queues = queue_count;
rte_atomic32_t *total_events = param->total_events;
while (rte_atomic32_read(total_events) > 0) {
static inline int
test_producer_consumer_ingress_order_test(int (*fn)(void *))
{
- uint8_t nr_ports;
+ uint32_t nr_ports;
- nr_ports = RTE_MIN(rte_event_port_count(evdev), rte_lcore_count() - 1);
+ TEST_ASSERT_SUCCESS(rte_event_dev_attr_get(evdev,
+ RTE_EVENT_DEV_ATTR_PORT_COUNT,
+ &nr_ports), "Port count get failed");
+ nr_ports = RTE_MIN(nr_ports, rte_lcore_count() - 1);
if (rte_lcore_count() < 3 || nr_ports < 2) {
printf("### Not enough cores for %s test.\n", __func__);