Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Remove extra unlock/lock processing around if_pe...



details:   https://anonhg.NetBSD.org/src/rev/f16df5d3f39e
branches:  trunk
changeset: 953212:f16df5d3f39e
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Mon Mar 01 04:49:11 2021 +0000

description:
Remove extra unlock/lock processing around if_percpuq_enqueue().

This temporary unlock/lock processing was required for direct calling
ifp->if_input.  After r1.391, wm(4) uses if_percpuq_enqueue() and it
does not hold any mutexes.

diffstat:

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

diffs (40 lines):

diff -r d29c861e5b68 -r f16df5d3f39e sys/dev/pci/if_wm.c
--- a/sys/dev/pci/if_wm.c       Mon Mar 01 04:43:54 2021 +0000
+++ b/sys/dev/pci/if_wm.c       Mon Mar 01 04:49:11 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_wm.c,v 1.699 2021/02/17 08:15:43 knakahara Exp $    */
+/*     $NetBSD: if_wm.c,v 1.700 2021/03/01 04:49:11 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.699 2021/02/17 08:15:43 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_wm.c,v 1.700 2021/03/01 04:49:11 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -9332,20 +9332,13 @@
 
                /* Set up checksum info for this packet. */
                wm_rxdesc_ensure_checksum(rxq, status, errors, m);
-               /*
-                * Update the receive pointer holding rxq_lock consistent with
-                * increment counter.
-                */
+
                rxq->rxq_ptr = i;
                rxq->rxq_packets++;
                rxq->rxq_bytes += len;
-               mutex_exit(rxq->rxq_lock);
-
                /* Pass it on. */
                if_percpuq_enqueue(sc->sc_ipq, m);
 
-               mutex_enter(rxq->rxq_lock);
-
                if (rxq->rxq_stopping)
                        break;
        }



Home | Main Index | Thread Index | Old Index