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
vfio: fix DMA mapping granularity for IOVA as VA
[dpdk.git]
/
examples
/
qos_meter
/
main.c
diff --git
a/examples/qos_meter/main.c
b/examples/qos_meter/main.c
index
431e84f
..
f2d9c28
100644
(file)
--- a/
examples/qos_meter/main.c
+++ b/
examples/qos_meter/main.c
@@
-54,7
+54,7
@@
static struct rte_mempool *pool = NULL;
static struct rte_eth_conf port_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_RSS,
static struct rte_eth_conf port_conf = {
.rxmode = {
.mq_mode = ETH_MQ_RX_RSS,
- .max_rx_pkt_len = ETHER_MAX_LEN,
+ .max_rx_pkt_len =
RTE_
ETHER_MAX_LEN,
.split_hdr_size = 0,
.offloads = DEV_RX_OFFLOAD_CHECKSUM,
},
.split_hdr_size = 0,
.offloads = DEV_RX_OFFLOAD_CHECKSUM,
},
@@
-156,7
+156,7
@@
app_pkt_handle(struct rte_mbuf *pkt, uint64_t time)
&PROFILE,
time,
pkt_len,
&PROFILE,
time,
pkt_len,
- (enum rte_
meter_
color) input_color);
+ (enum rte_color) input_color);
/* Apply policing and set the output color */
action = policer_table[input_color][output_color];
/* Apply policing and set the output color */
action = policer_table[input_color][output_color];
@@
-166,8
+166,8
@@
app_pkt_handle(struct rte_mbuf *pkt, uint64_t time)
}
}
-static __
attribute__((noreturn))
int
-main_loop(__
attribute__((unused))
void *dummy)
+static __
rte_noreturn
int
+main_loop(__
rte_unused
void *dummy)
{
uint64_t current_time, last_time = rte_rdtsc();
uint32_t lcore_id = rte_lcore_id();
{
uint64_t current_time, last_time = rte_rdtsc();
uint32_t lcore_id = rte_lcore_id();
@@
-220,10
+220,7
@@
parse_portmask(const char *portmask)
/* parse hexadecimal string */
pm = strtoul(portmask, &end, 16);
if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
/* parse hexadecimal string */
pm = strtoul(portmask, &end, 16);
if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0'))
- return -1;
-
- if (pm == 0)
- return -1;
+ return 0;
return pm;
}
return pm;
}
@@
-329,7
+326,13
@@
main(int argc, char **argv)
/* NIC init */
conf = port_conf;
/* NIC init */
conf = port_conf;
- rte_eth_dev_info_get(port_rx, &dev_info);
+
+ ret = rte_eth_dev_info_get(port_rx, &dev_info);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Error during getting device (port %u) info: %s\n",
+ port_rx, strerror(-ret));
+
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@
-369,7
+372,13
@@
main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret);
conf = port_conf;
rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret);
conf = port_conf;
- rte_eth_dev_info_get(port_tx, &dev_info);
+
+ ret = rte_eth_dev_info_get(port_tx, &dev_info);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Error during getting device (port %u) info: %s\n",
+ port_tx, strerror(-ret));
+
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
@@
-427,9
+436,17
@@
main(int argc, char **argv)
if (ret < 0)
rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
if (ret < 0)
rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret);
- rte_eth_promiscuous_enable(port_rx);
+ ret = rte_eth_promiscuous_enable(port_rx);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Port %d promiscuous mode enable error (%s)\n",
+ port_rx, rte_strerror(-ret));
- rte_eth_promiscuous_enable(port_tx);
+ ret = rte_eth_promiscuous_enable(port_tx);
+ if (ret != 0)
+ rte_exit(EXIT_FAILURE,
+ "Port %d promiscuous mode enable error (%s)\n",
+ port_rx, rte_strerror(-ret));
/* App configuration */
ret = app_configure_flow_table();
/* App configuration */
ret = app_configure_flow_table();
@@
-437,8
+454,8
@@
main(int argc, char **argv)
rte_exit(EXIT_FAILURE, "Invalid configure flow table\n");
/* Launch per-lcore init on every lcore */
rte_exit(EXIT_FAILURE, "Invalid configure flow table\n");
/* Launch per-lcore init on every lcore */
- rte_eal_mp_remote_launch(main_loop, NULL, CALL_MA
STER
);
- RTE_LCORE_FOREACH_
SLAVE
(lcore_id) {
+ rte_eal_mp_remote_launch(main_loop, NULL, CALL_MA
IN
);
+ RTE_LCORE_FOREACH_
WORKER
(lcore_id) {
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}
if (rte_eal_wait_lcore(lcore_id) < 0)
return -1;
}