瀏覽代碼

net: ethernet: ti: am65-cpsw-nuss: fix dma mask

CPSW DMA (using UDMA) on AM65x can access full
48 bits of physical address space available on
AM65x platform.

Not setting the DMA mask correctly unnecessarily
forces use of SWIOTLB for allocations above 32-bit
boundary causing performance loss.

Using bi-directional iperf TCP test, performance
measured went up from ~720 Mbits/s to ~1210 Mbits/s
(68% jump).

Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Sekhar Nori 6 年之前
父節點
當前提交
c6cbcf674c
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      drivers/net/ethernet/ti/am65-cpsw-nuss.c

+ 6 - 0
drivers/net/ethernet/ti/am65-cpsw-nuss.c

@@ -2064,6 +2064,12 @@ static int am65_cpsw_nuss_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	ret = dma_coerce_mask_and_coherent(dev, DMA_BIT_MASK(48));
+	if (ret) {
+		dev_err(dev, "error setting dma mask: %d\n", ret);
+		goto unreg_ndev;
+	}
+
 	ret = devm_request_irq(dev, common->tx_chns[0].irq,
 			       am65_cpsw_nuss_tx_irq,
 			       0, dev_name(dev), common);