2022-09-20 06:07:57

by Sarath Babu Naidu Gaddam

[permalink] [raw]
Subject: [RFC V3 PATCH 0/8] Xilinx DMA enhancements and optimization

Some background about the patch series: Xilinx Axi Ethernet device driver
(xilinx_axienet_main.c) currently has axi-dma code inside it. The goal is
to refactor axiethernet driver and use existing AXI DMA driver using
DMAEngine API.

This patchset does feature addition and optimization to support axidma
integration with axiethernet network driver. Once axidma version is
accepted mcdma specific changes will be added in followup version.

Changes for V2:
- Use metadata API[1] for passing metadata from dma to netdev client.
- Read irq-delay from DT.
- Remove desc_callback_valid check.
- Addressed RFC v1 comments[2].
- Minor code refactoring.

Changes for V3:
- Add device_config support for passing any dma client data.
- Address RFC v2 comments.
- remove hardcoding for axidma_tx_segment.
- Below review comment is in pipeline. We are facing a race issue when
addressing it. we will fix it in the next version.
"chan->idle = true; in xilinx_dma_irq_handler() needs to be gated on
the active_list being empty".

Comments, suggestions are very welcome

Radhey Shyam Pandey (7):
dt-bindings: dmaengine: xilinx_dma: Add xlnx,axistream-connected
property
dt-bindings: dmaengine: xilinx_dma: Add xlnx,irq-delay property
dmaengine: xilinx_dma: Pass AXI4-Stream control words to dma client
dmaengine: xilinx_dma: Increase AXI DMA transaction segment count
dmaengine: xilinx_dma: Freeup active list based on descriptor
completion bit
dmaengine: xilinx_dma: Use tasklet_hi_schedule for timing critical
usecase
dmaengine: xilinx_dma: Program interrupt delay timeout

Sarath Babu Naidu Gaddam (1):
dmaengine: xilinx_dma: Add device_config support

.../bindings/dma/xilinx/xilinx_dma.txt | 4 +
drivers/dma/xilinx/xilinx_dma.c | 107 ++++++++++++++++--
include/linux/dma/xilinx_dma.h | 16 +++
3 files changed, 115 insertions(+), 12 deletions(-)

--
2.25.1


2022-09-20 06:45:36

by Sarath Babu Naidu Gaddam

[permalink] [raw]
Subject: [RFC V3 PATCH 6/8] dmaengine: xilinx_dma: Use tasklet_hi_schedule for timing critical usecase

From: Radhey Shyam Pandey <[email protected]>

Schedule tasklet with high priority to ensure that callback processing
is prioritized. It improves throughput for netdev dma clients.

Signed-off-by: Radhey Shyam Pandey <[email protected]>
Signed-off-by: Sarath Babu Naidu Gaddam <[email protected]>
---
Changes in V2 and V3:
- None
---
drivers/dma/xilinx/xilinx_dma.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index 1488cc6a299a..8126a56980f2 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1848,7 +1848,7 @@ static irqreturn_t xilinx_mcdma_irq_handler(int irq, void *data)
spin_unlock(&chan->lock);
}

- tasklet_schedule(&chan->tasklet);
+ tasklet_hi_schedule(&chan->tasklet);
return IRQ_HANDLED;
}

--
2.25.1

2022-09-20 11:42:21

by Vinod Koul

[permalink] [raw]
Subject: Re: [RFC V3 PATCH 0/8] Xilinx DMA enhancements and optimization

On 20-09-22, 11:21, Sarath Babu Naidu Gaddam wrote:
> Some background about the patch series: Xilinx Axi Ethernet device driver
> (xilinx_axienet_main.c) currently has axi-dma code inside it. The goal is
> to refactor axiethernet driver and use existing AXI DMA driver using
> DMAEngine API.
>
> This patchset does feature addition and optimization to support axidma
> integration with axiethernet network driver. Once axidma version is
> accepted mcdma specific changes will be added in followup version.

why is this tagged RFC? Is it not ready for merge?

>
> Changes for V2:
> - Use metadata API[1] for passing metadata from dma to netdev client.
> - Read irq-delay from DT.
> - Remove desc_callback_valid check.
> - Addressed RFC v1 comments[2].
> - Minor code refactoring.
>
> Changes for V3:
> - Add device_config support for passing any dma client data.
> - Address RFC v2 comments.
> - remove hardcoding for axidma_tx_segment.
> - Below review comment is in pipeline. We are facing a race issue when
> addressing it. we will fix it in the next version.
> "chan->idle = true; in xilinx_dma_irq_handler() needs to be gated on
> the active_list being empty".
>
> Comments, suggestions are very welcome
>
> Radhey Shyam Pandey (7):
> dt-bindings: dmaengine: xilinx_dma: Add xlnx,axistream-connected
> property
> dt-bindings: dmaengine: xilinx_dma: Add xlnx,irq-delay property
> dmaengine: xilinx_dma: Pass AXI4-Stream control words to dma client
> dmaengine: xilinx_dma: Increase AXI DMA transaction segment count
> dmaengine: xilinx_dma: Freeup active list based on descriptor
> completion bit
> dmaengine: xilinx_dma: Use tasklet_hi_schedule for timing critical
> usecase
> dmaengine: xilinx_dma: Program interrupt delay timeout
>
> Sarath Babu Naidu Gaddam (1):
> dmaengine: xilinx_dma: Add device_config support
>
> .../bindings/dma/xilinx/xilinx_dma.txt | 4 +
> drivers/dma/xilinx/xilinx_dma.c | 107 ++++++++++++++++--
> include/linux/dma/xilinx_dma.h | 16 +++
> 3 files changed, 115 insertions(+), 12 deletions(-)
>
> --
> 2.25.1

--
~Vinod

2022-09-20 12:48:35

by Pandey, Radhey Shyam

[permalink] [raw]
Subject: RE: [RFC V3 PATCH 0/8] Xilinx DMA enhancements and optimization

> -----Original Message-----
> From: Vinod Koul <[email protected]>
> Sent: Tuesday, September 20, 2022 4:57 PM
> To: Gaddam, Sarath Babu Naidu <[email protected]>
> Cc: [email protected]; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; linux-
> [email protected]; Simek, Michal <[email protected]>; Pandey,
> Radhey Shyam <[email protected]>; Sarangi, Anirudha
> <[email protected]>; Katakam, Harini
> <[email protected]>; [email protected]; git (AMD-Xilinx)
> <[email protected]>
> Subject: Re: [RFC V3 PATCH 0/8] Xilinx DMA enhancements and optimization
>
> On 20-09-22, 11:21, Sarath Babu Naidu Gaddam wrote:
> > Some background about the patch series: Xilinx Axi Ethernet device
> > driver
> > (xilinx_axienet_main.c) currently has axi-dma code inside it. The goal
> > is to refactor axiethernet driver and use existing AXI DMA driver
> > using DMAEngine API.
> >
> > This patchset does feature addition and optimization to support axidma
> > integration with axiethernet network driver. Once axidma version is
> > accepted mcdma specific changes will be added in followup version.
>
> why is this tagged RFC? Is it not ready for merge?

To recap - In v3, the new addition is "[PATCH 8/8] dmaengine:
xilinx_dma: Add device_config support" along with addressing
RFC v2 comment.

8/8 is initial proposal on how to implement coalesce feature in
dmaengine driver to support ethernet usecases. Thought was
that it's better to have this idea reviewed as RFC before
extending the logic for other IP variants and spin sanity test
all usecases.

Fallback option is to split this series and send patches which are
already reviewed in RFC v2 as PATCH and only 8/8 (which need
more discussion/framework extension) as RFC?
Let me know your thoughts.

Thanks,
Radhey
>
> >
> > Changes for V2:
> > - Use metadata API[1] for passing metadata from dma to netdev client.
> > - Read irq-delay from DT.
> > - Remove desc_callback_valid check.
> > - Addressed RFC v1 comments[2].
> > - Minor code refactoring.
> >
> > Changes for V3:
> > - Add device_config support for passing any dma client data.
> > - Address RFC v2 comments.
> > - remove hardcoding for axidma_tx_segment.
> > - Below review comment is in pipeline. We are facing a race issue when
> > addressing it. we will fix it in the next version.
> > "chan->idle = true; in xilinx_dma_irq_handler() needs to be gated on
> > the active_list being empty".
> >
> > Comments, suggestions are very welcome
> >
> > Radhey Shyam Pandey (7):
> > dt-bindings: dmaengine: xilinx_dma: Add xlnx,axistream-connected
> > property
> > dt-bindings: dmaengine: xilinx_dma: Add xlnx,irq-delay property
> > dmaengine: xilinx_dma: Pass AXI4-Stream control words to dma client
> > dmaengine: xilinx_dma: Increase AXI DMA transaction segment count
> > dmaengine: xilinx_dma: Freeup active list based on descriptor
> > completion bit
> > dmaengine: xilinx_dma: Use tasklet_hi_schedule for timing critical
> > usecase
> > dmaengine: xilinx_dma: Program interrupt delay timeout
> >
> > Sarath Babu Naidu Gaddam (1):
> > dmaengine: xilinx_dma: Add device_config support
> >
> > .../bindings/dma/xilinx/xilinx_dma.txt | 4 +
> > drivers/dma/xilinx/xilinx_dma.c | 107 ++++++++++++++++--
> > include/linux/dma/xilinx_dma.h | 16 +++
> > 3 files changed, 115 insertions(+), 12 deletions(-)
> >
> > --
> > 2.25.1
>
> --
> ~Vinod