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 incorrect cast of void *
[dpdk.git]
/
lib
/
librte_pdump
/
rte_pdump.c
diff --git
a/lib/librte_pdump/rte_pdump.c
b/lib/librte_pdump/rte_pdump.c
index
b599d65
..
0612632
100644
(file)
--- a/
lib/librte_pdump/rte_pdump.c
+++ b/
lib/librte_pdump/rte_pdump.c
@@
-46,7
+46,6
@@
#include <rte_lcore.h>
#include <rte_log.h>
#include <rte_errno.h>
#include <rte_lcore.h>
#include <rte_log.h>
#include <rte_errno.h>
-#include <rte_pci.h>
#include "rte_pdump.h"
#include "rte_pdump.h"
@@
-140,7
+139,7
@@
pdump_pktmbuf_copy(struct rte_mbuf *m, struct rte_mempool *mp)
{
struct rte_mbuf *m_dup, *seg, **prev;
uint32_t pktlen;
{
struct rte_mbuf *m_dup, *seg, **prev;
uint32_t pktlen;
- uint
8
_t nseg;
+ uint
16
_t nseg;
m_dup = rte_pktmbuf_alloc(mp);
if (unlikely(m_dup == NULL))
m_dup = rte_pktmbuf_alloc(mp);
if (unlikely(m_dup == NULL))
@@
-154,6
+153,8
@@
pdump_pktmbuf_copy(struct rte_mbuf *m, struct rte_mempool *mp)
do {
nseg++;
if (pdump_pktmbuf_copy_data(seg, m) < 0) {
do {
nseg++;
if (pdump_pktmbuf_copy_data(seg, m) < 0) {
+ if (seg != m_dup)
+ rte_pktmbuf_free_seg(seg);
rte_pktmbuf_free(m_dup);
return NULL;
}
rte_pktmbuf_free(m_dup);
return NULL;
}
@@
-208,7
+209,7
@@
pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
}
static uint16_t
}
static uint16_t
-pdump_rx(uint
8
_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_rx(uint
16
_t port __rte_unused, uint16_t qidx __rte_unused,
struct rte_mbuf **pkts, uint16_t nb_pkts,
uint16_t max_pkts __rte_unused,
void *user_params)
struct rte_mbuf **pkts, uint16_t nb_pkts,
uint16_t max_pkts __rte_unused,
void *user_params)
@@
-218,7
+219,7
@@
pdump_rx(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
}
static uint16_t
}
static uint16_t
-pdump_tx(uint
8
_t port __rte_unused, uint16_t qidx __rte_unused,
+pdump_tx(uint
16
_t port __rte_unused, uint16_t qidx __rte_unused,
struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
{
pdump_copy(pkts, nb_pkts, user_params);
struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)
{
pdump_copy(pkts, nb_pkts, user_params);
@@
-226,7
+227,7
@@
pdump_tx(uint8_t port __rte_unused, uint16_t qidx __rte_unused,
}
static int
}
static int
-pdump_regi
tser_rx_callbacks(uint16_t end_q, uint8
_t port, uint16_t queue,
+pdump_regi
ster_rx_callbacks(uint16_t end_q, uint16
_t port, uint16_t queue,
struct rte_ring *ring, struct rte_mempool *mp,
uint16_t operation)
{
struct rte_ring *ring, struct rte_mempool *mp,
uint16_t operation)
{
@@
-280,7
+281,7
@@
pdump_regitser_rx_callbacks(uint16_t end_q, uint8_t port, uint16_t queue,
}
static int
}
static int
-pdump_regi
tser_tx_callbacks(uint16_t end_q, uint8
_t port, uint16_t queue,
+pdump_regi
ster_tx_callbacks(uint16_t end_q, uint16
_t port, uint16_t queue,
struct rte_ring *ring, struct rte_mempool *mp,
uint16_t operation)
{
struct rte_ring *ring, struct rte_mempool *mp,
uint16_t operation)
{
@@
-338,7
+339,7
@@
static int
set_pdump_rxtx_cbs(struct pdump_request *p)
{
uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
set_pdump_rxtx_cbs(struct pdump_request *p)
{
uint16_t nb_rx_q = 0, nb_tx_q = 0, end_q, queue;
- uint
8
_t port;
+ uint
16
_t port;
int ret = 0;
uint32_t flags;
uint16_t operation;
int ret = 0;
uint32_t flags;
uint16_t operation;
@@
-352,7
+353,7
@@
set_pdump_rxtx_cbs(struct pdump_request *p)
&port);
if (ret < 0) {
RTE_LOG(ERR, PDUMP,
&port);
if (ret < 0) {
RTE_LOG(ERR, PDUMP,
- "failed to get po
t
id for device id=%s\n",
+ "failed to get po
rt
id for device id=%s\n",
p->data.en_v1.device);
return -EINVAL;
}
p->data.en_v1.device);
return -EINVAL;
}
@@
-364,7
+365,7
@@
set_pdump_rxtx_cbs(struct pdump_request *p)
&port);
if (ret < 0) {
RTE_LOG(ERR, PDUMP,
&port);
if (ret < 0) {
RTE_LOG(ERR, PDUMP,
- "failed to get po
t
id for device id=%s\n",
+ "failed to get po
rt
id for device id=%s\n",
p->data.dis_v1.device);
return -EINVAL;
}
p->data.dis_v1.device);
return -EINVAL;
}
@@
-401,7
+402,7
@@
set_pdump_rxtx_cbs(struct pdump_request *p)
/* register RX callback */
if (flags & RTE_PDUMP_FLAG_RX) {
end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
/* register RX callback */
if (flags & RTE_PDUMP_FLAG_RX) {
end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_rx_q : queue + 1;
- ret = pdump_regi
ts
er_rx_callbacks(end_q, port, queue, ring, mp,
+ ret = pdump_regi
st
er_rx_callbacks(end_q, port, queue, ring, mp,
operation);
if (ret < 0)
return ret;
operation);
if (ret < 0)
return ret;
@@
-410,7
+411,7
@@
set_pdump_rxtx_cbs(struct pdump_request *p)
/* register TX callback */
if (flags & RTE_PDUMP_FLAG_TX) {
end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
/* register TX callback */
if (flags & RTE_PDUMP_FLAG_TX) {
end_q = (queue == RTE_PDUMP_ALL_QUEUES) ? nb_tx_q : queue + 1;
- ret = pdump_regi
ts
er_tx_callbacks(end_q, port, queue, ring, mp,
+ ret = pdump_regi
st
er_tx_callbacks(end_q, port, queue, ring, mp,
operation);
if (ret < 0)
return ret;
operation);
if (ret < 0)
return ret;
@@
-576,20
+577,15
@@
rte_pdump_init(const char *path)
}
/* create the host thread to wait/handle pdump requests */
}
/* create the host thread to wait/handle pdump requests */
- ret = pthread_create(&pdump_thread, NULL, pdump_thread_main, NULL);
+ snprintf(thread_name, sizeof(thread_name), "pdump-thread");
+ ret = rte_ctrl_thread_create(&pdump_thread, thread_name, NULL,
+ pdump_thread_main, NULL);
if (ret != 0) {
RTE_LOG(ERR, PDUMP,
"Failed to create the pdump thread:%s, %s:%d\n",
if (ret != 0) {
RTE_LOG(ERR, PDUMP,
"Failed to create the pdump thread:%s, %s:%d\n",
- strerror(
errno
), __func__, __LINE__);
+ strerror(
-ret
), __func__, __LINE__);
return -1;
}
return -1;
}
- /* Set thread_name for aid in debugging. */
- snprintf(thread_name, RTE_MAX_THREAD_NAME_LEN, "pdump-thread");
- ret = rte_thread_setname(pdump_thread, thread_name);
- if (ret != 0) {
- RTE_LOG(DEBUG, PDUMP,
- "Failed to set thread name for pdump handling\n");
- }
return 0;
}
return 0;
}
@@
-603,7
+599,7
@@
rte_pdump_uninit(void)
if (ret != 0) {
RTE_LOG(ERR, PDUMP,
"Failed to cancel the pdump thread:%s, %s:%d\n",
if (ret != 0) {
RTE_LOG(ERR, PDUMP,
"Failed to cancel the pdump thread:%s, %s:%d\n",
- strerror(
errno
), __func__, __LINE__);
+ strerror(
ret
), __func__, __LINE__);
return -1;
}
return -1;
}
@@
-765,7
+761,7
@@
pdump_validate_flags(uint32_t flags)
}
static int
}
static int
-pdump_validate_port(uint
8
_t port, char *name)
+pdump_validate_port(uint
16
_t port, char *name)
{
int ret = 0;
{
int ret = 0;
@@
-829,7
+825,7
@@
pdump_prepare_client_request(char *device, uint16_t queue,
}
int
}
int
-rte_pdump_enable(uint
8
_t port, uint16_t queue, uint32_t flags,
+rte_pdump_enable(uint
16
_t port, uint16_t queue, uint32_t flags,
struct rte_ring *ring,
struct rte_mempool *mp,
void *filter)
struct rte_ring *ring,
struct rte_mempool *mp,
void *filter)
@@
-877,7
+873,7
@@
rte_pdump_enable_by_deviceid(char *device_id, uint16_t queue,
}
int
}
int
-rte_pdump_disable(uint
8
_t port, uint16_t queue, uint32_t flags)
+rte_pdump_disable(uint
16
_t port, uint16_t queue, uint32_t flags)
{
int ret = 0;
char name[DEVICE_ID_SIZE];
{
int ret = 0;
char name[DEVICE_ID_SIZE];