Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Fix a bug that 8257[56] can't receive packet rep...



details:   https://anonhg.NetBSD.org/src/rev/de52fd4930af
branches:  trunk
changeset: 828290:de52fd4930af
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Dec 07 00:38:38 2017 +0000

description:
Fix a bug that 8257[56] can't receive packet reported by Bert Kiers in
PR#52717. For 82575 and 82576, the RX descriptors must be initialized after
the setting of RCTL.EN in wm_set_filter(). This bug was added in if_wm.c
rev. 1.515.

diffstat:

 sys/dev/pci/if_wm.c |  25 +++++++++++++++----------
 1 files changed, 15 insertions(+), 10 deletions(-)

diffs (62 lines):

diff -r 9802baf22ed6 -r de52fd4930af sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Thu Dec 07 00:22:06 2017 +0000
+++ b/sys/dev/pci/if_wm.c       Thu Dec 07 00:38:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.547 2017/12/06 09:03:12 ozaki-r Exp $      */
+/*     $NetBSD: if_wm.c,v 1.548 2017/12/07 00:38:38 msaitoh Exp $      */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -83,7 +83,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.547 2017/12/06 09:03:12 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.548 2017/12/07 00:38:38 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -5814,6 +5814,14 @@
                break;
        }
 
+       /*
+        * Set the receive filter.
+        *
+        * For 82575 and 82576, the RX descriptors must be initialized after
+        * the setting of RCTL.EN in wm_set_filter()
+        */
+       wm_set_filter(sc);
+
        /* On 575 and later set RDT only if RX enabled */
        if ((sc->sc_flags & WM_F_NEWQUEUE) != 0) {
                int qidx;
@@ -5828,9 +5836,6 @@
                }
        }
 
-       /* Set the receive filter. */
-       wm_set_filter(sc);
-
        wm_unset_stopping_flags(sc);
 
        /* Start the one second link check clock. */
@@ -6688,13 +6693,13 @@
                                return ENOMEM;
                        }
                } else {
+                       /*
+                        * For 82575 and 82576, the RX descriptors must be
+                        * initialized after the setting of RCTL.EN in
+                        * wm_set_filter()
+                        */
                        if ((sc->sc_flags & WM_F_NEWQUEUE) == 0)
                                wm_init_rxdesc(rxq, i);
-                       /*
-                        * For 82575 and newer device, the RX descriptors
-                        * must be initialized after the setting of RCTL.EN in
-                        * wm_set_filter()
-                        */
                }
        }
        rxq->rxq_ptr = 0;



Home | Main Index | Thread Index | Old Index