An Ethernet Configuration Tip

Edit: I love Dean’s scripts.

Originally posted March 30, 2010 on AIXchange

I just saw this on a mailing list: It’s a tip about (default) Ethernet configs written by Dean Rowswell. This is great information, so, with Dean’s permission, I’m passing it along:

The default value for *physical* Ethernet adapters is to enable largesend. This is *not* the default for Shared Ethernet adapters and Virtual Ethernet adapters.

Enabling largesend can make a BIG difference for some applications.

Example:

largesend Disabled: FTP between two LPARs using Virtual Ethernet and the performance was 194 MB/sec.
largesend Enabled: Same test … 725 MB/sec.

For SEA, the largesend=1 option can be added when it’s created via the mkvdev command.

For Virtual Ethernet Adapters on VIO client LPARs, there is no ODM stanza for this value, so it must be set at reboot time. I wrote an “ena_lg_send_virt_eth.tar” script for making this change on reboot:

#!/bin/ksh
# Created by Dean Rowswell, IBM, March 22, 2010
# This script will enable the largesend tunable for the virtual ethernet interface in order
# to dramatically improve performance of this adapter
#
# This script should run just before the rctcpip entry in the inittab

LOG=/var/adm/ena_lg_send_virt_eth.log

echo “\n=================================================================================”
>>${LOG}
echo “Running ena_lg_send_virt_eth on `hostname` at `date`” | tee -a ${LOG}
echo “=================================================================================”
>>${LOG}

# Get all of the ethernet interfaces on this system
for INTERFACE in `netstat -in|grep ^en|grep -v link|awk ‘{print $1}’|sort|uniq`
do
# Convert the interface to the device
DEVICE=`echo ${INTERFACE} | sed ‘s/en/ent/g’`

# Check all Virtual Adapters for this device
lsdev -Cc adapter -Sa -s vdevice -F name | grep -w ${DEVICE}
>/dev/null 2>/dev/null

# If a match is found then enable largesend for this interface
if [ $? -eq 0 ]
then
echo “\nCurrent interface config for ${INTERFACE} is:” >>${LOG}
ifconfig ${INTERFACE} >>${LOG}
echo “\nENABLE LARGESEND FOR VIRTUAL ETHERNET INTERFACE ->
${INTERFACE} at `date`” >>${LOG}
ifconfig ${INTERFACE} largesend >>${LOG} 2>>${LOG}
echo “\nNew interface config for ${INTERFACE} is:” >>${LOG}
ifconfig ${INTERFACE} >>${LOG}
fi
done

I placed this script into a /usr/local/scripts directory on the AIX systems. This entry should run just before rctcpip in the inittab.

For AIX 6.1 systems I ran this command:

# mkitab -i platform_agent
“lg_send:2:wait:/usr/local/scripts/ena_lg_send_virt_eth # Enable largesend for virt enet adapters”

For AIX 5.3 systems I ran this command:

# mkitab -i srcmstr
“lg_send:2:wait:/usr/local/scripts/ena_lg_send_virt_eth # Enable largesend for virt enet adapters”