diff mbox series

[v2,6/8] net/memif: remove extra check

Message ID 20200928190334.40624-6-honnappa.nagarahalli@arm.com
State New
Headers show
Series [v2,1/8] net/memif: do not update local copy of tail in tx function | expand

Commit Message

Honnappa Nagarahalli Sept. 28, 2020, 7:03 p.m. UTC
eth_memif_tx_zc function is called only for S2M rings. Remove
additional code for M2S rings in this function.

Signed-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>

Reviewed-by: Phil Yang <phil.yang@arm.com>

Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>

---
 drivers/net/memif/rte_eth_memif.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index 404c86ae8..9babd073a 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -735,7 +735,6 @@  eth_memif_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		rte_eth_devices[mq->in_port].process_private;
 	memif_ring_t *ring = memif_get_ring_from_queue(proc_private, mq);
 	uint16_t slot, n_free, ring_size, mask, n_tx_pkts = 0;
-	memif_ring_type_t type = mq->type;
 	struct rte_eth_link link;
 
 	if (unlikely((pmd->flags & ETH_MEMIF_FLAG_CONNECTED) == 0))
@@ -812,11 +811,8 @@  eth_memif_tx_zc(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	}
 
 no_free_slots:
-	/* update ring pointers */
-	if (type == MEMIF_RING_S2M)
-		__atomic_store_n(&ring->head, slot, __ATOMIC_RELEASE);
-	else
-		__atomic_store_n(&ring->tail, slot, __ATOMIC_RELEASE);
+	/* ring type always MEMIF_RING_S2M */
+	__atomic_store_n(&ring->head, slot, __ATOMIC_RELEASE);
 
 	/* Send interrupt, if enabled. */
 	if ((ring->flags & MEMIF_RING_FLAG_MASK_INT) == 0) {