#3732 HIGH Update.: arp and NDP timeouts on Linux are bizzarely short.

Zarro Boogs per Child bugtracker at laptop.org
Wed Feb 20 07:57:28 EST 2008


#3732: arp and NDP timeouts on Linux are bizzarely short.
---------------------+------------------------------------------------------
  Reporter:  wad     |       Owner:  cjb     
      Type:  defect  |      Status:  new     
  Priority:  high    |   Milestone:  Update.2
 Component:  kernel  |     Version:          
Resolution:          |    Keywords:          
  Verified:  0       |    Blocking:          
 Blockedby:          |  
---------------------+------------------------------------------------------
Changes (by gnu):

 * cc: dwmw2 (added)
  * component:  distro => kernel


Comment:

 I think this bug should be retitled back to:  arp broadcasts don't wake up
 laptop

 Then we can fix it!  I found out how.

 The firmware interface document, and the Unix "ethtool", define a way for
 us to set up wake-on-arp separately from wake-on-broadcast.  We just
 haven't done the minor work involved.
 (Note:  I don't know that the Libertas firmware *meets* its spec.  But
 since this is part of the
 basic Ethernet/802.11 wake infrastructure, it probably does.  See errata
 in #2177.)

 "ethtool eth0 wol" configures the wake-on-lan for the interface.  It
 allows setting various
 bits.  Our current interface supports the "p" (physical layer event), "u"
 (unicast), "m"
 (multicast), and "b" (broadcast) bits.  There's an additional "a" (ARP)
 bit defined, but we
 don't support it yet.

 Page 85-86 of the Marvell spec (http://wiki.laptop.org/images/f/f3
 /Firmware-Spec-v5.1-MV-S103752-00.pdf) defines the wakeup conditions,
 passed to the firmware in a CMD_802_11_HOST_SLEEP_CFG command.  It has
 bits defined for b, u, p, and m as above.  It also
 says, "The optional MrvlIETypes_HostSleepFilterType1 TLV is used to
 further specify the !EthType packets that can wake up the host."

 Page 131 of the Marvell firmware spec defines the
 "MrvIIETypes_HostSleepFilterType1 TLV", and gives an example of how to use
 it for ARP.  You can match each packet against three fields:
 !AddrType (bcast/unicast/multicast), !EthType (2-byte Ethernet address
 type), and Ipv4Addr (our IPv4 address).  Most of these can be -1 for don't
 care.  If any row matches, the packet causes a wakeup.

 I suggest that we support the "a" bit in the Linux interface, and hook it
 to this filter.  When the "a" bit is set, we should configure the chip
 with this HostSleepFilterType setting:

   !AddrType 1 (bcast), !EthType 0x0806 (ARP), Ipv4Addr (our IP address)

 In addition, if we're using this filter, we need to add a row for each of
 the other packet type bits we have on, e.g.:

   !AddrType 3 (mcast), !EthType 0xFFFF (dontcare), Ipv4Addr 0xFFFFFFFF
 (dontcare)

 I further believe that by default, the driver should configure itself to
 wake on unicast, multicast, and arp.  It shouldn't take external twiddling
 to make this happen.  This will permit ordinary IPv4 and IPv6 TCP and UDP
 packets to wake the laptop (but not non-ARP broadcasts).  Doing this
 requires sending a new Host Sleep setup command whenever our IPv4 address
 changes.  If this interface has several IPv4 addresses, then we'd add
 several arp rows to this table.  (We may need to put our anycast addresses
 in here too, if they get arp'd for; I don't know how that currently
 works.)

-- 
Ticket URL: <http://dev.laptop.org/ticket/3732#comment:17>
One Laptop Per Child <http://dev.laptop.org>
OLPC bug tracking system



More information about the Bugs mailing list