Half Duplex and Zero Copy IP
Hello,
I have 2 3Com NICs on my system. They are 3c905C Tornado PCI cards. The drivers are compiled into the kernel (Slackware 8.0 with kernel 2.4.7).
One of the interfaces will be used as a sniffer interface (without IP address) and a very high traffic pipes. I do not wish to loose any packets coming to this interface. Is it better if I initialize the interface in HALF DUPLEX mode? If yes, how do I set the card to HALF DUPLEX mode? How can I find out the HW (NIC) settings on the system?
Another question about 3Com NICs, do they perform zero-copy IP? I read that the performance improves a lot WITHOUT zero-copy IP.
Thanks for any info.
Signature · 6 lines
Subba Rao [email protected] http://members.home.net/subba9/ GPG public key ID 27FC9217 Key fingerprint = 2B4C 498E 1860 5A2B 6570 5852 7527 882A 27FC 9217
Quoted 11 lines · Subba Rao
Hello,
I have 2 3Com NICs on my system. They are 3c905C Tornado PCI cards. The drivers are compiled into the kernel (Slackware 8.0 with kernel 2.4.7).
One of the interfaces will be used as a sniffer interface (without IP address) and a very high traffic pipes. I do not wish to loose any packets coming to this interface. Is it better if I initialize the interface in HALF DUPLEX mode? If yes, how do I set the card to HALF DUPLEX mode? How can I find out the HW (NIC) settings on the system?
No, this will provide no benefit.
Quoted 1 line
Another question about 3Com NICs, do they perform zero-copy IP?
Linux's zerocopy infrastructure allows the sendfile() system call to save a copy with NICs which have hardware checksumming and scatter/gather. 3c905C is one such NIC. Kernel is not generally "zero copy", but large savings are available in certain situations. NFS packet reassembly benefits from 905C's as well.
Quoted 1 line
I read that the performance improves a lot WITHOUT zero-copy IP.
Not right. Where did you read that?
-
In article <[email protected]>,
Quoted 9 lines · [email protected] (Subba Rao) writes:
Hello,
I have 2 3Com NICs on my system. They are 3c905C Tornado PCI cards. The drivers are compiled into the kernel (Slackware 8.0 with kernel 2.4.7).One of the interfaces will be used as a sniffer interface (without IP address) and a very high traffic pipes. I do not wish to loose any packets coming to this interface. Is it better if I initialize the interface in HALF DUPLEX mode? If yes, how do I set the card to HALF DUPLEX mode? How can I find out the HW (NIC) settings on the system?
Half duplex mode will only make your line slower, it has no benefit.
Quoted 2 lines
Another question about 3Com NICs, do they perform zero-copy IP? I read that the performance improves a lot WITHOUT zero-copy IP.
The sniffer zero copy implementation as implemented in some libpcaps does not depend on any special NIC support; it should work with any.
-Andi
Quoted 2 lines · Andi Kleen
The sniffer zero copy implementation as implemented in some libpcaps does not depend on any special NIC support; it should work with any.
Do you mean mmap() on a packet socket? Unless I am mistaken, the data is still copied once to the mmap area, however only the capture length is copied -- the rest of the packet is discarded.
This means that you cannot use mmap() on a packet socket to zero-copy read whole packets. In fact there is no way to zero-copy read whole packets into user space, without modifying the kernel.
Am I mistaken (it would be nice)?
Thanks,
-- Jamie
In article <[email protected]>,
Quoted 3 lines · [email protected] (Jamie Lokier) writes:
This means that you cannot use
mmap()on a packet socket to zero-copy read whole packets. In fact there is no way to zero-copy read whole packets into user space, without modifying the kernel.
[...]
Yes, sorry, I should have written single copy.
Zero copy read is currently only possible for kernel clients with hacks.
-Andi
Quoted 7 lines · Andrew Morton
Quoted 6 lines · Subba Rao
Hello,
I have 2 3Com NICs on my system. They are 3c905C Tornado PCI cards. The drivers are compiled into the kernel (Slackware 8.0 with kernel 2.4.7).
Quoted 7 lines
Quoted 5 lines
One of the interfaces will be used as a sniffer interface (without IP address) and a very high traffic pipes. I do not wish to loose any packets coming to this interface. Is it better if I initialize the interface in HALF DUPLEX mode? If yes, how do I set the card to HALF DUPLEX mode? How can I find out the HW (NIC) settings on the system?
No, this will provide no benefit.
So, is the card set in half-duplex mode by default and full-duplex is a forced option?
Quoted 9 lines
Quoted 2 lines
Another question about 3Com NICs, do they perform zero-copy IP?
Linux's zerocopy infrastructure allows the
sendfile()system call to save a copy with NICs which have hardware checksumming and scatter/gather. 3c905C is one such NIC. Kernel is not generally "zero copy", but large savings are available in certain situations. NFS packet reassembly benefits from 905C's as well.
Quoted 4 lines
Quoted 1 line
I read that the performance improves a lot WITHOUT zero-copy IP.
Not right. Where did you read that?
"To achieve gigabit throughput, it is important that the operating system does not copy the data in the packets before sending them (this is called zero-copy IP). Unfortunately, the kernel needs to put a header before the data in the packet, so not copying the data to a buffer in kernel space means that the NIC needs to be able to fetch the header from a different place in memory than the user data in the packet. This is called scatter/gather and is necessary for zero-copy IP."
Signature · 6 lines
Subba Rao [email protected] http://members.home.net/subba9/ GPG public key ID 27FC9217 Key fingerprint = 2B4C 498E 1860 5A2B 6570 5852 7527 882A 27FC 9217