Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Refactor rxq->rxq_ptr updating.



details:   https://anonhg.NetBSD.org/src/rev/a17f3e11bf48
branches:  trunk
changeset: 959928:a17f3e11bf48
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Mon Mar 01 04:50:17 2021 +0000

description:
Refactor rxq->rxq_ptr updating.

diffstat:

 sys/dev/pci/if_wm.c |  12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diffs (54 lines):

diff -r 5377b1073948 -r a17f3e11bf48 sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Mon Mar 01 04:49:11 2021 +0000
+++ b/sys/dev/pci/if_wm.c       Mon Mar 01 04:50:17 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.700 2021/03/01 04:49:11 knakahara Exp $    */
+/*     $NetBSD: if_wm.c,v 1.701 2021/03/01 04:50:17 knakahara Exp $    */
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -82,7 +82,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.700 2021/03/01 04:49:11 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.701 2021/03/01 04:50:17 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -9177,7 +9177,6 @@
 
        for (i = rxq->rxq_ptr;; i = WM_NEXTRX(i)) {
                if (limit-- == 0) {
-                       rxq->rxq_ptr = i;
                        more = true;
                        DPRINTF(sc, WM_DEBUG_RX,
                            ("%s: RX: loop limited, descriptor %d is not processed\n",
@@ -9203,11 +9202,6 @@
 #endif
 
                if (!wm_rxdesc_dd(rxq, i, status)) {
-                       /*
-                        * Update the receive pointer holding rxq_lock
-                        * consistent with increment counter.
-                        */
-                       rxq->rxq_ptr = i;
                        break;
                }
 
@@ -9333,7 +9327,6 @@
                /* Set up checksum info for this packet. */
                wm_rxdesc_ensure_checksum(rxq, status, errors, m);
 
-               rxq->rxq_ptr = i;
                rxq->rxq_packets++;
                rxq->rxq_bytes += len;
                /* Pass it on. */
@@ -9342,6 +9335,7 @@
                if (rxq->rxq_stopping)
                        break;
        }
+       rxq->rxq_ptr = i;
 
        if (count != 0)
                rnd_add_uint32(&sc->rnd_source, count);



Home | Main Index | Thread Index | Old Index