From 7a2574a8ca4bf378e876df40c6e8d290d53d5f7e Mon Sep 17 00:00:00 2001 From: Benoît Ganne Date: Mon, 31 Jan 2022 18:29:09 +0100 Subject: dpdk: remove dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rte_eth_tx_burst() returns the number of packets actually stored in transmit descriptors and the return type is uint16. n_sent cannot be negative and the if branch is dead code. Type: improvement Change-Id: Idc2980d342756c1093ddf74ea6207d072e819331 Signed-off-by: Benoît Ganne --- src/plugins/dpdk/device/device.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/plugins/dpdk/device/device.c b/src/plugins/dpdk/device/device.c index c9061a9949a..fa19f5c8457 100644 --- a/src/plugins/dpdk/device/device.c +++ b/src/plugins/dpdk/device/device.c @@ -25,7 +25,6 @@ #include #define foreach_dpdk_tx_func_error \ - _(BAD_RETVAL, "DPDK tx function returned an error") \ _(PKT_DROP, "Tx packet drops (dpdk tx failure)") typedef enum @@ -173,23 +172,10 @@ static_always_inline /* no wrap, transmit in one burst */ n_sent = rte_eth_tx_burst (xd->port_id, queue_id, mb, n_left); - n_retry--; clib_spinlock_unlock_if_init (&txq->lock); - if (PREDICT_FALSE (n_sent < 0)) - { - // emit non-fatal message, bump counter - vnet_main_t *vnm = vnet_get_main (); - vnet_interface_main_t *im = &vnm->interface_main; - u32 node_index; - - node_index = vec_elt_at_index (im->hw_interfaces, - xd->hw_if_index)->tx_node_index; - - vlib_error_count (vm, node_index, DPDK_TX_FUNC_ERROR_BAD_RETVAL, 1); - return n_left; // untransmitted packets - } + n_retry--; n_left -= n_sent; mb += n_sent; } -- cgit 1.2.3-korg