tg3: Futureproof the loopback test
authorMatt Carlson <mcarlson@broadcom.com>
Thu, 30 Sep 2010 10:34:34 +0000 (10:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Oct 2010 07:24:43 +0000 (00:24 -0700)
There are other multiqueue modes 5717 and 5719 devices can assume.  This
patch makes sure that the loopback test is safe, should those other
modes be enabled in the future.

Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Reviewed-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/tg3.c

index 3b275663bbd82169aa0240f0c3cb176ed0a9f6b2..3c9f95dd61e0172b1318fffb2c9a65a1ba00b7ff 100644 (file)
@@ -10647,7 +10647,8 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
        tnapi = &tp->napi[0];
        rnapi = &tp->napi[0];
        if (tp->irq_cnt > 1) {
-               rnapi = &tp->napi[1];
+               if (tp->tg3_flags3 & TG3_FLG3_ENABLE_RSS)
+                       rnapi = &tp->napi[1];
                if (tp->tg3_flags3 & TG3_FLG3_ENABLE_TSS)
                        tnapi = &tp->napi[1];
        }