diff options
-rw-r--r-- | lib/dp-packet.c | 4 | ||||
-rw-r--r-- | lib/dp-packet.h | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 61e405460..ae8ab5800 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -146,7 +146,11 @@ dp_packet_uninit(struct dp_packet *b) struct dp_packet * dp_packet_new(size_t size) { +#ifdef DPDK_NETDEV + struct dp_packet *b = xmalloc_cacheline(sizeof *b); +#else struct dp_packet *b = xmalloc(sizeof *b); +#endif dp_packet_init(b, size); return b; } diff --git a/lib/dp-packet.h b/lib/dp-packet.h index ed1e5b3f6..b3e6a5d10 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -257,7 +257,11 @@ dp_packet_delete(struct dp_packet *b) } dp_packet_uninit(b); +#ifdef DPDK_NETDEV + free_cacheline(b); +#else free(b); +#endif } } |