[ This is a re-post, but the patch still applies and works fine against
the linux-mips.org tip. We'd really like to get this in. -Mark]
This patch completes the NAPI functionality for SB1250 MAC, including making
NAPI a kernel option that can be turned on or off and adds the sbmac_poll
routine.
Signed off by: Mark Mason ([EMAIL PROTECTED])
Signed off by: Dan Krejsa ([EMAIL PROTECTED])
Signed off by: Steve Yang ([EMAIL PROTECTED])
Index: linux-2.6.14-cgl/drivers/net/Kconfig
===
--- linux-2.6.14-cgl.orig/drivers/net/Kconfig 2006-09-20 14:58:54.0
-0700
+++ linux-2.6.14-cgl/drivers/net/Kconfig2006-09-20 17:04:31.0
-0700
@@ -2031,6 +2031,23 @@
tristate SB1250 Ethernet support
depends on SIBYTE_SB1xxx_SOC
+config SBMAC_NAPI
+ bool SBMAC: Use Rx Polling (NAPI) (EXPERIMENTAL)
+ depends on NET_SB1250_MAC EXPERIMENTAL
+ help
+ NAPI is a new driver API designed to reduce CPU and interrupt load
+ when the driver is receiving lots of packets from the card. It is
+ still somewhat experimental and thus not yet enabled by default.
+
+ If your estimated Rx load is 10kpps or more, or if the card will be
+ deployed on potentially unfriendly networks (e.g. in a firewall),
+ then say Y here.
+
+ See file:Documentation/networking/NAPI_HOWTO.txt for more
+ information.
+
+ If in doubt, say y.
+
config R8169_VLAN
bool VLAN support
depends on R8169 VLAN_8021Q
@@ -2826,3 +2843,5 @@
def_bool NETPOLL
endmenu
+
+
Index: linux-2.6.14-cgl/drivers/net/sb1250-mac.c
===
--- linux-2.6.14-cgl.orig/drivers/net/sb1250-mac.c 2006-09-20
14:59:00.0 -0700
+++ linux-2.6.14-cgl/drivers/net/sb1250-mac.c 2006-09-20 20:16:27.0
-0700
@@ -95,19 +95,28 @@
#endif
#ifdef CONFIG_SBMAC_COALESCE
-static int int_pktcnt = 0;
-module_param(int_pktcnt, int, S_IRUGO);
-MODULE_PARM_DESC(int_pktcnt, Packet count);
-
-static int int_timeout = 0;
-module_param(int_timeout, int, S_IRUGO);
-MODULE_PARM_DESC(int_timeout, Timeout value);
+static int int_pktcnt_tx = 255;
+module_param(int_pktcnt_tx, int, S_IRUGO);
+MODULE_PARM_DESC(int_pktcnt_tx, TX packet count);
+
+static int int_timeout_tx = 255;
+module_param(int_timeout_tx, int, S_IRUGO);
+MODULE_PARM_DESC(int_timeout_tx, TX timeout value);
+
+static int int_pktcnt_rx = 64;
+module_param(int_pktcnt_rx, int, S_IRUGO);
+MODULE_PARM_DESC(int_pktcnt_rx, RX packet count);
+
+static int int_timeout_rx = 64;
+module_param(int_timeout_rx, int, S_IRUGO);
+MODULE_PARM_DESC(int_timeout_rx, RX timeout value);
#endif
#include asm/sibyte/sb1250.h
#if defined(CONFIG_SIBYTE_BCM1x55) || defined(CONFIG_SIBYTE_BCM1x80)
#include asm/sibyte/bcm1480_regs.h
#include asm/sibyte/bcm1480_int.h
+#define R_MAC_DMA_OODPKTLOST_RXR_MAC_DMA_OODPKTLOST
#elif defined(CONFIG_SIBYTE_SB1250) || defined(CONFIG_SIBYTE_BCM112X)
#include asm/sibyte/sb1250_regs.h
#include asm/sibyte/sb1250_int.h
@@ -155,8 +164,8 @@
#define NUMCACHEBLKS(x) (((x)+SMP_CACHE_BYTES-1)/SMP_CACHE_BYTES)
-#define SBMAC_MAX_TXDESCR 32
-#define SBMAC_MAX_RXDESCR 32
+#define SBMAC_MAX_TXDESCR 256
+#define SBMAC_MAX_RXDESCR 256
#define ETHER_ALIGN2
#define ETHER_ADDR_LEN 6
@@ -185,10 +194,10 @@
* associated with it.
*/
- struct sbmac_softc *sbdma_eth; /* back pointer to associated
MAC */
- int sbdma_channel; /* channel number */
+ struct sbmac_softc *sbdma_eth; /* back pointer to associated MAC */
+ int sbdma_channel; /* channel number */
int sbdma_txdir; /* direction (1=transmit) */
- int sbdma_maxdescr;/* total # of descriptors in
ring */
+ int sbdma_maxdescr;/* total # of descriptors in ring */
#ifdef CONFIG_SBMAC_COALESCE
int sbdma_int_pktcnt; /* # descriptors rx/tx before
interrupt*/
int sbdma_int_timeout; /* # usec rx/tx interrupt */
@@ -197,13 +206,16 @@
volatile void __iomem *sbdma_config0; /* DMA config register 0 */
volatile void __iomem *sbdma_config1; /* DMA config register 1 */
volatile void __iomem *sbdma_dscrbase; /* Descriptor base address */
- volatile void __iomem *sbdma_dscrcnt; /* Descriptor count register
*/
+ volatile void __iomem *sbdma_dscrcnt; /* Descriptor count register */
volatile void __iomem *sbdma_curdscr; /* current descriptor address */
+ volatile void __iomem *sbdma_oodpktlost;/* pkt drop (rx only) */
+
/*
* This stuff is for maintenance of the ring
*/
+ sbdmadscr_t *sbdma_dscrtable_unaligned;
sbdmadscr_t *sbdma_dscrtable; /* base of