Module Name: src
Committed By: ozaki-r
Date: Thu Jan 25 02:45:02 UTC 2018
Modified Files:
src/sys/net: bpf.c bpfdesc.h
Log Message:
Abandon unnecessary softint
The softint was introduced to defer fownsignal that was called in bpf_wakeup to
softint at v1.139, but now bpf_wakeup always runs in softint so we don't need
the softint anymore.
To generate a diff of this commit:
cvs rdiff -u -r1.222 -r1.223 src/sys/net/bpf.c
cvs rdiff -u -r1.44 -r1.45 src/sys/net/bpfdesc.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/bpf.c
diff -u src/sys/net/bpf.c:1.222 src/sys/net/bpf.c:1.223
--- src/sys/net/bpf.c:1.222 Fri Dec 15 07:29:11 2017
+++ src/sys/net/bpf.c Thu Jan 25 02:45:02 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bpf.c,v 1.222 2017/12/15 07:29:11 ozaki-r Exp $ */
+/* $NetBSD: bpf.c,v 1.223 2018/01/25 02:45:02 ozaki-r Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.222 2017/12/15 07:29:11 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.223 2018/01/25 02:45:02 ozaki-r Exp $");
#if defined(_KERNEL_OPT)
#include "opt_bpf.h"
@@ -268,7 +268,6 @@ static int bpf_poll(struct file *, int);
static int bpf_stat(struct file *, struct stat *);
static int bpf_close(struct file *);
static int bpf_kqfilter(struct file *, struct knote *);
-static void bpf_softintr(void *);
static const struct fileops bpf_fileops = {
.fo_name = "bpf",
@@ -563,8 +562,6 @@ bpfopen(dev_t dev, int flag, int mode, s
d->bd_atime = d->bd_mtime = d->bd_btime;
callout_init(&d->bd_callout, CALLOUT_MPSAFE);
selinit(&d->bd_sel);
- d->bd_sih = softint_establish(SOFTINT_CLOCK|SOFTINT_MPSAFE,
- bpf_softintr, d);
d->bd_jitcode = NULL;
d->bd_filter = NULL;
BPF_DLIST_ENTRY_INIT(d);
@@ -621,7 +618,6 @@ bpf_close(struct file *fp)
bpf_freed(d);
callout_destroy(&d->bd_callout);
seldestroy(&d->bd_sel);
- softint_disestablish(d->bd_sih);
mutex_obj_free(d->bd_mtx);
mutex_obj_free(d->bd_buf_mtx);
cv_destroy(&d->bd_cv);
@@ -756,20 +752,8 @@ bpf_wakeup(struct bpf_d *d)
mutex_exit(d->bd_buf_mtx);
if (d->bd_async)
- softint_schedule(d->bd_sih);
- selnotify(&d->bd_sel, 0, 0);
-}
-
-static void
-bpf_softintr(void *cookie)
-{
- struct bpf_d *d;
-
- d = cookie;
- mutex_enter(d->bd_mtx);
- if (d->bd_async)
fownsignal(d->bd_pgid, SIGIO, 0, 0, NULL);
- mutex_exit(d->bd_mtx);
+ selnotify(&d->bd_sel, 0, 0);
}
static void
Index: src/sys/net/bpfdesc.h
diff -u src/sys/net/bpfdesc.h:1.44 src/sys/net/bpfdesc.h:1.45
--- src/sys/net/bpfdesc.h:1.44 Thu Feb 9 09:30:26 2017
+++ src/sys/net/bpfdesc.h Thu Jan 25 02:45:02 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: bpfdesc.h,v 1.44 2017/02/09 09:30:26 ozaki-r Exp $ */
+/* $NetBSD: bpfdesc.h,v 1.45 2018/01/25 02:45:02 ozaki-r Exp $ */
/*
* Copyright (c) 1990, 1991, 1993
@@ -113,6 +113,7 @@ struct bpf_d {
pid_t bd_pid; /* corresponding PID */
/* DEPRECATED. Keep it to avoid breaking kvm(3) users */
LIST_ENTRY(bpf_d) _bd_list; /* list of all BPF's */
+ /* DEPRECATED. Keep it to avoid breaking kvm(3) users */
void *bd_sih; /* soft interrupt handle */
struct timespec bd_atime; /* access time */
struct timespec bd_mtime; /* modification time */