From patchwork Sun Oct 20 18:13:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tino Reichardt X-Patchwork-Id: 285025 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 915F32C00A8 for ; Mon, 21 Oct 2013 05:13:39 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751421Ab3JTSNg (ORCPT ); Sun, 20 Oct 2013 14:13:36 -0400 Received: from lotte.svc-box.de ([80.252.109.10]:45384 "EHLO lotte.svc-box.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751350Ab3JTSNe (ORCPT ); Sun, 20 Oct 2013 14:13:34 -0400 Received: from localhost (unknown [127.0.0.1]) by lotte.svc-box.de (Postfix) with ESMTP id EAE361480BAC; Sun, 20 Oct 2013 18:13:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at lotte.svc-box.de Received: from lotte.svc-box.de ([127.0.0.1]) by localhost (lotte.svc-box.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lLCs1IlprfD9; Sun, 20 Oct 2013 20:13:31 +0200 (CEST) Received: from vostro (p4FDD511F.dip0.t-ipconnect.de [79.221.81.31]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: tino@internethauptknotenpunkt.de) by lotte.svc-box.de (Postfix) with ESMTPSA id CBAFD1480B9D; Sun, 20 Oct 2013 20:13:29 +0200 (CEST) Received: by vostro (sSMTP sendmail emulation); Sun, 20 Oct 2013 20:13:29 +0200 From: Tino Reichardt To: netdev@vger.kernel.org, Grant Grundler Subject: [PATCH net-next v2 03/07] tulip: Support for byte queue limits Date: Sun, 20 Oct 2013 20:13:19 +0200 Message-Id: <1382292803-18875-4-git-send-email-milky-kernel@mcmilk.de> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1382292803-18875-1-git-send-email-milky-kernel@mcmilk.de> References: <1382292803-18875-1-git-send-email-milky-kernel@mcmilk.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Changes to tulip driver to use byte queue limits. Signed-off-by: Tino Reichardt --- drivers/net/ethernet/dec/tulip/interrupt.c | 4 ++++ drivers/net/ethernet/dec/tulip/tulip.h | 1 + drivers/net/ethernet/dec/tulip/tulip_core.c | 9 ++++++++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/dec/tulip/interrupt.c b/drivers/net/ethernet/dec/tulip/interrupt.c index 92306b3..7084267 100644 --- a/drivers/net/ethernet/dec/tulip/interrupt.c +++ b/drivers/net/ethernet/dec/tulip/interrupt.c @@ -532,6 +532,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) #endif unsigned int work_count = tulip_max_interrupt_work; unsigned int handled = 0; + unsigned int bytes_compl = 0; /* Let's see whether the interrupt really is for us */ csr5 = ioread32(ioaddr + CSR5); @@ -634,6 +635,7 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) PCI_DMA_TODEVICE); /* Free the original skb. */ + bytes_compl += tp->tx_buffers[entry].skb->len; dev_kfree_skb_irq(tp->tx_buffers[entry].skb); tp->tx_buffers[entry].skb = NULL; tp->tx_buffers[entry].mapping = 0; @@ -802,6 +804,8 @@ irqreturn_t tulip_interrupt(int irq, void *dev_instance) } #endif /* CONFIG_TULIP_NAPI */ + if (likely(tulip_bql_disable == false)) + netdev_completed_queue(dev, tx, bytes_compl); if ((missed = ioread32(ioaddr + CSR8) & 0x1ffff)) { dev->stats.rx_dropped += missed & 0x10000 ? 0x10000 : missed; } diff --git a/drivers/net/ethernet/dec/tulip/tulip.h b/drivers/net/ethernet/dec/tulip/tulip.h index 38431a1..3c62870 100644 --- a/drivers/net/ethernet/dec/tulip/tulip.h +++ b/drivers/net/ethernet/dec/tulip/tulip.h @@ -513,6 +513,7 @@ void comet_timer(unsigned long data); /* tulip_core.c */ extern int tulip_debug; +extern bool tulip_bql_disable; extern const char * const medianame[]; extern const char tulip_media_cap[]; extern struct tulip_chip_table tulip_tbl[]; diff --git a/drivers/net/ethernet/dec/tulip/tulip_core.c b/drivers/net/ethernet/dec/tulip/tulip_core.c index 4e8cfa2..d02eaa1 100644 --- a/drivers/net/ethernet/dec/tulip/tulip_core.c +++ b/drivers/net/ethernet/dec/tulip/tulip_core.c @@ -106,11 +106,13 @@ static int csr0 = 0x00A00000 | 0x4800; /* Time in jiffies before concluding the transmitter is hung. */ #define TX_TIMEOUT (4*HZ) - MODULE_AUTHOR("The Linux Kernel Team"); MODULE_DESCRIPTION("Digital 21*4* Tulip ethernet driver"); MODULE_LICENSE("GPL"); MODULE_VERSION(DRV_VERSION); +module_param(tulip_bql_disable, bool, 0); +MODULE_PARM_DESC(tulip_bql_disable, + "Disable Byte Queue Limits functionality (default: false)"); module_param(tulip_debug, int, 0); module_param(max_interrupt_work, int, 0); module_param(rx_copybreak, int, 0); @@ -123,6 +125,7 @@ int tulip_debug = TULIP_DEBUG; #else int tulip_debug = 1; #endif +bool tulip_bql_disable; static void tulip_timer(unsigned long data) { @@ -703,6 +706,8 @@ tulip_start_xmit(struct sk_buff *skb, struct net_device *dev) wmb(); tp->cur_tx++; + if (likely(tulip_bql_disable == false)) + netdev_sent_queue(dev, skb->len); /* Trigger an immediate transmit demand. */ iowrite32(0, tp->base_addr + CSR1); @@ -746,6 +751,8 @@ static void tulip_clean_tx_ring(struct tulip_private *tp) tp->tx_buffers[entry].skb = NULL; tp->tx_buffers[entry].mapping = 0; } + if (likely(tulip_bql_disable == false)) + netdev_reset_queue(tp->dev); } static void tulip_down (struct net_device *dev)