aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/vxge/vxge-traffic.c
diff options
context:
space:
mode:
authorBenjamin LaHaise <ben.lahaise@neterion.com>2009-08-04 06:21:03 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-05 16:10:43 -0400
commitff67df55f6bde9de5e508bf1f09509c843accd54 (patch)
treef859b2b598762fd914bc3a79e38cf306fadd1894 /drivers/net/vxge/vxge-traffic.c
parent4403b371888d5947ed08200ee6351441a188a5c7 (diff)
vxge: fix pktgen hangs (don't abuse skb->cb[])
This patch fixes a case in the transmit completion code which was resulting in pktgen hanging at the end of a run. The cause is due to the fact that the ->cb[] area of an skb cannot be used in a network driver's transmit path, as that area belongs to the network protocol. Pktgen hangs, as it sends out the same packet multiple times, and vxge's use of this area of the skb for a temporary list can only add the packet to the temporary list once (while it may be on the queue many times). The fix is to remove this abuse of skb->cb[]. Instead, skb pointers are placed into a temporary stack array, and then free outside of the tx lock. This retains the smp optimization of doing dev_kfree_skb() outside of the tx lock. Signed-off-by: Benjamin LaHaise <ben.lahaise@neterion.com> 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/vxge-traffic.c')
-rw-r--r--drivers/net/vxge/vxge-traffic.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/net/vxge/vxge-traffic.c b/drivers/net/vxge/vxge-traffic.c
index 370f55cbbad7..c249cd25a5d0 100644
--- a/drivers/net/vxge/vxge-traffic.c
+++ b/drivers/net/vxge/vxge-traffic.c
@@ -2508,7 +2508,8 @@ enum vxge_hw_status vxge_hw_vpath_poll_rx(struct __vxge_hw_ring *ring)
2508 * See also: vxge_hw_vpath_poll_tx(). 2508 * See also: vxge_hw_vpath_poll_tx().
2509 */ 2509 */
2510enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo, 2510enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo,
2511 void **skb_ptr) 2511 struct sk_buff ***skb_ptr, int nr_skb,
2512 int *more)
2512{ 2513{
2513 enum vxge_hw_fifo_tcode t_code; 2514 enum vxge_hw_fifo_tcode t_code;
2514 void *first_txdlh; 2515 void *first_txdlh;
@@ -2520,8 +2521,8 @@ enum vxge_hw_status vxge_hw_vpath_poll_tx(struct __vxge_hw_fifo *fifo,
2520 status = vxge_hw_fifo_txdl_next_completed(fifo, 2521 status = vxge_hw_fifo_txdl_next_completed(fifo,
2521 &first_txdlh, &t_code); 2522 &first_txdlh, &t_code);
2522 if (status == VXGE_HW_OK) 2523 if (status == VXGE_HW_OK)
2523 if (fifo->callback(fifo, first_txdlh, 2524 if (fifo->callback(fifo, first_txdlh, t_code,
2524 t_code, channel->userdata, skb_ptr) != VXGE_HW_OK) 2525 channel->userdata, skb_ptr, nr_skb, more) != VXGE_HW_OK)
2525 status = VXGE_HW_COMPLETIONS_REMAIN; 2526 status = VXGE_HW_COMPLETIONS_REMAIN;
2526 2527
2527 return status; 2528 return status;