summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/bundle.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-06-11 02:30:51 +0000
committerbrian <brian@FreeBSD.org>2000-06-11 02:30:51 +0000
commit41ff0cf69369bdc738ed42d51e7cda113ff55624 (patch)
tree19d65876345c30efb0c75dc3d31df574dba4046c /usr.sbin/ppp/bundle.c
parent588124d70f7f4ecbb19857e53505887e8132a593 (diff)
downloadFreeBSD-src-41ff0cf69369bdc738ed42d51e7cda113ff55624.zip
FreeBSD-src-41ff0cf69369bdc738ed42d51e7cda113ff55624.tar.gz
Add ``set ifqueue'' to control the size of the outgoing packet
queue. Doing ``set ifqueue 0'' and ``set urgent none'' will allow full use of luigi's WF2Q code. Requested by: luigi
Diffstat (limited to 'usr.sbin/ppp/bundle.c')
-rw-r--r--usr.sbin/ppp/bundle.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/ppp/bundle.c b/usr.sbin/ppp/bundle.c
index 5c3011c..66efa93 100644
--- a/usr.sbin/ppp/bundle.c
+++ b/usr.sbin/ppp/bundle.c
@@ -440,6 +440,7 @@ bundle_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
struct bundle *bundle = descriptor2bundle(d);
struct datalink *dl;
int result, nlinks;
+ u_short ifqueue;
size_t queued;
result = 0;
@@ -454,7 +455,8 @@ bundle_UpdateSet(struct fdescriptor *d, fd_set *r, fd_set *w, fd_set *e, int *n)
if (r && (bundle->phase == PHASE_NETWORK ||
bundle->phys_type.all & PHYS_AUTO)) {
/* enough surplus so that we can tell if we're getting swamped */
- if (queued < 30) {
+ ifqueue = nlinks > bundle->cfg.ifqueue ? nlinks : bundle->cfg.ifqueue;
+ if (queued < ifqueue) {
/* Not enough - select() for more */
if (bundle->choked.timer.state == TIMER_RUNNING)
timer_Stop(&bundle->choked.timer); /* Not needed any more */
@@ -806,6 +808,7 @@ bundle_Create(const char *prefix, int type, int unit)
OPT_THROUGHPUT | OPT_UTMP;
*bundle.cfg.label = '\0';
bundle.cfg.mtu = DEF_MTU;
+ bundle.cfg.ifqueue = DEF_IFQUEUE;
bundle.cfg.choked.timeout = CHOKED_TIMEOUT;
bundle.phys_type.all = type;
bundle.phys_type.open = 0;
@@ -1156,8 +1159,10 @@ bundle_ShowStatus(struct cmdargs const *arg)
prompt_Printf(arg->prompt, ", up time %d:%02d:%02d", secs / 3600,
(secs / 60) % 60, secs % 60);
}
+ prompt_Printf(arg->prompt, "\n Queued: %u of %u\n",
+ ip_QueueLen(&arg->bundle->ncp.ipcp), arg->bundle->cfg.ifqueue);
- prompt_Printf(arg->prompt, "\n\nDefaults:\n");
+ prompt_Printf(arg->prompt, "\nDefaults:\n");
prompt_Printf(arg->prompt, " Label: %s\n", arg->bundle->cfg.label);
prompt_Printf(arg->prompt, " Auth name: %s\n",
arg->bundle->cfg.auth.name);
OpenPOWER on IntegriCloud