Re: Fast data acquisition

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Wed Oct 16 2002 - 07:59:36 EST


On Wed, 16 Oct 2002, Vadim Lebedev wrote:

> Hello,
>
> I'm designing a solution for high speed data acquisition. The solution will
> be based on a Pentium class processor running Linux 2.4.x
> The data will be acquired over ISA bus using DMA at the rate of 52Mbit per
> second and then sent over TCP/IP on Ethernet 100MB connecttion to host
> computer.
>

You are not serious. the ISA bus cannot transfer data at this rate. You
need to use the PCI bus. The ISA bus transfers data at about 1.5 megabytes
per second. The GP bus (ISA without any slots, using a bridge), transfers
data at up to 3.0 megabytes per second. You can purchase standard PCI
interface chips for a dollar or so. You don't need to design your own.
You also need a serial EEPROM to load its required info upon power-up.
This is all standard, inexpensive stuff.

Search 'PCI bus interface' on your Web-Crawler.
http://www.interfacebus.com/Design_Connector_PCI.html documents some
'cores' and interface chips.

>
> I wonder how to design a driver for the data acquistion bord that will
> minimize data copying.
> I have 2 ideas:
>

Data gets copied very quickly on 400 MHz or greater Pentium-Class
machines (about 1,500 megabytes per second). This should not be your
concern.

> 1) the application will open the driver and use a sendfile(devicefd,
> socketfd, ....) call

This works if you correctly implement read() in your driver.

> 2) To have the driver DMA data into the kernel buffer and then calling
> sock_sendpage directly from the driver.
>
>

If the hardware can do Bus Mastering, by all means use it. You need
to use a TCP/IP "connection" to guarantee that the receiver gets your
data. Using a piece of kernel code may send a packet, but there's
a lot more to networking than that.

>
> Do i need to implement some special functionality in the driver to realize
> 1) or a sendfile will work with an fd to any character device as source?
>

If the driver properly impliments read(). It should work with sendfile.
 

Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
The US military has given us many words, FUBAR, SNAFU, now ENRON.
Yes, top management were graduates of West Point and Annapolis.

-
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/



This archive was generated by hypermail 2b29 : Wed Oct 23 2002 - 22:00:28 EST