tcpdump mailing list archives

Re: Patch: optimizations and improvements for Endace DAG cards.


From: Koryn Grant <koryn () endace com>
Date: Thu, 20 Nov 2003 16:34:37 +1300 (NZDT)

On Wed, 19 Nov 2003, Guy Harris wrote:

On Nov 19, 2003, at 5:40 PM, Koryn Grant wrote:

Yes - the (non)blocking support consists of simply setting the
appropriate
flag to call dag_offset() in a (non)blocking way.

So does "dag_open()" return a UNIX-style file descriptor and, if so,
does setting non-blocking mode on the FD returned by "dag_open()" have
any effect?

dag_open() does return a UNIX-style file descriptor, but the standard fd
calls to set non-blocking mode have no effect.  This can only be done via
the flags parameter to dag_offset().

I've just checked in changes to do the setting and getting of
non-blocking mode in functions pointed to by pointers in the "pcap_t"
structure, rather than using the pile of #ifdefs and run-time checks we
had before;

That'll be much nicer.

if "dag_open()" doesn't return a UNIX-style file
descriptor, or if it does but setting non-blocking mode on it has no
effect (or isn't necessary to get "dag_offset()" not to block, you
could add a "dag_getnonblock()" routine that just checks
"p->md.dag_offset_flags" and returns 1 if DAGF_NONBLOCK is set and 0
otherwise, and change "dag_setnonblock()" not to bother calling
"pcap_setnonblock()".

I'll update my libpcap tree and get on to this.

Also, if "dag_open()" returns a UNIX-style file descriptor (e.g., a
descriptor referring to the DAG device), can you do a "select()" or
"poll()" on it

No, it doesn't play nicely with select()/poll() at the moment.

Cheers,
Koryn
-- 
Dr Koryn Grant                         phone   +64 7 8346729
Senior Software Engineer               mobile  +64 21 488386
Endace Technology Ltd                  email   koryn () endace com
Hamilton, New Zealand                  web     http://www.endace.com/
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: