Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 05 Nov 1998 15:38:41 -0800
From:      Mike Smith <mike@smith.net.au>
To:        lcremean@tidalwave.net
Cc:        hackers@FreeBSD.ORG
Subject:   Re: Coprocessor board--which I/O method should I use? 
Message-ID:  <199811052338.PAA00845@dingo.cdrom.com>
In-Reply-To: Your message of "Thu, 05 Nov 1998 16:56:13 EST." <19981105165613.A955@tidalwave.net> 

next in thread | previous in thread | raw e-mail | index | archive | help
> I'm writing a device driver for a board we're de3veloping at work that does
> encryption and compression in hardware. This board is going to be used in
> embedded applications (it's a PCI board), like VPNs and firewalls, so it'll
> be handling a good amount of data. For something like this, what would be
> the best way to do I/O from userland to the card? I'm thinking character
> would do, but I'd appreciate other opinions, and also being told if I'm
> off-base. Also, I'd need to know which interrupt level (net, bio, tty, etc.)
> this thing should be in. 

Will the card only be accessed by a single process at one time?

If so, and if it uses memory-mapped I/O, I would consider having the 
device driver allow memory-mapping the I/O region into the user process 
space.  If you combined that with an interrupt handler that poked the 
process (eg. with a signal or using a callin/semaphore) you'd avoid 
multiple copies and gain performance.

Alternatively, appearing as a character device would be the way to go.  
You face some interesting problems if the board supports multiple 
simultaneous streams, in that you'll need to devise a technique for 
multiplexing your I/O.

> PS: this card is just a processor board, it is not a network protocol
> controller. 

That doesn't mean that you couldn't make it look like a loopback 
interface and route stuff through it, though I doubt it'd be the 
easiest way to go.

-- 
\\  Sometimes you're ahead,       \\  Mike Smith
\\  sometimes you're behind.      \\  mike@smith.net.au
\\  The race is long, and in the  \\  msmith@freebsd.org
\\  end it's only with yourself.  \\  msmith@cdrom.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199811052338.PAA00845>