git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crypto/zuc: do not set default op status
[dpdk.git]
/
examples
/
eventdev_pipeline
/
main.c
diff --git
a/examples/eventdev_pipeline/main.c
b/examples/eventdev_pipeline/main.c
index
2422c18
..
b698e4c
100644
(file)
--- a/
examples/eventdev_pipeline/main.c
+++ b/
examples/eventdev_pipeline/main.c
@@
-285,7
+285,7
@@
port_init(uint8_t port, struct rte_mempool *mbuf_pool)
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txconf;
struct rte_eth_dev_info dev_info;
struct rte_eth_txconf txconf;
- if (
port >= rte_eth_dev_count(
))
+ if (
!rte_eth_dev_is_valid_port(port
))
return -1;
rte_eth_dev_info_get(port, &dev_info);
return -1;
rte_eth_dev_info_get(port, &dev_info);
@@
-339,10
+339,9
@@
port_init(uint8_t port, struct rte_mempool *mbuf_pool)
}
static int
}
static int
-init_ports(u
nsigned in
t num_ports)
+init_ports(u
int16_
t num_ports)
{
{
- uint8_t portid;
- unsigned int i;
+ uint16_t portid, i;
if (!cdata.num_mbuf)
cdata.num_mbuf = 16384 * num_ports;
if (!cdata.num_mbuf)
cdata.num_mbuf = 16384 * num_ports;
@@
-354,12
+353,12
@@
init_ports(unsigned int num_ports)
/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
rte_socket_id());
/* data_room_size */ RTE_MBUF_DEFAULT_BUF_SIZE,
rte_socket_id());
-
for (portid = 0; portid < num_ports; portid++
)
+
RTE_ETH_FOREACH_DEV(portid
)
if (port_init(portid, mp) != 0)
if (port_init(portid, mp) != 0)
- rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu
8
"\n",
+ rte_exit(EXIT_FAILURE, "Cannot init port %"PRIu
16
"\n",
portid);
portid);
-
for (i = 0; i < num_ports; i++
) {
+
RTE_ETH_FOREACH_DEV(i
) {
void *userdata = (void *)(uintptr_t) i;
fdata->tx_buf[i] =
rte_malloc(NULL, RTE_ETH_TX_BUFFER_SIZE(32), 0);
void *userdata = (void *)(uintptr_t) i;
fdata->tx_buf[i] =
rte_malloc(NULL, RTE_ETH_TX_BUFFER_SIZE(32), 0);
@@
-375,13
+374,13
@@
init_ports(unsigned int num_ports)
}
static void
}
static void
-do_capability_setup(uint
16_t nb_ethdev, uint
8_t eventdev_id)
+do_capability_setup(uint8_t eventdev_id)
{
{
-
in
t i;
+
uint16_
t i;
uint8_t mt_unsafe = 0;
uint8_t burst = 0;
uint8_t mt_unsafe = 0;
uint8_t burst = 0;
-
for (i = 0; i < nb_ethdev; i++
) {
+
RTE_ETH_FOREACH_DEV(i
) {
struct rte_eth_dev_info dev_info;
memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
struct rte_eth_dev_info dev_info;
memset(&dev_info, 0, sizeof(struct rte_eth_dev_info));
@@
-430,7
+429,7
@@
int
main(int argc, char **argv)
{
struct worker_data *worker_data;
main(int argc, char **argv)
{
struct worker_data *worker_data;
- u
nsigned in
t num_ports;
+ u
int16_
t num_ports;
int lcore_id;
int err;
int lcore_id;
int err;
@@
-452,7
+451,7
@@
main(int argc, char **argv)
/* Parse cli options*/
parse_app_args(argc, argv);
/* Parse cli options*/
parse_app_args(argc, argv);
- num_ports = rte_eth_dev_count();
+ num_ports = rte_eth_dev_count
_avail
();
if (num_ports == 0)
rte_panic("No ethernet ports found\n");
if (num_ports == 0)
rte_panic("No ethernet ports found\n");
@@
-483,7
+482,7
@@
main(int argc, char **argv)
fprintf(stderr, "Warning: More than one eventdev, using idx 0");
fprintf(stderr, "Warning: More than one eventdev, using idx 0");
- do_capability_setup(
num_ports,
0);
+ do_capability_setup(0);
fdata->cap.check_opt();
worker_data = rte_calloc(0, cdata.num_workers,
fdata->cap.check_opt();
worker_data = rte_calloc(0, cdata.num_workers,