diff options
Diffstat (limited to 'drivers/net/ethernet/ibm/ibmveth.c')
-rw-r--r-- | drivers/net/ethernet/ibm/ibmveth.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index c9127562bd22..21978cc019e7 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c | |||
@@ -292,6 +292,18 @@ failure: | |||
292 | atomic_add(buffers_added, &(pool->available)); | 292 | atomic_add(buffers_added, &(pool->available)); |
293 | } | 293 | } |
294 | 294 | ||
295 | /* | ||
296 | * The final 8 bytes of the buffer list is a counter of frames dropped | ||
297 | * because there was not a buffer in the buffer list capable of holding | ||
298 | * the frame. | ||
299 | */ | ||
300 | static void ibmveth_update_rx_no_buffer(struct ibmveth_adapter *adapter) | ||
301 | { | ||
302 | __be64 *p = adapter->buffer_list_addr + 4096 - 8; | ||
303 | |||
304 | adapter->rx_no_buffer = be64_to_cpup(p); | ||
305 | } | ||
306 | |||
295 | /* replenish routine */ | 307 | /* replenish routine */ |
296 | static void ibmveth_replenish_task(struct ibmveth_adapter *adapter) | 308 | static void ibmveth_replenish_task(struct ibmveth_adapter *adapter) |
297 | { | 309 | { |
@@ -307,8 +319,7 @@ static void ibmveth_replenish_task(struct ibmveth_adapter *adapter) | |||
307 | ibmveth_replenish_buffer_pool(adapter, pool); | 319 | ibmveth_replenish_buffer_pool(adapter, pool); |
308 | } | 320 | } |
309 | 321 | ||
310 | adapter->rx_no_buffer = *(u64 *)(((char*)adapter->buffer_list_addr) + | 322 | ibmveth_update_rx_no_buffer(adapter); |
311 | 4096 - 8); | ||
312 | } | 323 | } |
313 | 324 | ||
314 | /* empty and free ana buffer pool - also used to do cleanup in error paths */ | 325 | /* empty and free ana buffer pool - also used to do cleanup in error paths */ |
@@ -698,8 +709,7 @@ static int ibmveth_close(struct net_device *netdev) | |||
698 | 709 | ||
699 | free_irq(netdev->irq, netdev); | 710 | free_irq(netdev->irq, netdev); |
700 | 711 | ||
701 | adapter->rx_no_buffer = *(u64 *)(((char *)adapter->buffer_list_addr) + | 712 | ibmveth_update_rx_no_buffer(adapter); |
702 | 4096 - 8); | ||
703 | 713 | ||
704 | ibmveth_cleanup(adapter); | 714 | ibmveth_cleanup(adapter); |
705 | 715 | ||