Skip to contentSkip to conversation

gianfar: Fix a filer bug

PATCH In review Sandeep Gopalpet 3 participants 3 messages Dec 9, 2009 – Dec 11, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gianfar: Fix a filer bug

We need to enable filer whenever we need to use multiple RX queues. Also, need to program RIR0 register with the required distribution we require, if using RX filer hashing support for packet distribution to multiple queues.

---
 drivers/net/gianfar.c |    8 +++++++-
 drivers/net/gianfar.h |    4 ++++
 2 files changed, 11 insertions(+), 1 deletions(-)
drivers/net/gianfar.c +7 -1
index 6850dc0..73ccb07 100644
@@ -357,8 +357,11 @@ static void gfar_init_mac(struct net_device *ndev)
 	/* Configure the coalescing support */
 	gfar_configure_coalescing(priv, 0xFF, 0xFF);
 
-	if (priv->rx_filer_enable)
+	if (priv->rx_filer_enable) {
 		rctrl |= RCTRL_FILREN;
+		/* Program the RIR0 reg with the required distribution */
+		regs->rir0 = DEFAULT_RIR0;
+	}
 
 	if (priv->rx_csum_enable)
 		rctrl |= RCTRL_CHECKSUMMING;
@@ -1022,6 +1025,9 @@ static int gfar_probe(struct of_device *ofdev,
 		priv->rx_queue[i]->rxic = DEFAULT_RXIC;
 	}
 
+	/* enable filer if using multiple RX queues*/
+	if(priv->num_rx_queues > 1)
+		priv->rx_filer_enable = 1;
 	/* Enable most messages by default */
 	priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
 
drivers/net/gianfar.h +4 -0
index cbb4510..68d16dc 100644
@@ -401,6 +401,10 @@ extern const char gfar_driver_version[];
 #define FPR_FILER_MASK	0xFFFFFFFF
 #define MAX_FILER_IDX	0xFF
 
+/* This default RIR value directly corresponds
+ * to the 3-bit hash value generated */
+#define DEFAULT_RIR0	0x05397700
+
 /* RQFCR register bits */
 #define RQFCR_GPI		0x80000000
 #define RQFCR_HASHTBL_Q		0x00000000
Signature · 1 line
1.5.6.5
#1 lore raw
Quoted 7 lines · Sandeep Gopalpet

We need to enable filer whenever we need to use multiple RX queues. Also, need to program RIR0 register with the required distribution we require, if using RX filer hashing support for packet distribution to multiple queues.

---

[...]

drivers/net/gianfar.c static void gfar_init_mac(struct net_device *ndev) · line 363

Quoted 5 lines
drivers/net/gianfar.c +3 -1
-	if (priv->rx_filer_enable)
+	if (priv->rx_filer_enable) {
 		rctrl |= RCTRL_FILREN;
+		/* Program the RIR0 reg with the required distribution */
+		regs->rir0 = DEFAULT_RIR0;

You cannot access regs directly. You have to use gfar_write since regs is ioremapped memory.

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2
#2 lore raw
Quoted 7 lines

[...]

drivers/net/gianfar.c static void gfar_init_mac(struct net_device *ndev)

Quoted 4 lines
drivers/net/gianfar.c +2 -1
-	if (priv->rx_filer_enable)
+	if (priv->rx_filer_enable) {
 		rctrl |= RCTRL_FILREN;
+		/* Program the RIR0 reg with the required 

distribution */

Quoted 5 lines

drivers/net/gianfar.c static void gfar_init_mac(struct net_device *ndev) · line 363

Quoted 1 line
drivers/net/gianfar.c +1 -0
+		regs->rir0 = DEFAULT_RIR0;

You cannot access regs directly. You have to use gfar_write since regs is ioremapped memory.

Yes. I will send out the patch with the required change.

--

Thanks
Sandeep