[Click] e1000 polling driver issues?

Kevin Lahey kml at patheticgeek.net
Fri Nov 7 12:03:49 EST 2003


I'm using Click-1.3pre1 with Linux-2.4.21 and Intel Pro/1000 Ethernet
cards.  Experimenting the e1000 polling driver, I found that the 
PollDevice "buffers_reused" count was enormous -- generally
several hundred times larger than the "packets" count.

It looks like the driver is sending back an inaccurate count of
the receive buffers to be refilled, causing the allocation and
recycling of lots of sk_buffs in PollingDevice::run_task.

I'm appending an only-lightly-tested patch to the current
CVS version of Click that seems to fix this.  Whether or not
it gives a performance boost, at least it makes the statistics
look better.  :-)

Thanks,

Kevin
kml at patheticgeek.net


Index: Makefile
===================================================================
RCS file: /cvs/click/release/one/drivers/e1000-4.x/src/e1000.h,v
retrieving revision 1.1
diff -c -r1.1 e1000.h
*** e1000.h	2002/11/22 17:13:38	1.1
--- e1000.h	2003/11/07 18:54:20
***************
*** 150,155 ****
--- 150,157 ----
  
  #define E1000_DESC_UNUSED(R) \
  ((((R)->next_to_clean + (R)->count) - ((R)->next_to_use + 1)) % ((R)->count))
+ #define E1000_RX_DESC_UNUSED(R) \
+ ((((R)->next_to_clean + (R)->count) - ((R)->next_to_use)) % ((R)->count))
  
  #define E1000_GET_DESC(R, i, type)	(&(((struct type *)((R).desc))[i]))
  #define E1000_RX_DESC(R, i)		E1000_GET_DESC(R, i, e1000_rx_desc)
Index: e1000_main.c
===================================================================
RCS file: /cvs/click/release/one/drivers/e1000-4.x/src/e1000_main.c,v
retrieving revision 1.2
diff -c -r1.2 e1000_main.c
*** e1000_main.c	2002/11/23 00:24:21	1.2
--- e1000_main.c	2003/11/07 18:54:21
***************
*** 2673,2679 ****
    struct sk_buff *skb_list;
  
    if(skbs == 0)
!     return E1000_DESC_UNUSED(&adapter->rx_ring);
  
    i = adapter->rx_ring.next_to_use;
    skb_list = *skbs;
--- 2673,2679 ----
    struct sk_buff *skb_list;
  
    if(skbs == 0)
!     return E1000_RX_DESC_UNUSED(&adapter->rx_ring);
  
    i = adapter->rx_ring.next_to_use;
    skb_list = *skbs;
***************
*** 2722,2728 ****
      e1000_watchdog_1(adapter);
    }
  
!   return E1000_DESC_UNUSED(&adapter->rx_ring);
  }
  
  static int
--- 2722,2728 ----
      e1000_watchdog_1(adapter);
    }
  
!   return E1000_RX_DESC_UNUSED(&adapter->rx_ring);
  }
  
  static int


More information about the click mailing list