diff --git a/lib/ff_dpdk_if.c b/lib/ff_dpdk_if.c index 882a6f846..47282c0e7 100644 --- a/lib/ff_dpdk_if.c +++ b/lib/ff_dpdk_if.c @@ -1150,7 +1150,7 @@ ff_veth_input(const struct ff_dpdk_if_context *ctx, struct rte_mbuf *pkt) data = rte_pktmbuf_mtod(pn, void*); len = rte_pktmbuf_data_len(pn); - void *mb = ff_mbuf_get(prev, data, len); + void *mb = ff_mbuf_get(prev, pn, data, len); if (mb == NULL) { ff_mbuf_free(hdr); rte_pktmbuf_free(pkt); @@ -1967,7 +1967,7 @@ ff_dpdk_run(loop_func_t loop, void *arg) { void ff_dpdk_pktmbuf_free(void *m) { - rte_pktmbuf_free((struct rte_mbuf *)m); + rte_pktmbuf_free_seg((struct rte_mbuf *)m); } static uint32_t diff --git a/lib/ff_veth.c b/lib/ff_veth.c index 11c9c1929..778dd4997 100644 --- a/lib/ff_veth.c +++ b/lib/ff_veth.c @@ -209,16 +209,16 @@ ff_mbuf_gethdr(void *pkt, uint16_t total, void *data, } void * -ff_mbuf_get(void *m, void *data, uint16_t len) +ff_mbuf_get(void *p, void *m, void *data, uint16_t len) { - struct mbuf *prev = (struct mbuf *)m; + struct mbuf *prev = (struct mbuf *)p; struct mbuf *mb = m_get(M_NOWAIT, MT_DATA); if (mb == NULL) { return NULL; } - m_extadd(mb, data, len, NULL, NULL, NULL, 0, 0); + m_extadd(mb, data, len, ff_mbuf_ext_free, m, NULL, 0, EXT_DISPOSABLE); mb->m_next = NULL; mb->m_nextpkt = NULL; diff --git a/lib/ff_veth.h b/lib/ff_veth.h index 14721ed15..713ec6d16 100644 --- a/lib/ff_veth.h +++ b/lib/ff_veth.h @@ -33,7 +33,7 @@ int ff_veth_detach(void *arg); void *ff_mbuf_gethdr(void *pkt, uint16_t total, void *data, uint16_t len, uint8_t rx_csum); -void *ff_mbuf_get(void *m, void *data, uint16_t len); +void *ff_mbuf_get(void *p, void *m, void *data, uint16_t len); void ff_mbuf_free(void *m); int ff_mbuf_copydata(void *m, void *data, int off, int len);