#!/sbin/sh # # $Id: net-tune,v 1.2 2003-06-03 09:49:50-07 rpr Exp $ # # Rodney Rutherford # # net-tune # # This script gets run on bootup to set the following parameters # to optimize 100 Mbps performance. This script is based on the # info in the following documents: # # Sun INFODOC ID: 12618 SYNOPSIS: TCP/IP PSD/FAQ # Sun INFODOC ID: 16728 SYNOPSIS: How does 100baseT auto-negotiation work? # Sun FAQ ID: 16728 SYNOPSIS: Speed setting on 10/100mb hme # # ln /etc/init.d/net-tune /etc/rc2.d/S68net-tune # # Parameter info: # # tcp_recv_hiwat # # This parameter specifies the default value for a connection's receive buffer # space; that is, the amount of buffer space allocated for received data # (and thus the maximum possible advertised receive window). # In most cases, tcp_recv_hiwat should be identical to tcp_xmit_hiwat. # The default value is 8192 (8k). # # tcp_xmit_hiwat # # This parameter specifies the default value for a connection's # send buffer space; that is, the amount of buffer space allocated # for sent but unacknowledged data. In most cases, tcp_xmit_hiwat should be # identical to tcp_recv_hiwat. The default value is 8192 (8k). # # The qfe device instances sets the configuration for the qfe driver # for each individual port (as opposed to configuring the driver for # all ports in /etc/system). This works for both the qfe and hme drivers. # (just substitute hme in place of qfe) # # The first ndd line selects which port to modify (instance 0 = port 0...) # # ndd -set /dev/qfe instance 0 # # The next ndd line disables 100BaseT4 Fast-Ethernet mode # 100BaseT4 uses four pairs of voice- or data-grade Category 3,4,5 UTP wiring # # ndd -set /dev/qfe adv_100T4_cap 0 # # The following 4 ndd lines can be decoded as follows: # # qfe_adv_dx_cap= # # Where is 10 or 100, is "h" or "f" (half or full), # = 1, and = 0 # # The first line enables 100BaseTX Full-Duplex Fast-Ethernet # 100BaseTX uses two pairs of data-grade Category 5 UTP or STP wiring # 10BaseT uses two pairs of data-grade Category 3,4,5 UTP wiring # # ndd -set /dev/qfe adv_100fdx_cap 1 # ndd -set /dev/qfe adv_100hdx_cap 0 # ndd -set /dev/qfe adv_10fdx_cap 0 # ndd -set /dev/qfe adv_10hdx_cap 0 # # The last ndd line turns off auto-negotiation of speed/duplex. # # ndd -set /dev/qfe adv_autoneg_cap 0 # PATH=/usr/bin:/usr/sbin case "$1" in 'start') echo "Setting local Solaris kernel TCP changes - ndd Tuning for 100bT" ndd -set /dev/tcp tcp_xmit_hiwat 65535 ndd -set /dev/tcp tcp_recv_hiwat 65535 echo "Setting qfe0 device to 100MB Full-Duplex..." ndd -set /dev/qfe instance 0 ndd -set /dev/qfe adv_100T4_cap 0 ndd -set /dev/qfe adv_100fdx_cap 1 ndd -set /dev/qfe adv_100hdx_cap 0 ndd -set /dev/qfe adv_10fdx_cap 0 ndd -set /dev/qfe adv_10hdx_cap 0 ndd -set /dev/qfe adv_autoneg_cap 0 echo "Setting qfe1 device to 10MB Half-Duplex..." ndd -set /dev/qfe instance 1 ndd -set /dev/qfe adv_100T4_cap 0 ndd -set /dev/qfe adv_100fdx_cap 0 ndd -set /dev/qfe adv_100hdx_cap 0 ndd -set /dev/qfe adv_10fdx_cap 0 ndd -set /dev/qfe adv_10hdx_cap 1 ndd -set /dev/qfe adv_autoneg_cap 0 ;; 'stop') echo "No kernel parameters changed." ;; *) echo "Usage: $0 {start|stop}" ;; esac exit 0