Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751656AbYCMHOB (ORCPT ); Thu, 13 Mar 2008 03:14:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753360AbYCMHNf (ORCPT ); Thu, 13 Mar 2008 03:13:35 -0400 Received: from stargate.chelsio.com ([12.22.49.110]:8033 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752966AbYCMHNe (ORCPT ); Thu, 13 Mar 2008 03:13:34 -0400 From: Divy Le Ray Subject: [PATCH 2.6.25] - Fix transmit queue stop mechanism To: jeff@garzik.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, swise@opengridcomputing.com Date: Thu, 13 Mar 2008 00:13:30 -0700 Message-ID: <20080313071330.10331.66058.stgit@speedy5> User-Agent: StGIT/0.12 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1727 Lines: 53 From: Divy Le Ray The last change in the Tx queue stop mechanism opens a window where the Tx queue might be stopped after pending credits returned. Tx credits are returned via a control message generated by the HW. It returns tx credits on demand, triggered by a completion bit set in selective transmit packet headers. The current code can lead to the Tx queue stopped with all pending credits returned, and the current frame not triggering a credit return. The Tx queue will then never be awaken. The driver could alternatively request a completion for packets that stop the queue. It's however safer at this point to go back to the pre-existing behaviour. Signed-off-by: Divy Le Ray --- drivers/net/cxgb3/sge.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/cxgb3/sge.c b/drivers/net/cxgb3/sge.c index 979f3fc..db58687 100644 --- a/drivers/net/cxgb3/sge.c +++ b/drivers/net/cxgb3/sge.c @@ -1107,9 +1107,15 @@ int t3_eth_xmit(struct sk_buff *skb, struct net_device *dev) } q->in_use += ndesc; - if (unlikely(credits - ndesc < q->stop_thres)) - if (USE_GTS || !should_restart_tx(q)) - t3_stop_queue(dev, qs, q); + if (unlikely(credits - ndesc < q->stop_thres)) { + t3_stop_queue(dev, qs, q); + + if (should_restart_tx(q) && + test_and_clear_bit(TXQ_ETH, &qs->txq_stopped)) { + q->restarts++; + netif_wake_queue(dev); + } + } gen = q->gen; q->unacked += ndesc; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/