Skip to contentSkip to conversation

dmaengine: xgene-dma: Disable memcpy operation due to performance drop

PATCH Superseded Rameshwar Prasad Sahu 2 participants 3 messages Oct 8, 2015 dmaengine

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmaengine: xgene-dma: Disable memcpy operation due to performance drop

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/dma/xgene-dma.c +3 -0
index 8d57b1b..2998fcb 100644
@@ -154,6 +154,7 @@
 #define XGENE_DMA_MAX_XOR_SRC		5
 #define XGENE_DMA_16K_BUFFER_LEN_CODE	0x0
 #define XGENE_DMA_INVALID_LEN_CODE	0x7800000000000000ULL
+#undef XGENE_DMA_MEMCPY_ENABLE
 
 /* X-Gene DMA descriptor error codes */
 #define ERR_DESC_AXI			0x01
@@ -1707,7 +1708,9 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
 	dma_cap_zero(dma_dev->cap_mask);
 
 	/* Set DMA device capability */
+#ifdef XGENE_DMA_MEMCPY_ENABLE
 	dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
+#endif
 	dma_cap_set(DMA_SG, dma_dev->cap_mask);
 
 	/* Basically here, the X-Gene SoC DMA engine channel 0 supports XOR

--
1.8.2.1

#1 lore raw
Quoted 24 lines · On Thursday 08 October 2015 13:55:16 Rameshwar Prasad Sahu wrote:

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/dma/xgene-dma.c +1 -0
index 8d57b1b..2998fcb 100644
@@ -154,6 +154,7 @@
 #define XGENE_DMA_MAX_XOR_SRC          5
 #define XGENE_DMA_16K_BUFFER_LEN_CODE  0x0
 #define XGENE_DMA_INVALID_LEN_CODE     0x7800000000000000ULL
+#undef XGENE_DMA_MEMCPY_ENABLE
 
 /* X-Gene DMA descriptor error codes */
 #define ERR_DESC_AXI                   0x01

drivers/dma/xgene-dma.c static void xgene_dma_set_caps(struct xgene_dma_chan *chan, · line 1716

Quoted 9 lines
drivers/dma/xgene-dma.c +2 -0
@@ -1707,7 +1708,9 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
        dma_cap_zero(dma_dev->cap_mask);
 
        /* Set DMA device capability */
+#ifdef XGENE_DMA_MEMCPY_ENABLE
        dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
+#endif
        dma_cap_set(DMA_SG, dma_dev->cap_mask);
 
        /* Basically here, the X-Gene SoC DMA engine channel 0 supports XOR

I don't see what the #ifdef gains you here when the setting is hardcoded. Why not just remove that DMA_MEMCPY capability completely if you don't want to use it?

Arnd

#2 lore raw
Quoted 33 lines · Arnd Bergmann
Quoted 32 lines · On Thursday 08 October 2015 13:55:16 Rameshwar Prasad Sahu wrote:

The DMA engine supports memory copy, RAID5 XOR, RAID6 PQ, and other computations. But the bandwidth of the entire DMA engine is shared among all channels. This patch re-configures operations availability such that one can achieve maximum performance for XOR and PQ computation by removing the memory offload operations.

---
 drivers/dma/xgene-dma.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/dma/xgene-dma.c +3 -0
index 8d57b1b..2998fcb 100644
@@ -154,6 +154,7 @@
 #define XGENE_DMA_MAX_XOR_SRC          5
 #define XGENE_DMA_16K_BUFFER_LEN_CODE  0x0
 #define XGENE_DMA_INVALID_LEN_CODE     0x7800000000000000ULL
+#undef XGENE_DMA_MEMCPY_ENABLE
 
 /* X-Gene DMA descriptor error codes */
 #define ERR_DESC_AXI                   0x01
@@ -1707,7 +1708,9 @@ static void xgene_dma_set_caps(struct xgene_dma_chan *chan,
        dma_cap_zero(dma_dev->cap_mask);
 
        /* Set DMA device capability */
+#ifdef XGENE_DMA_MEMCPY_ENABLE
        dma_cap_set(DMA_MEMCPY, dma_dev->cap_mask);
+#endif
        dma_cap_set(DMA_SG, dma_dev->cap_mask);
 
Quoted 5 lines

drivers/dma/xgene-dma.c static void xgene_dma_set_caps(struct xgene_dma_chan *chan, · line 1716

Quoted 1 line
drivers/dma/xgene-dma.c +0 -0
        /* Basically here, the X-Gene SoC DMA engine channel 0 supports XOR

I don't see what the #ifdef gains you here when the setting is hardcoded. Why not just remove that DMA_MEMCPY capability completely if you don't want to use it?

Okay Arnd,

Quoted 6 lines

Arnd
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html