Forum Topic - Ethernet packet: (4 Items)
   
Ethernet packet  
I want figure out the difference between lsm-nraw and bpf device when processing ethernet packets. I can use both module
 to send/receive ethernet packets. Which one has better interfaces support?
Re: Ethernet packet  
Hello,

as i remember right, lsm-nraw.so was available as source code to have an example for your own specialized filters.
The lowest latency will be archived implementing  your complete network protocol  as your own  lsm-XXX.so.

Here the flexibility is very high. For example, if the message passing latency to the resmgr interface of the lsm-nraw.
so is to high for your problem, store the frames with your lsm-XXX.so to a shared memory region and use the resmgr 
interface only for triggering...  
 
Regards
Michael
Re: Ethernet packet  
Note that while the lsm-xxx.so flexibility is very high, so is the complexity especially given io-pkt's unique threading
 model. With this code running in io-pkt then it can cause issues with any packet flow or interface if care isn't taken.


If you don't need the full facilities and performance of an lsm-xxx.so then I strongly recommend to stick with the BPF 
API. It's far better documented and you are running as a normal process rather than as part of io-pkt.
Re: Ethernet packet  
Hi:

Thanks a lot. I am trying the BPF way. I have a problem that how to set a BLOCK mode(like socket) when receiving packets
. I have find a ioctl command BIOCIMMEDIATE but it says that BPF will return value when the buffer becomes full or 
timeout occurs which is different from BLOCK mode in socket. Do you have any advice about this? 

BEST
Ge