diff mbox series

[net-next,3/4] ionic: simplify tx clean

Message ID 20210316023136.22702-4-snelson@pensando.io (mailing list archive)
State Accepted
Commit 19fef72cb4ba4c3c25bf89f4e73fdcefb9fd7bd2
Delegated to: Netdev Maintainers
Headers show
Series ionic Tx updates | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 5 of 5 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 42 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Shannon Nelson March 16, 2021, 2:31 a.m. UTC
The descriptor mappings are set up the same way whether
or not it is a TSO, so we don't need separate logic for
the two cases.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 .../net/ethernet/pensando/ionic/ionic_txrx.c  | 30 +++++--------------
 1 file changed, 7 insertions(+), 23 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
index 1d27d6cad504..f841ccb5adfd 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
+++ b/drivers/net/ethernet/pensando/ionic/ionic_txrx.c
@@ -654,35 +654,19 @@  static void ionic_tx_clean(struct ionic_queue *q,
 			   struct ionic_cq_info *cq_info,
 			   void *cb_arg)
 {
-	struct ionic_txq_sg_desc *sg_desc = desc_info->sg_desc;
 	struct ionic_buf_info *buf_info = desc_info->bufs;
-	struct ionic_txq_sg_elem *elem = sg_desc->elems;
 	struct ionic_tx_stats *stats = q_to_tx_stats(q);
-	struct ionic_txq_desc *desc = desc_info->desc;
 	struct device *dev = q->dev;
-	u8 opcode, flags, nsge;
 	u16 queue_index;
 	unsigned int i;
-	u64 addr;
-
-	decode_txq_desc_cmd(le64_to_cpu(desc->cmd),
-			    &opcode, &flags, &nsge, &addr);
 
-	if (opcode != IONIC_TXQ_DESC_OPCODE_TSO) {
-		dma_unmap_single(dev, (dma_addr_t)addr,
-				 le16_to_cpu(desc->len), DMA_TO_DEVICE);
-		for (i = 0; i < nsge; i++, elem++)
-			dma_unmap_page(dev, (dma_addr_t)le64_to_cpu(elem->addr),
-				       le16_to_cpu(elem->len), DMA_TO_DEVICE);
-	} else {
-		if (flags & IONIC_TXQ_DESC_FLAG_TSO_EOT) {
-			dma_unmap_single(dev, (dma_addr_t)buf_info->dma_addr,
-					 buf_info->len, DMA_TO_DEVICE);
-			buf_info++;
-			for (i = 1; i < desc_info->nbufs; i++, buf_info++)
-				dma_unmap_page(dev, (dma_addr_t)buf_info->dma_addr,
-					       buf_info->len, DMA_TO_DEVICE);
-		}
+	if (desc_info->nbufs) {
+		dma_unmap_single(dev, (dma_addr_t)buf_info->dma_addr,
+				 buf_info->len, DMA_TO_DEVICE);
+		buf_info++;
+		for (i = 1; i < desc_info->nbufs; i++, buf_info++)
+			dma_unmap_page(dev, (dma_addr_t)buf_info->dma_addr,
+				       buf_info->len, DMA_TO_DEVICE);
 	}
 
 	if (cb_arg) {