Dan Moser
06/25/2012 2:08 PM
post93853
|
Hi,
Hoping I can find someone willing to provide some insight/suggestions regarding the following problem:
- I am using io-pkt with the mpc85xx driver under QNX 6.5.
- My application is the sole user of that nic and exclusively uses bpf for r/w.
Here is my scenario:
- link is up
- app starts and can successfully r/w bpf packets
- link goes down
- reads, of course, begin to return zero bytes but writes continue successfully for a number of more packets (these
writes are getting buffered somewhere as explained below) until the writes finally indicate failure
- my app terminates
- the link goes back up (no app is running and observed that no packet i/o occurs)
- Some tme later (could be hours) I restart my app and once I open the bpf and execute my first write, the old stale
packets from my prior run get transmitted followed by my new writes (note that I could, with the link down, run my app a
number of times and finally when the link is up and I run my app I see stale data from a number of those prior
invocations get sent).
The only way I have found to get rid of the stale data is to slay io-pkt and restart it. According to the bpf docs, bpf
writes are unbuffered and BIOCFLUSH flushes/discards the buffer of incoming packets from within the bpf framework but
it appears that io-pkt and/or the /dev/bpf device are keeping buffers of stale data around.
Anyone have an idea of how to flush those stale buffers programmatically?
Any insight is GREATLY appreciated,
Dan
|
|
|