aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge
diff options
context:
space:
mode:
authorSreenivasa Honnur <Sreenivasa.Honnur@neterion.com>2010-03-28 18:08:30 -0400
committerDavid S. Miller <davem@davemloft.net>2010-03-29 19:57:21 -0400
commit3363276f1c420b7de92169ddabd2bb88aa26a7d6 (patch)
treefa5a2439f59cc90f104d9baf546a5f1e83233f4c /drivers/net/vxge
parent18dec74c16abaa92d663dfef64ee6503e085be89 (diff)
vxge: Fix starvation of receive ring controller when blasted by short packets.
- Fix starvation of receive ring controller when blasted by short packets. This was because the driver was posting 64 rxds initially while the ring controller was expecting to read 256 replenished rxds. While the driver was coming up, the internal rxd memory filled up the 64 buffers provided and the ring controller was left waiting for the remaining 192 rxds to complete the write back of completed rxds to the host and generation of an interrupt. Signed-off-by: Sreenivasa Honnur <sreenivasa.honnur@neterion.com> Signed-off-by: Ramkrishna Vepa <ram.vepa@neterion.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vxge')
-rw-r--r--drivers/net/vxge/vxge-config.c14
-rw-r--r--drivers/net/vxge/vxge-main.c2
-rw-r--r--drivers/net/vxge/vxge-traffic.h3
3 files changed, 6 insertions, 13 deletions
diff --git a/drivers/net/vxge/vxge-config.c b/drivers/net/vxge/vxge-config.c
index 32a75fa935ed..243fb8cf08b2 100644
--- a/drivers/net/vxge/vxge-config.c
+++ b/drivers/net/vxge/vxge-config.c
@@ -1217,14 +1217,13 @@ __vxge_hw_ring_mempool_item_alloc(struct vxge_hw_mempool *mempoolh,
1217} 1217}
1218 1218
1219/* 1219/*
1220 * __vxge_hw_ring_initial_replenish - Initial replenish of RxDs 1220 * __vxge_hw_ring_replenish - Initial replenish of RxDs
1221 * This function replenishes the RxDs from reserve array to work array 1221 * This function replenishes the RxDs from reserve array to work array
1222 */ 1222 */
1223enum vxge_hw_status 1223enum vxge_hw_status
1224vxge_hw_ring_replenish(struct __vxge_hw_ring *ring, u16 min_flag) 1224vxge_hw_ring_replenish(struct __vxge_hw_ring *ring)
1225{ 1225{
1226 void *rxd; 1226 void *rxd;
1227 int i = 0;
1228 struct __vxge_hw_channel *channel; 1227 struct __vxge_hw_channel *channel;
1229 enum vxge_hw_status status = VXGE_HW_OK; 1228 enum vxge_hw_status status = VXGE_HW_OK;
1230 1229
@@ -1245,11 +1244,6 @@ vxge_hw_ring_replenish(struct __vxge_hw_ring *ring, u16 min_flag)
1245 } 1244 }
1246 1245
1247 vxge_hw_ring_rxd_post(ring, rxd); 1246 vxge_hw_ring_rxd_post(ring, rxd);
1248 if (min_flag) {
1249 i++;
1250 if (i == VXGE_HW_RING_MIN_BUFF_ALLOCATION)
1251 break;
1252 }
1253 } 1247 }
1254 status = VXGE_HW_OK; 1248 status = VXGE_HW_OK;
1255exit: 1249exit:
@@ -1354,7 +1348,7 @@ __vxge_hw_ring_create(struct __vxge_hw_vpath_handle *vp,
1354 * Currently we don't have a case when the 1) is done without the 2). 1348 * Currently we don't have a case when the 1) is done without the 2).
1355 */ 1349 */
1356 if (ring->rxd_init) { 1350 if (ring->rxd_init) {
1357 status = vxge_hw_ring_replenish(ring, 1); 1351 status = vxge_hw_ring_replenish(ring);
1358 if (status != VXGE_HW_OK) { 1352 if (status != VXGE_HW_OK) {
1359 __vxge_hw_ring_delete(vp); 1353 __vxge_hw_ring_delete(vp);
1360 goto exit; 1354 goto exit;
@@ -1416,7 +1410,7 @@ enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring)
1416 goto exit; 1410 goto exit;
1417 1411
1418 if (ring->rxd_init) { 1412 if (ring->rxd_init) {
1419 status = vxge_hw_ring_replenish(ring, 1); 1413 status = vxge_hw_ring_replenish(ring);
1420 if (status != VXGE_HW_OK) 1414 if (status != VXGE_HW_OK)
1421 goto exit; 1415 goto exit;
1422 } 1416 }
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index 0006837f535c..cada8fc51d4f 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -444,7 +444,7 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
444 ring->ndev->name, __func__, __LINE__); 444 ring->ndev->name, __func__, __LINE__);
445 ring->pkts_processed = 0; 445 ring->pkts_processed = 0;
446 446
447 vxge_hw_ring_replenish(ringh, 0); 447 vxge_hw_ring_replenish(ringh);
448 448
449 do { 449 do {
450 prefetch((char *)dtr + L1_CACHE_BYTES); 450 prefetch((char *)dtr + L1_CACHE_BYTES);
diff --git a/drivers/net/vxge/vxge-traffic.h b/drivers/net/vxge/vxge-traffic.h
index 3c35e446e247..bed65280d988 100644
--- a/drivers/net/vxge/vxge-traffic.h
+++ b/drivers/net/vxge/vxge-traffic.h
@@ -1955,7 +1955,7 @@ vxge_hw_ring_rxd_post_post(
1955 void *rxdh); 1955 void *rxdh);
1956 1956
1957enum vxge_hw_status 1957enum vxge_hw_status
1958vxge_hw_ring_replenish(struct __vxge_hw_ring *ring_handle, u16 min_flag); 1958vxge_hw_ring_replenish(struct __vxge_hw_ring *ring_handle);
1959 1959
1960void 1960void
1961vxge_hw_ring_rxd_post_post_wmb( 1961vxge_hw_ring_rxd_post_post_wmb(
@@ -2087,7 +2087,6 @@ void vxge_hw_fifo_txdl_free(
2087 2087
2088#define VXGE_HW_RING_NEXT_BLOCK_POINTER_OFFSET (VXGE_HW_BLOCK_SIZE-8) 2088#define VXGE_HW_RING_NEXT_BLOCK_POINTER_OFFSET (VXGE_HW_BLOCK_SIZE-8)
2089#define VXGE_HW_RING_MEMBLOCK_IDX_OFFSET (VXGE_HW_BLOCK_SIZE-16) 2089#define VXGE_HW_RING_MEMBLOCK_IDX_OFFSET (VXGE_HW_BLOCK_SIZE-16)
2090#define VXGE_HW_RING_MIN_BUFF_ALLOCATION 64
2091 2090
2092/* 2091/*
2093 * struct __vxge_hw_ring_rxd_priv - Receive descriptor HW-private data. 2092 * struct __vxge_hw_ring_rxd_priv - Receive descriptor HW-private data.