lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [patch #7135] Significant etharp optimization for TX speed


From: Simon Goldschmidt
Subject: [lwip-devel] [patch #7135] Significant etharp optimization for TX speed improvement
Date: Sat, 27 Mar 2010 09:38:56 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; de; rv:1.9.2.2) Gecko/20100316 Firefox/3.6.2

Follow-up Comment #3, patch #7135 (project lwip):

The current LWIP_NETIF_HWADDRHINT==1 code also avoids *searching* the cache,
it merely test if the hwaddr is really OK (it's still marked as stable in the
cache). This test would be omitted with your code and an entry would never
time out with only one active connection and no other packets being sent.

However, I totally agree the current code flow can be optimized and I'd
suggest moving the netif->addr_hint check from find_entry() to
ehtarp_output():

#if LWIP_NETIF_HWADDRHINT
if (netif->addr_hint != NULL) {
  /* per-pcb cached entry was given */
  u8_t per_pcb_cache = *(netif->addr_hint);
  if ((per_pcb_cache < ARP_TABLE_SIZE) &&
      (arp_table[per_pcb_cache].state == ETHARP_STATE_STABLE) &&
      (ip_addr_cmp(ipaddr, &arp_table[per_pcb_cache].ipaddr))) {
    /* the per-pcb-cached entry is stable and the right one! */
    ETHARP_STATS_INC(etharp.cachehit);
    return etharp_send_ip(netif, q, (struct eth_addr*)(netif->hwaddr),
      &arp_table[per_pcb_cache].ethaddr);
  }
}
#endif /* LWIP_NETIF_HWADDRHINT */
/* queue on destination Ethernet address belonging to ipaddr */
return etharp_query(netif, ipaddr, q);


This is a little more code that your suggestion but it's more in line with
the rest of the etharp module since it doesn't avoid the cache totally. Plus
it also works with more than one concurrent connection on a netif.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?7135>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]