gianfar: Fix a filer bug
authorSandeep Gopalpet <sandeep.kumar@freescale.com>
Wed, 16 Dec 2009 01:14:58 +0000 (01:14 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 19 Dec 2009 04:38:36 +0000 (20:38 -0800)
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.

Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/gianfar.c
drivers/net/gianfar.h

index 6850dc0a7b9194c34807762eccb2d7d04a4a007c..1616531a71f7bf20af431338d98f6ce8a4e110df 100644 (file)
@@ -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 */
+               gfar_write(&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;
 
index cbb451011cb5475ecf61cfebfcd014d6bdb67a87..68d16dc6e7c8ccf08a48c88d1afe274b92e0686d 100644 (file)
@@ -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