mbox series

[v2,0/5] PCI: functions/pci-epf-test: Add DMA data transfer

Message ID 20200303103752.13076-1-kishon@ti.com
Headers show
Series PCI: functions/pci-epf-test: Add DMA data transfer | expand

Message

Kishon Vijay Abraham I March 3, 2020, 10:37 a.m. UTC
Patch series uses dma engine APIs in pci-epf-test to transfer data using
DMA. It also adds an option "-d" in pcitest for the user to indicate
whether DMA has to be used for data transfer. This also prints
throughput information for data transfer.

Changes from v1:
*) Fixed some of the function names from pci_epf_* to pci_epf_test_*
since the DMA support is now been moved to pci-epf-test.c

Kishon Vijay Abraham I (5):
  PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer
    data
  PCI: endpoint: functions/pci-epf-test: Print throughput information
  misc: pci_endpoint_test: Use streaming DMA APIs for buffer allocation
  tools: PCI: Add 'd' command line option to support DMA
  misc: pci_endpoint_test: Add support to get DMA option from userspace

 drivers/misc/pci_endpoint_test.c              | 165 ++++++++++--
 drivers/pci/endpoint/functions/pci-epf-test.c | 253 +++++++++++++++++-
 include/uapi/linux/pcitest.h                  |   5 +
 tools/pci/pcitest.c                           |  20 +-
 4 files changed, 412 insertions(+), 31 deletions(-)

Comments

Alan Mikhak March 4, 2020, 5:27 p.m. UTC | #1
Hi Kishon,

I applied this v2 patch series to kernel.org linux 5.6-rc3 and
built for x86_64 Debian and riscv. I verified that when I execute
the pcitest command on the x86_64 host with -d flag, the riscv
endpoint performs the transfer by using an available dma channel.

Regards,
Alan

Tested-by: Alan Mikhak <alan.mikhak@sifive.com>
Lorenzo Pieralisi March 11, 2020, 11:04 a.m. UTC | #2
On Tue, Mar 03, 2020 at 04:07:47PM +0530, Kishon Vijay Abraham I wrote:
> Patch series uses dma engine APIs in pci-epf-test to transfer data using
> DMA. It also adds an option "-d" in pcitest for the user to indicate
> whether DMA has to be used for data transfer. This also prints
> throughput information for data transfer.
> 
> Changes from v1:
> *) Fixed some of the function names from pci_epf_* to pci_epf_test_*
> since the DMA support is now been moved to pci-epf-test.c
> 
> Kishon Vijay Abraham I (5):
>   PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer
>     data
>   PCI: endpoint: functions/pci-epf-test: Print throughput information
>   misc: pci_endpoint_test: Use streaming DMA APIs for buffer allocation
>   tools: PCI: Add 'd' command line option to support DMA
>   misc: pci_endpoint_test: Add support to get DMA option from userspace
> 
>  drivers/misc/pci_endpoint_test.c              | 165 ++++++++++--
>  drivers/pci/endpoint/functions/pci-epf-test.c | 253 +++++++++++++++++-
>  include/uapi/linux/pcitest.h                  |   5 +
>  tools/pci/pcitest.c                           |  20 +-
>  4 files changed, 412 insertions(+), 31 deletions(-)

Applied to pci/endpoint for v5.7, thanks.

Lorenzo
Kishon Vijay Abraham I March 13, 2020, 5:13 a.m. UTC | #3
Hi Alan,

On 04/03/20 10:57 pm, Alan Mikhak wrote:
> Hi Kishon,
> 
> I applied this v2 patch series to kernel.org linux 5.6-rc3 and
> built for x86_64 Debian and riscv. I verified that when I execute
> the pcitest command on the x86_64 host with -d flag, the riscv
> endpoint performs the transfer by using an available dma channel.

Stephen raised a build error issue [1] after including this series. Did
you also see a similar issue when you tried in x86_64?

[1] -> https://lkml.org/lkml/2020/3/12/1217

Thanks
Kishon

> 
> Regards,
> Alan
> 
> Tested-by: Alan Mikhak <alan.mikhak@sifive.com>
>
Alan Mikhak March 13, 2020, 4:23 p.m. UTC | #4
On Thu, Mar 12, 2020 at 10:24 PM Kishon Vijay Abraham I <kishon@ti.com> wrote:
>
> Hi Alan,
>
> On 04/03/20 10:57 pm, Alan Mikhak wrote:
> > Hi Kishon,
> >
> > I applied this v2 patch series to kernel.org linux 5.6-rc3 and
> > built for x86_64 Debian and riscv. I verified that when I execute
> > the pcitest command on the x86_64 host with -d flag, the riscv
> > endpoint performs the transfer by using an available dma channel.
>
> Stephen raised a build error issue [1] after including this series. Did
> you also see a similar issue when you tried in x86_64?

Hi Kishon,

I didn't see this error when I built pcitest with your dma patch for x86_64
on Ubuntu 16.04 (xenial) and Debian 9.9 (stretch). Same for riscv. The
following output is from my Ubuntu machine:

$ cd ~/src/kernel.org/linux
$ cd tools/pci
$ ls
Build  Makefile  pcitest.c  pcitest.sh
$ make
mkdir -p include/linux/ 2>&1 || true
ln -sf /home/sfnuc/src/kernel.org/linux/tools/pci/../../include/uapi/linux/pcitest.h
include/linux/
make -f /home/sfnuc/src/kernel.org/linux/tools/build/Makefile.build
dir=. obj=pcitest
make[1]: Entering directory '/home/sfnuc/src/kernel.org/linux/tools/pci'
  CC       pcitest.o
  LD       pcitest-in.o
make[1]: Leaving directory '/home/sfnuc/src/kernel.org/linux/tools/pci'
  LINK     pcitest
$ ls
Build  include  Makefile  pcitest  pcitest.c  pcitest-in.o  pcitest.o
pcitest.sh

Regards,
Alan

>
> [1] -> https://lkml.org/lkml/2020/3/12/1217
>
> Thanks
> Kishon
>
> >
> > Regards,
> > Alan
> >
> > Tested-by: Alan Mikhak <alan.mikhak@sifive.com>
> >
Lorenzo Pieralisi March 13, 2020, 4:56 p.m. UTC | #5
On Tue, Mar 03, 2020 at 04:07:47PM +0530, Kishon Vijay Abraham I wrote:
> Patch series uses dma engine APIs in pci-epf-test to transfer data using
> DMA. It also adds an option "-d" in pcitest for the user to indicate
> whether DMA has to be used for data transfer. This also prints
> throughput information for data transfer.
> 
> Changes from v1:
> *) Fixed some of the function names from pci_epf_* to pci_epf_test_*
> since the DMA support is now been moved to pci-epf-test.c
> 
> Kishon Vijay Abraham I (5):
>   PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer
>     data
>   PCI: endpoint: functions/pci-epf-test: Print throughput information
>   misc: pci_endpoint_test: Use streaming DMA APIs for buffer allocation
>   tools: PCI: Add 'd' command line option to support DMA
>   misc: pci_endpoint_test: Add support to get DMA option from userspace
> 
>  drivers/misc/pci_endpoint_test.c              | 165 ++++++++++--
>  drivers/pci/endpoint/functions/pci-epf-test.c | 253 +++++++++++++++++-
>  include/uapi/linux/pcitest.h                  |   5 +
>  tools/pci/pcitest.c                           |  20 +-
>  4 files changed, 412 insertions(+), 31 deletions(-)

Hi Kishon,

I had to drop this series - waiting for you to send an updated one
to fix the x86 build breakage - force pushed pci/endpoint out.

Thanks,
Lorenzo
Bjorn Helgaas March 13, 2020, 5:40 p.m. UTC | #6
On Fri, Mar 13, 2020 at 04:56:13PM +0000, Lorenzo Pieralisi wrote:
> On Tue, Mar 03, 2020 at 04:07:47PM +0530, Kishon Vijay Abraham I wrote:
> > Patch series uses dma engine APIs in pci-epf-test to transfer data using
> > DMA. It also adds an option "-d" in pcitest for the user to indicate
> > whether DMA has to be used for data transfer. This also prints
> > throughput information for data transfer.
> > 
> > Changes from v1:
> > *) Fixed some of the function names from pci_epf_* to pci_epf_test_*
> > since the DMA support is now been moved to pci-epf-test.c
> > 
> > Kishon Vijay Abraham I (5):
> >   PCI: endpoint: functions/pci-epf-test: Add DMA support to transfer
> >     data
> >   PCI: endpoint: functions/pci-epf-test: Print throughput information
> >   misc: pci_endpoint_test: Use streaming DMA APIs for buffer allocation
> >   tools: PCI: Add 'd' command line option to support DMA
> >   misc: pci_endpoint_test: Add support to get DMA option from userspace
> > 
> >  drivers/misc/pci_endpoint_test.c              | 165 ++++++++++--
> >  drivers/pci/endpoint/functions/pci-epf-test.c | 253 +++++++++++++++++-
> >  include/uapi/linux/pcitest.h                  |   5 +
> >  tools/pci/pcitest.c                           |  20 +-
> >  4 files changed, 412 insertions(+), 31 deletions(-)
> 
> Hi Kishon,
> 
> I had to drop this series - waiting for you to send an updated one
> to fix the x86 build breakage - force pushed pci/endpoint out.

I updated my "next" branch with this updated branch so we can at least
test the other things on the lorenzo/pci/endpoint branch.

The lorenzo/pci/mobiveil branch is also temporarily out completely for
a build issue.