X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_pdump%2Frte_pdump.c;h=bc18f814a07eb956163614bd47e5b6153ac344cc;hb=421ca44ae2d25113a352ef8a49063655df352eb4;hp=e6182d35c5aa57411322786adfa6e06c8c1a3319;hpb=f8244c6399d9fae6afab6770ae367aef38742ea5;p=dpdk.git diff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c index e6182d35c5..bc18f814a0 100644 --- a/lib/librte_pdump/rte_pdump.c +++ b/lib/librte_pdump/rte_pdump.c @@ -139,7 +139,7 @@ pdump_pktmbuf_copy(struct rte_mbuf *m, struct rte_mempool *mp) { struct rte_mbuf *m_dup, *seg, **prev; uint32_t pktlen; - uint8_t nseg; + uint16_t nseg; m_dup = rte_pktmbuf_alloc(mp); if (unlikely(m_dup == NULL)) @@ -153,6 +153,8 @@ pdump_pktmbuf_copy(struct rte_mbuf *m, struct rte_mempool *mp) 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; } @@ -225,7 +227,7 @@ pdump_tx(uint16_t port __rte_unused, uint16_t qidx __rte_unused, } static int -pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, +pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -279,7 +281,7 @@ pdump_regitser_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, } static int -pdump_regitser_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, +pdump_register_tx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue, struct rte_ring *ring, struct rte_mempool *mp, uint16_t operation) { @@ -351,7 +353,7 @@ set_pdump_rxtx_cbs(struct pdump_request *p) &port); if (ret < 0) { RTE_LOG(ERR, PDUMP, - "failed to get potid for device id=%s\n", + "failed to get port id for device id=%s\n", p->data.en_v1.device); return -EINVAL; } @@ -363,7 +365,7 @@ set_pdump_rxtx_cbs(struct pdump_request *p) &port); if (ret < 0) { RTE_LOG(ERR, PDUMP, - "failed to get potid for device id=%s\n", + "failed to get port id for device id=%s\n", p->data.dis_v1.device); return -EINVAL; } @@ -400,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; - ret = pdump_regitser_rx_callbacks(end_q, port, queue, ring, mp, + ret = pdump_register_rx_callbacks(end_q, port, queue, ring, mp, operation); if (ret < 0) return ret; @@ -409,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; - ret = pdump_regitser_tx_callbacks(end_q, port, queue, ring, mp, + ret = pdump_register_tx_callbacks(end_q, port, queue, ring, mp, operation); if (ret < 0) return ret;