From bc1a52eaea694d234d6777adbe57e2b79d1815c9 Mon Sep 17 00:00:00 2001 From: Mark Einon Date: Thu, 20 Oct 2011 01:18:46 +0100 Subject: [PATCH] --- yaml --- r: 268871 b: refs/heads/master c: 06709e962322eb565f1e5ce591df7efb3db07c1f h: refs/heads/master i: 268869: 03e3ec397e01ad467e6ae6665b1f3077ecfcb01e 268867: b3f9844fea9301e73a61903993b46e53af7d6557 268863: 50832266f73db7dc85216fcad144e5cb689f6893 v: v3 --- [refs] | 2 +- trunk/drivers/staging/et131x/README | 1 - trunk/drivers/staging/et131x/et131x.c | 13 ++++++------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index 093fabe3699b..c66a113a6525 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 26d19bf60be3a41bbd6c31d89d13a9c5e8edef8b +refs/heads/master: 06709e962322eb565f1e5ce591df7efb3db07c1f diff --git a/trunk/drivers/staging/et131x/README b/trunk/drivers/staging/et131x/README index 0928eb55fee1..3458aa713a33 100644 --- a/trunk/drivers/staging/et131x/README +++ b/trunk/drivers/staging/et131x/README @@ -9,7 +9,6 @@ driver as they did not build properly at the time. TODO: - Use of kmem_cache seems a bit unusual - - It's too late stopping the tx queue when there is no room for the current packet. The condition should be detected for the next packet. Please send patches to: Greg Kroah-Hartman diff --git a/trunk/drivers/staging/et131x/et131x.c b/trunk/drivers/staging/et131x/et131x.c index cc41111b7b70..993f93ac35ee 100644 --- a/trunk/drivers/staging/et131x/et131x.c +++ b/trunk/drivers/staging/et131x/et131x.c @@ -3448,9 +3448,7 @@ static int send_packet(struct sk_buff *skb, struct et131x_adapter *adapter) int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev) { int status = 0; - struct et131x_adapter *adapter = NULL; - - adapter = netdev_priv(netdev); + struct et131x_adapter *adapter = netdev_priv(netdev); /* Send these packets * @@ -5347,6 +5345,11 @@ static void et131x_multicast(struct net_device *netdev) static int et131x_tx(struct sk_buff *skb, struct net_device *netdev) { int status = 0; + struct et131x_adapter *adapter = netdev_priv(netdev); + + /* stop the queue if it's getting full */ + if(adapter->tx_ring.used >= NUM_TCB - 1 && !netif_queue_stopped(netdev)) + netif_stop_queue(netdev); /* Save the timestamp for the TX timeout watchdog */ netdev->trans_start = jiffies; @@ -5357,10 +5360,6 @@ static int et131x_tx(struct sk_buff *skb, struct net_device *netdev) /* Check status and manage the netif queue if necessary */ if (status != 0) { if (status == -ENOMEM) { - /* Put the queue to sleep until resources are - * available - */ - netif_stop_queue(netdev); status = NETDEV_TX_BUSY; } else { status = NETDEV_TX_OK;