[PATCH 2.6.28] myri10ge: use DCA if DCA is compiled as a module

Previous thread: Re: [Fwd: [PATCH] Spinlock initialisation au1000_eth.c] by Jeff Garzik on Saturday, September 13, 2008 - 12:55 pm. (1 message)

Next thread: [git patches] net driver fixes by Jeff Garzik on Saturday, September 13, 2008 - 1:35 pm. (34 messages)
From: Brice Goglin
Date: Saturday, September 13, 2008 - 1:30 pm

Use DCA in myri10ge when CONFIG_DCA_MODULE is set as well.

Signed-off-by: Brice Goglin <brice@myri.com>
---
 drivers/net/myri10ge/myri10ge.c |   26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

Index: linux-2.6.git/drivers/net/myri10ge/myri10ge.c
===================================================================
--- linux-2.6.git.orig/drivers/net/myri10ge/myri10ge.c	2008-09-13 22:22:12.000000000 +0200
+++ linux-2.6.git/drivers/net/myri10ge/myri10ge.c	2008-09-13 22:23:43.000000000 +0200
@@ -189,7 +189,7 @@
 	dma_addr_t fw_stats_bus;
 	int watchdog_tx_done;
 	int watchdog_tx_req;
-#ifdef CONFIG_DCA
+#if (defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
 	int cached_dca_tag;
 	int cpu;
 	__be32 __iomem *dca_tag;
@@ -221,7 +221,7 @@
 	int msi_enabled;
 	int msix_enabled;
 	struct msix_entry *msix_vectors;
-#ifdef CONFIG_DCA
+#if (defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
 	int dca_enabled;
 #endif
 	u32 link_state;
@@ -905,7 +905,7 @@
 	struct myri10ge_slice_state *ss;
 	int i, status;
 	size_t bytes;
-#ifdef CONFIG_DCA
+#if (defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
 	unsigned long dca_tag_off;
 #endif
 
@@ -1015,7 +1015,7 @@
 	}
 	put_be32(htonl(mgp->intr_coal_delay), mgp->intr_coal_delay_ptr);
 
-#ifdef CONFIG_DCA
+#if (defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
 	status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_DCA_OFFSET, &cmd, 0);
 	dca_tag_off = cmd.data0;
 	for (i = 0; i < mgp->num_slices; i++) {
@@ -1054,7 +1054,7 @@
 	return status;
 }
 
-#ifdef CONFIG_DCA
+#if (defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
 static void
 myri10ge_write_dca(struct myri10ge_slice_state *ss, int cpu, int tag)
 {
@@ -1508,7 +1508,7 @@
 	struct net_device *netdev = ss->mgp->dev;
 	int work_done;
 
-#ifdef CONFIG_DCA
+#if (defined CONFIG_DCA) || (defined CONFIG_DCA_MODULE)
 	if (ss->mgp->dca_enabled)
 		myri10ge_update_dca(ss);
 #endif
@@ -1739,7 +1739,7 @@
 	"tx_boundary", "WC", "irq", "MSI", ...
From: Brice Goglin
Date: Saturday, September 13, 2008 - 1:38 pm

This one misses the Kconfig stuff to prevent DCA=m when myri10ge=y, I'll
resend soon.

Brice

--

Previous thread: Re: [Fwd: [PATCH] Spinlock initialisation au1000_eth.c] by Jeff Garzik on Saturday, September 13, 2008 - 12:55 pm. (1 message)

Next thread: [git patches] net driver fixes by Jeff Garzik on Saturday, September 13, 2008 - 1:35 pm. (34 messages)