diff mbox series

[ovs-dev,1/3] netdev-dpdk: Cleanup code when DPDK is disabled.

Message ID 20220825102526.340645-2-david.marchand@redhat.com
State Accepted
Commit 0937209fc7aca1107bb3f77cf1585799a086d065
Headers show
Series DPDK netdev code cleanup | expand

Checks

Context Check Description
ovsrobot/apply-robot success apply and check: success
ovsrobot/github-robot-_Build_and_Test success github build: passed

Commit Message

David Marchand Aug. 25, 2022, 10:25 a.m. UTC
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.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/dp-packet.c   | 6 +-----
 lib/dp-packet.h   | 4 +---
 lib/netdev-dpdk.h | 5 -----
 3 files changed, 2 insertions(+), 13 deletions(-)

Comments

Pai G, Sunil Sept. 21, 2022, 8:21 a.m. UTC | #1
> -----Original Message-----
> From: dev <ovs-dev-bounces@openvswitch.org> On Behalf Of David Marchand
> Sent: Thursday, August 25, 2022 3:55 PM
> To: dev@openvswitch.org
> Subject: [ovs-dev] [PATCH 1/3] 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.
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/dp-packet.c   | 6 +-----
>  lib/dp-packet.h   | 4 +---
>  lib/netdev-dpdk.h | 5 -----
>  3 files changed, 2 insertions(+), 13 deletions(-)
> 

Changes LGTM, 
Acked-by: Sunil Pai G <sunil.pai.g@intel.com>
diff mbox series

Patch

diff --git a/lib/dp-packet.c b/lib/dp-packet.c
index 4538d2a614..61e405460a 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 55eeaab2ce..a8ea5b40f7 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 7d2f64af23..5cd95d00f5 100644
--- a/lib/netdev-dpdk.h
+++ b/lib/netdev-dpdk.h
@@ -150,11 +150,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)
 {