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/bnxt: fix null dereference in session cleanup
[dpdk.git]
/
app
/
pdump
/
main.c
diff --git
a/app/pdump/main.c
b/app/pdump/main.c
index
63bbe65
..
c6cf9d9
100644
(file)
--- a/
app/pdump/main.c
+++ b/
app/pdump/main.c
@@
-502,14
+502,12
@@
cleanup_rings(void)
for (i = 0; i < num_tuples; i++) {
pt = &pdump_t[i];
for (i = 0; i < num_tuples; i++) {
pt = &pdump_t[i];
- if (pt->device_id)
- free(pt->device_id);
+ free(pt->device_id);
/* free the rings */
/* free the rings */
- if (pt->rx_ring)
- rte_ring_free(pt->rx_ring);
- if (pt->tx_ring)
- rte_ring_free(pt->tx_ring);
+ rte_ring_free(pt->rx_ring);
+ rte_ring_free(pt->tx_ring);
+ rte_mempool_free(pt->mp);
}
}
}
}
@@
-612,10
+610,7
@@
configure_vdev(uint16_t port_id)
printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
- port_id,
- addr.addr_bytes[0], addr.addr_bytes[1],
- addr.addr_bytes[2], addr.addr_bytes[3],
- addr.addr_bytes[4], addr.addr_bytes[5]);
+ port_id, RTE_ETHER_ADDR_BYTES(&addr));
ret = rte_eth_promiscuous_enable(port_id);
if (ret != 0) {
ret = rte_eth_promiscuous_enable(port_id);
if (ret != 0) {
@@
-906,11
+901,21
@@
dump_packets_core(void *arg)
return 0;
}
return 0;
}
+static unsigned int
+get_next_core(unsigned int lcore)
+{
+ lcore = rte_get_next_lcore(lcore, 1, 0);
+ if (lcore == RTE_MAX_LCORE)
+ rte_exit(EXIT_FAILURE,
+ "Max core limit %u reached for packet capture", lcore);
+ return lcore;
+}
+
static inline void
dump_packets(void)
{
int i;
static inline void
dump_packets(void)
{
int i;
- u
int32_
t lcore_id = 0;
+ u
nsigned in
t lcore_id = 0;
if (!multiple_core_capture) {
printf(" core (%u), capture for (%d) tuples\n",
if (!multiple_core_capture) {
printf(" core (%u), capture for (%d) tuples\n",
@@
-936,12
+941,12
@@
dump_packets(void)
return;
}
return;
}
- lcore_id =
rte_get_next_lcore(lcore_id, 1, 0
);
+ lcore_id =
get_next_core(lcore_id
);
for (i = 0; i < num_tuples; i++) {
rte_eal_remote_launch(dump_packets_core,
&pdump_t[i], lcore_id);
for (i = 0; i < num_tuples; i++) {
rte_eal_remote_launch(dump_packets_core,
&pdump_t[i], lcore_id);
- lcore_id =
rte_get_next_lcore(lcore_id, 1, 0
);
+ lcore_id =
get_next_core(lcore_id
);
if (rte_eal_wait_lcore(lcore_id) < 0)
rte_exit(EXIT_FAILURE, "failed to wait\n");
if (rte_eal_wait_lcore(lcore_id) < 0)
rte_exit(EXIT_FAILURE, "failed to wait\n");