Re: PCI lib for 2.4 //kwds: pci, dma, mapping memory, kernel vs. user-space.

From: Peter Chubb (peter_at_chubb.wattle.id.au)
Date: 12/17/03

  • Next message: RunNHide: "Re: Initio SCSI Drivers"
    Date:	Wed, 17 Dec 2003 10:53:02 +1100
    To: Damien Couroussé <damien.courousse@imag.fr>
    
    

    >>>>> "Damien" == Damien Courouss <Damien> writes:

    Damien> Hi Martin, Thanks for your answer.

    Damien> I did not yet understand why I find two differents pci.h
    Damien> files, and why I cannot use one of them (since my compiler
    Damien> can't link with the lib)... Is there a specific way of using
    Damien> the second one, which I did not understand?

    /usr/include/pci/XXX.h are the header files to use with libpci.a
    They are *all* you can use for a user-space driver.

    /usr/include/linux and /usr/include/asm are copies from the kernel,
    and should not be used directly in user code --- they document
    internal kernel interfaces that are not accessible from user space.

    You should be able to do high speed data streaming from user space --
    we have a user-mode gigabit ethernet driver here that achieves
    ~700Mb/s for reasonable sized packets --- but latency may be a killer.
    I'm measuring 10 microseconds from a PCI board asserting an interrupt
    line until a driver can acknowledge it from user space; only a little lower
    for a kernel driver. (That seems about the same on P4 at 2.5GHz and
    IA64 at 900MHz, BTW, so I suspect there are hardware-imposed delays
    --- to acknowledge the interrupt, the driver has to do one inw and one
    outw; these are slow).

    You will however have to modify the kernel to allow mapping from your
    address space into bus space, so that you can set up the devices's DMA
    scatterlist; and to allow interrupts to be delivered to user space
    (unless you plan to poll). There are preliminary patches to do this at
    http://www.gelato.unsw.edu.au/patches/usrdrivers for 2.6.0-testXXX
    kernels; the work to support user drivers here is ongoing, and the
    interfaces *will* change (currently they're what was easy to implement
    fast (i.e., hack up) and do not correspond to production quality code)
    We're not interested in 2.4 kernels for this; I'm hoping that when the
    interfaces are cleaned up I can push it to 2.7.

    --
    Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
    The technical we do immediately,  the political takes *forever*
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: RunNHide: "Re: Initio SCSI Drivers"

    Relevant Pages

    • Re: [PATCH] uio: User IRQ Mode
      ... This patch adds a "User IRQ Mode" to UIO. ... In this mode the user space driver ... is responsible for acknowledging and re-enabling the interrupt. ...
      (Linux-Kernel)
    • Re: [PATCH] uio: User IRQ Mode
      ... This patch adds a "User IRQ Mode" to UIO. ... In this mode the user space driver ... is responsible for acknowledging and re-enabling the interrupt. ...
      (Linux-Kernel)
    • Re: [PATCH 18-rc3] Fix typos in /Documentation : Q-R
      ... The driver will receive them again on the ... The kernel is entered with r3 pointing to an area of memory that is ... Bits are then right shifted into the GP_SAMPLE register at the specified ... you get an interrupt when a full DWORD is recieved. ...
      (Linux-Kernel)
    • Re: [PATCH] uio: User IRQ Mode
      ... In this mode the user space driver ... is responsible for acknowledging and re-enabling the interrupt. ... This can easily be done without your patch. ...
      (Linux-Kernel)
    • Re: [RFC/PATCH] Kdump: Disabling PCI interrupts in capture kernel
      ... >> in second kernel due to devices not being shutdown during crash and these ... Devices A and B are sharing the same irq line. ... Driver for device A is ... Device B raises an interrupt. ...
      (Linux-Kernel)