Jumbo Packets
Last semester Professor Hesse and I discovered a that our e1000 gigabit ethernet cards were limited to 1500 bit packets. There are two network cards in the machines. One for the internal network that runs on gigabit, and one for the external which is 100 Mbit. To test the speed of the cards we just setup an ftp server and transferred an uncompressed GB of zeros from one machine to the other. First we did this on the 100Mbit, then on the Gigabit. Our results:
100Mbit: 10.75MB/sec or 1024000 KB in 93 seconds gigabit: 22.85 MB/sec or 1024000 KB in 43.8 seconds
Hmmmm, I thought gigabit was supposed to be about 10x faster with large amounts of data. Hesse hypothesized that perhaps the cpu couldn’t keep up with the bandwidth of the network. TCP packet headers have to be formed by the cpu every time you want to send data. Actually, there is something called TCP Segmentation Offload (TSO) that offloads this overhead from the cpu to the ethernet card. TSO was enabled. Still, perhaps the card couldn’t keep up? To check if TSO is enabled and enable it the following commands can be used.
# ethtool -k eth0 Offload parameters for eth0: Cannot get device udp large send offload settings: Operation not supported rx-checksumming: on tx-checksumming: on scatter-gather: on tcp segmentation offload: off udp fragmentation offload: off generic segmentation offload: off # ethtool -K eth0 tso on # ethtool -k eth0 Offload parameters for eth0: Cannot get device udp large send offload settings: Operation not supported rx-checksumming: on tx-checksumming: on scatter-gather: on tcp segmentation offload: on udp fragmentation offload: off generic segmentation offload: off
we tried increasing the nice value of the ftp process with the renice command. Nothing changed the results.
So I pulled the source code for the newest e1000 ethernet driver at the time (7.6.9.2) and found the code that sets the mtu value. There were some issues about 82573 cards having a power management capability that corrupted bits in packets. An eeprom bit had to be flipped to turn this off in older cards, but our cards appeared to be newer because the bit was already off. The only thing that was not allowing our ethernet cards to go above the 1500 bits was a simple if statement shown below:
if ((adapter->hw.device_id != E1000_DEV_ID_82573L) ||
(eeprom_data & NVM_WORD1A_ASPM_MASK)) {
if (max_frame > ETH_FRAME_LEN + ETHERNET_FCS_SIZE) {
DPRINTK(PROBE, ERR,
“Jumbo Frames not supported.\n”);
return -EINVAL;
}
break;
}
By removing this if statement, the safe guard is bypassed. The next problem was that the ftp program may have been the problem with benchmarking. To get around this we found a better tool, nttcp. The experiment showed a definite and significant increase in performance when raising the mtu and also that the ftp program must have been limiting the bandwidth.
In my next blog I’ll post the results and how to use the tcp benchmarking tool.
Blog of a Bongio
Comments(0)