Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Added a kernel option to change the number of processing...
details: https://anonhg.NetBSD.org/src/rev/2d21ecfbd8ec
branches: trunk
changeset: 1021239:2d21ecfbd8ec
user: yamaguchi <yamaguchi%NetBSD.org@localhost>
date: Wed May 19 03:44:46 2021 +0000
description:
Added a kernel option to change the number of processing packets
at one pppoeintr()
diffstat:
sys/conf/files | 3 ++-
sys/net/if_pppoe.c | 17 +++++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
diffs (76 lines):
diff -r f070fd7d3040 -r 2d21ecfbd8ec sys/conf/files
--- a/sys/conf/files Wed May 19 03:35:27 2021 +0000
+++ b/sys/conf/files Wed May 19 03:44:46 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1283 2021/05/17 04:07:43 yamaguchi Exp $
+# $NetBSD: files,v 1.1284 2021/05/19 03:44:46 yamaguchi Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20171118
@@ -289,6 +289,7 @@
# compression, enable pppd
# packet filtering support
defflag opt_pppoe.h PPPOE_SERVER PPPOE_DEBUG
+defparam opt_pppoe.h PPPOE_DEQUEUE_MAXLEN
defparam opt_sppp.h SPPP_KEEPALIVE_INTERVAL
SPPP_NORECV_TIME
diff -r f070fd7d3040 -r 2d21ecfbd8ec sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c Wed May 19 03:35:27 2021 +0000
+++ b/sys/net/if_pppoe.c Wed May 19 03:44:46 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.175 2021/05/19 03:35:27 yamaguchi Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.176 2021/05/19 03:44:46 yamaguchi Exp $ */
/*
* Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.175 2021/05/19 03:35:27 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.176 2021/05/19 03:44:46 yamaguchi Exp $");
#ifdef _KERNEL_OPT
#include "pppoe.h"
@@ -76,6 +76,10 @@
#define PPPOE_MPSAFE 1
#endif
+#ifndef PPPOE_DEQUEUE_MAXLEN
+#define PPPOE_DEQUEUE_MAXLEN IFQ_MAXLEN
+#endif
+
struct pppoehdr {
uint8_t vertype;
uint8_t code;
@@ -598,7 +602,7 @@
SOFTNET_LOCK_UNLESS_NET_MPSAFE();
- for (i = 0; i < IFQ_MAXLEN; i++) {
+ for (i = 0; i < PPPOE_DEQUEUE_MAXLEN; i++) {
IFQ_LOCK(&ppoediscinq);
IF_DEQUEUE(&ppoediscinq, m);
IFQ_UNLOCK(&ppoediscinq);
@@ -607,7 +611,7 @@
pppoe_disc_input(m);
}
- for (i = 0; i < IFQ_MAXLEN; i++) {
+ for (i = 0; i < PPPOE_DEQUEUE_MAXLEN; i++) {
IFQ_LOCK(&ppoeinq);
IF_DEQUEUE(&ppoeinq, m);
IFQ_UNLOCK(&ppoeinq);
@@ -616,6 +620,11 @@
pppoe_data_input(m);
}
+#if PPPOE_DEQUEUE_MAXLEN < IFQ_MAXLEN
+ if (!IF_IS_EMPTY(&ppoediscinq) || !IF_IS_EMPTY(&ppoeinq))
+ softint_schedule(pppoe_softintr);
+#endif
+
SOFTNET_UNLOCK_UNLESS_NET_MPSAFE();
}
Home |
Main Index |
Thread Index |
Old Index