From: <abe...@us...> - 2017-05-01 19:15:06
|
Revision: 8285 http://sourceforge.net/p/astlinux/code/8285 Author: abelbeck Date: 2017-05-01 19:15:04 +0000 (Mon, 01 May 2017) Log Message: ----------- network, add new PHYETH_DISABLE_OFFLOAD rc.conf variable to disable hardware network interface offloading, disabled by default Modified Paths: -------------- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/network =================================================================== --- branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-04-29 16:30:20 UTC (rev 8284) +++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/network 2017-05-01 19:15:04 UTC (rev 8285) @@ -247,6 +247,24 @@ esac } +phyeth_disable_offload() +{ + local eth off off_list="$1" IFS + + logger -s -t network -p kern.info "Disabling \"$off_list\" offload on all configured ethernet interfaces." + + unset IFS + for eth in $EXTIF $EXT2IF $PPPOEIF $INTIF $INT2IF $INT3IF $INT4IF $DMZIF $BRIDGE0 $BRIDGE1 $BRIDGE2; do + case $eth in + eth*) + for off in $off_list; do + ethtool -K $eth $off off 2>/dev/null + done + ;; + esac + done +} + init () { mkdir -p /tmp/etc/wide-dhcpv6 @@ -436,6 +454,10 @@ done fi + if [ -n "$PHYETH_DISABLE_OFFLOAD" ]; then + phyeth_disable_offload "$PHYETH_DISABLE_OFFLOAD" + fi + if [ -n "$INTIF" -a -n "$INTIP" -a -n "$INTNM" -a "$INTIF" != "none" ]; then ip addr add $INTIP/$INTNM brd + dev $INTIF if [ "$IPV6" = "yes" -a -n "$INTIPV6" ]; then Modified: branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf =================================================================== --- branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2017-04-29 16:30:20 UTC (rev 8284) +++ branches/1.0/project/astlinux/target_skeleton/stat/etc/rc.conf 2017-05-01 19:15:04 UTC (rev 8285) @@ -958,16 +958,18 @@ ## IFRENAME Support ## If for some reason you need to move your interfaces around before ## they are configured, you can do that here if you built your system -## with wireless-tools enabled (it's included by default. +## with wireless-tools enabled (not included by default). #IFRENAME="eth0:8139too:i10 eth1:8139too:i12 eth2:8139too:i11" ## Physical Ethernet Configuration ## If you need to manually specify any speed and duplex settings, you can ## do that here NOTE: This will disable auto-negotiation for any devices -## you enable it for. You CANNOT use variables like $EXTIF, $INTIF, etc. -## Note that this code runs AFTER the ifrename support above. +## you enable it for. ## INTERFACE:speed:duplex #PHYETH="eth0:10:half eth1:100:half" +## Disable hardware network interface offloading for the specified offload types. +## Note: This applies to all configured ethernet interfaces and VLAN's. +#PHYETH_DISABLE_OFFLOAD="tso gso gro" ## Change EXTIF's MAC address here (for some cable connections) #EXTIFMAC="01:02:03:04:05:06" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |