|
About ::
TODO ::
Blog ::
RSS ::
Old blog ::
Projects ::
GIT ::
Gallery ::
Notes
Sat, 26 Aug 2006
Zero-copy sending and receiving support. tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes 16:47:27.233768 IP10 truncated-ip - 256 bytes missing! 192.168.4.78 > 192.168.0.48: udp 0x0000: abab 0578 abab abab ab11 abab c0a8 044e 0x0010: c0a8 0030 abab abab abab abab abab abab 0x0020: abab abab abab abab abab abab abab abab 0x0030: abab abab abab abab abab abab abab abab 0x0040: abab abab abab abab abab abab abab abab 0x0050: ababThis is zero-copy sent datagram, which was captured on receiving side, as you can see it is perfectly correct (i.e. it contains exactly those IP and higher layers, which were filled in userspace on sending side). I've also cleaned zero-copy mapping support a lot, so there would not appeared some situations when allocation would not be caught due to mmap troubles (like different CPU mapping crossing and so on). I also moved notification about new packet arrival in zero-copy sniffer into freeing function, since when it is placed in allocation one userspace can find new buffer until it is even filled by the kernel. When buffer is being freed, it is obviously already contains data (except cases when allocated object was not used at all). In general zero-copy sniffer can not catch data changes happend somewhere inside main processing code, for example IPsec packet can not be caught decrypted, since it is very short time while packet itself is in transient state after receiving and decryption, in such cases that transient states must be copied, for example using new allocation (which freeing will be caught by sniffer), memory copying and immediate freeing. There is still a small problem there with freeing - due to addition of struct skb_shared_info,
but it is not really that complex, so I will postpone it for a while and
will try to implement trivial dump analyzer.Almost forgot, you can find current patch and userspace utilities in archive. /devel/networking/zcs :: Link / Comments (0) Please solve this captcha to be allowed to post (need to reload in a minute): 58 * 91 Comments are closed for this story. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||