diff options
author | David Marchand <david.marchand@redhat.com> | 2022-08-25 12:25:24 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2022-11-30 13:58:15 +0100 |
commit | 0937209fc7aca1107bb3f77cf1585799a086d065 (patch) | |
tree | 6c43905e85fe5de6f180f8e0e38bc7eec117c9a2 | |
parent | 22413fe8a83cc4e153fc35defc6f01f7dc5a21b5 (diff) | |
download | openvswitch-0937209fc7aca1107bb3f77cf1585799a086d065.tar.gz |
netdev-dpdk: Cleanup code when DPDK is disabled.
Remove one unused stub: netdev_dpdk_register() can't be called if DPDK
is disabled at build time.
Remove unneeded #ifdef in call to free_dpdk_buf.
Drop unneeded cast when calling free_dpdk_buf.
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | lib/dp-packet.c | 6 | ||||
-rw-r--r-- | lib/dp-packet.h | 4 | ||||
-rw-r--r-- | lib/netdev-dpdk.h | 5 |
3 files changed, 2 insertions, 13 deletions
diff --git a/lib/dp-packet.c b/lib/dp-packet.c index 4538d2a61..61e405460 100644 --- a/lib/dp-packet.c +++ b/lib/dp-packet.c @@ -134,11 +134,7 @@ dp_packet_uninit(struct dp_packet *b) if (b->source == DPBUF_MALLOC) { free(dp_packet_base(b)); } else if (b->source == DPBUF_DPDK) { -#ifdef DPDK_NETDEV - /* If this dp_packet was allocated by DPDK it must have been - * created as a dp_packet */ - free_dpdk_buf((struct dp_packet*) b); -#endif + free_dpdk_buf(b); } else if (b->source == DPBUF_AFXDP) { free_afxdp_buf(b); } diff --git a/lib/dp-packet.h b/lib/dp-packet.h index 55eeaab2c..a8ea5b40f 100644 --- a/lib/dp-packet.h +++ b/lib/dp-packet.h @@ -247,9 +247,7 @@ dp_packet_delete(struct dp_packet *b) { if (b) { if (b->source == DPBUF_DPDK) { - /* If this dp_packet was allocated by DPDK it must have been - * created as a dp_packet */ - free_dpdk_buf((struct dp_packet*) b); + free_dpdk_buf(b); return; } diff --git a/lib/netdev-dpdk.h b/lib/netdev-dpdk.h index 7d2f64af2..5cd95d00f 100644 --- a/lib/netdev-dpdk.h +++ b/lib/netdev-dpdk.h @@ -151,11 +151,6 @@ netdev_dpdk_rte_flow_tunnel_item_release( #else static inline void -netdev_dpdk_register(const struct smap *ovs_other_config OVS_UNUSED) -{ - /* Nothing */ -} -static inline void free_dpdk_buf(struct dp_packet *buf OVS_UNUSED) { /* Nothing */ |