tcpdump mailing list archives
Re: Patch: optimizations and improvements for Endace DAG cards.
From: Guy Harris <guy () alum mit edu>
Date: Wed, 19 Nov 2003 18:07:09 -0800
On Nov 19, 2003, at 5:40 PM, Koryn Grant wrote:
Yes - the (non)blocking support consists of simply setting the appropriateflag 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?
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; 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()".
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, and have it mark that FD as readable iff there are packets that have arrived but not yet been read (i.e., if dag_mem_bottom hasn't caught up to dag_mem_top, right?)? If not, that might be useful for applications that would want to use "select()" or "poll()" to wait for packets to arrive.
- 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:
- Patch: optimizations and improvements for Endace DAG cards. Koryn Grant (Nov 19)
- Re: Patch: optimizations and improvements for Endace DAG cards. Guy Harris (Nov 19)
- Re: Patch: optimizations and improvements for Endace DAG cards. Koryn Grant (Nov 19)
- Re: Patch: optimizations and improvements for Endace DAG cards. Guy Harris (Nov 19)
- Re: Patch: optimizations and improvements for Endace DAG cards. Koryn Grant (Nov 19)
- Re: Patch: optimizations and improvements for Endace DAG cards. Koryn Grant (Nov 19)
- Re: Patch: optimizations and improvements for Endace DAG cards. Guy Harris (Nov 19)