Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/powerpc/booke/dev Fix rnd(9) support; events were n...
details: https://anonhg.NetBSD.org/src/rev/fef770147c04
branches: trunk
changeset: 961840:fef770147c04
user: rin <rin%NetBSD.org@localhost>
date: Thu Apr 22 01:33:18 2021 +0000
description:
Fix rnd(9) support; events were not sampled actually in the previous.
Remove #if-0'ed and wrap long line for clarity.
diffstat:
sys/arch/powerpc/booke/dev/pq3etsec.c | 27 ++++++++++++---------------
1 files changed, 12 insertions(+), 15 deletions(-)
diffs (83 lines):
diff -r e31a7e56b6ac -r fef770147c04 sys/arch/powerpc/booke/dev/pq3etsec.c
--- a/sys/arch/powerpc/booke/dev/pq3etsec.c Thu Apr 22 01:14:18 2021 +0000
+++ b/sys/arch/powerpc/booke/dev/pq3etsec.c Thu Apr 22 01:33:18 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pq3etsec.c,v 1.52 2021/01/24 05:16:56 rin Exp $ */
+/* $NetBSD: pq3etsec.c,v 1.53 2021/04/22 01:33:18 rin Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.52 2021/01/24 05:16:56 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pq3etsec.c,v 1.53 2021/04/22 01:33:18 rin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1640,14 +1640,14 @@
rxq->rxq_consumer = consumer;
rxq->rxq_inuse -= rxconsumed;
KASSERT(rxq->rxq_inuse == 0);
- return;
+ break;
}
pq3etsec_rxq_desc_postsync(sc, rxq, consumer, 1);
const uint16_t rxbd_flags = consumer->rxbd_flags;
if (rxbd_flags & RXBD_E) {
rxq->rxq_consumer = consumer;
rxq->rxq_inuse -= rxconsumed;
- return;
+ break;
}
KASSERT(rxq->rxq_mconsumer != NULL);
#ifdef ETSEC_DEBUG
@@ -2178,6 +2178,7 @@
struct ifnet * const ifp = &sc->sc_if;
volatile struct txbd *consumer = txq->txq_consumer;
size_t txfree = 0;
+ bool ret;
#if 0
printf("%s: entry: free=%zu\n", __func__, txq->txq_free);
@@ -2189,13 +2190,11 @@
txq->txq_consumer = consumer;
txq->txq_free += txfree;
txq->txq_lastintr -= uimin(txq->txq_lastintr, txfree);
-#if 0
- printf("%s: empty: freed %zu descriptors going form %zu to %zu\n",
- __func__, txfree, txq->txq_free - txfree, txq->txq_free);
-#endif
KASSERT(txq->txq_lastintr == 0);
- KASSERT(txq->txq_free == txq->txq_last - txq->txq_first - 1);
- return true;
+ KASSERT(txq->txq_free ==
+ txq->txq_last - txq->txq_first - 1);
+ ret = true;
+ break;
}
pq3etsec_txq_desc_postsync(sc, txq, consumer, 1);
const uint16_t txbd_flags = consumer->txbd_flags;
@@ -2203,11 +2202,8 @@
txq->txq_consumer = consumer;
txq->txq_free += txfree;
txq->txq_lastintr -= uimin(txq->txq_lastintr, txfree);
-#if 0
- printf("%s: freed %zu descriptors\n",
- __func__, txfree);
-#endif
- return pq3etsec_txq_fillable_p(sc, txq);
+ ret = pq3etsec_txq_fillable_p(sc, txq);
+ break;
}
/*
@@ -2274,6 +2270,7 @@
if (txfree != 0)
rnd_add_uint32(&sc->rnd_source, txfree);
+ return ret;
}
static void
Home |
Main Index |
Thread Index |
Old Index