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
net/virtio: fix kernel set features for multi-queue device
[dpdk.git]
/
examples
/
ioat
/
ioatfwd.c
diff --git
a/examples/ioat/ioatfwd.c
b/examples/ioat/ioatfwd.c
index
8cf606e
..
2e377e2
100644
(file)
--- a/
examples/ioat/ioatfwd.c
+++ b/
examples/ioat/ioatfwd.c
@@
-447,12
+447,15
@@
ioat_tx_port(struct rxtx_port_config *tx_config)
for (i = 0; i < tx_config->nb_queues; i++) {
if (copy_mode == COPY_MODE_IOAT_NUM) {
for (i = 0; i < tx_config->nb_queues; i++) {
if (copy_mode == COPY_MODE_IOAT_NUM) {
- /* Deque the mbufs from IOAT device. */
+ /* Dequeue the mbufs from IOAT device. Since all memory
+ * is DPDK pinned memory and therefore all addresses should
+ * be valid, we don't check for copy errors
+ */
nb_dq = rte_ioat_completed_ops(
nb_dq = rte_ioat_completed_ops(
- tx_config->ioat_ids[i], MAX_PKT_BURST,
+ tx_config->ioat_ids[i], MAX_PKT_BURST,
NULL, NULL,
(void *)mbufs_src, (void *)mbufs_dst);
} else {
(void *)mbufs_src, (void *)mbufs_dst);
} else {
- /* Deque the mbufs from rx_to_tx_ring. */
+ /* Deque
ue
the mbufs from rx_to_tx_ring. */
nb_dq = rte_ring_dequeue_burst(
tx_config->rx_to_tx_ring, (void *)mbufs_dst,
MAX_PKT_BURST, NULL);
nb_dq = rte_ring_dequeue_burst(
tx_config->rx_to_tx_ring, (void *)mbufs_dst,
MAX_PKT_BURST, NULL);
@@
-516,7
+519,7
@@
tx_main_loop(void)
ioat_tx_port(&cfg.ports[i]);
}
ioat_tx_port(&cfg.ports[i]);
}
-/* Main rx and tx loop if only one
slave
lcore available */
+/* Main rx and tx loop if only one
worker
lcore available */
static void
rxtx_main_loop(void)
{
static void
rxtx_main_loop(void)
{
@@
-725,7
+728,10
@@
check_link_status(uint32_t port_mask)
static void
configure_rawdev_queue(uint32_t dev_id)
{
static void
configure_rawdev_queue(uint32_t dev_id)
{
- struct rte_ioat_rawdev_config dev_config = { .ring_size = ring_size };
+ struct rte_ioat_rawdev_config dev_config = {
+ .ring_size = ring_size,
+ .no_prefetch_completions = (cfg.nb_lcores > 1),
+ };
struct rte_rawdev_info info = { .dev_private = &dev_config };
if (rte_rawdev_configure(dev_id, &info, sizeof(dev_config)) != 0) {
struct rte_rawdev_info info = { .dev_private = &dev_config };
if (rte_rawdev_configure(dev_id, &info, sizeof(dev_config)) != 0) {
@@
-978,7
+984,7
@@
main(int argc, char **argv)
cfg.nb_lcores = rte_lcore_count() - 1;
if (cfg.nb_lcores < 1)
rte_exit(EXIT_FAILURE,
cfg.nb_lcores = rte_lcore_count() - 1;
if (cfg.nb_lcores < 1)
rte_exit(EXIT_FAILURE,
- "There should be at least one
slave
lcore.\n");
+ "There should be at least one
worker
lcore.\n");
if (copy_mode == COPY_MODE_IOAT_NUM)
assign_rawdevs();
if (copy_mode == COPY_MODE_IOAT_NUM)
assign_rawdevs();
@@
-986,7
+992,7
@@
main(int argc, char **argv)
assign_rings();
start_forwarding_cores();
assign_rings();
start_forwarding_cores();
- /* ma
ster
core prints stats while other cores forward */
+ /* ma
in
core prints stats while other cores forward */
print_stats(argv[0]);
/* force_quit is true when we get here */
print_stats(argv[0]);
/* force_quit is true when we get here */
@@
-995,7
+1001,11
@@
main(int argc, char **argv)
uint32_t j;
for (i = 0; i < cfg.nb_ports; i++) {
printf("Closing port %d\n", cfg.ports[i].rxtx_port);
uint32_t j;
for (i = 0; i < cfg.nb_ports; i++) {
printf("Closing port %d\n", cfg.ports[i].rxtx_port);
- rte_eth_dev_stop(cfg.ports[i].rxtx_port);
+ ret = rte_eth_dev_stop(cfg.ports[i].rxtx_port);
+ if (ret != 0)
+ RTE_LOG(ERR, IOAT, "rte_eth_dev_stop: err=%s, port=%u\n",
+ rte_strerror(-ret), cfg.ports[i].rxtx_port);
+
rte_eth_dev_close(cfg.ports[i].rxtx_port);
if (copy_mode == COPY_MODE_IOAT_NUM) {
for (j = 0; j < cfg.ports[i].nb_queues; j++) {
rte_eth_dev_close(cfg.ports[i].rxtx_port);
if (copy_mode == COPY_MODE_IOAT_NUM) {
for (j = 0; j < cfg.ports[i].nb_queues; j++) {
@@
-1007,6
+1017,9
@@
main(int argc, char **argv)
rte_ring_free(cfg.ports[i].rx_to_tx_ring);
}
rte_ring_free(cfg.ports[i].rx_to_tx_ring);
}
+ /* clean up the EAL */
+ rte_eal_cleanup();
+
printf("Bye...\n");
return 0;
}
printf("Bye...\n");
return 0;
}