Module Name: src
Committed By: mrg
Date: Sun Jun 9 20:30:36 UTC 2024
Modified Files:
src/doc: TODO.smpnet
src/sys/external/bsd/ipf/netinet: ip_fil_netbsd.c
Log Message:
ipfilter(4): mark as MPSAFE.
my testing seems to work fine, and this version was known to work
on solaris with no global locking available.
To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/doc/TODO.smpnet
cvs rdiff -u -r1.38 -r1.39 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/doc/TODO.smpnet
diff -u src/doc/TODO.smpnet:1.48 src/doc/TODO.smpnet:1.49
--- src/doc/TODO.smpnet:1.48 Wed Apr 24 06:44:18 2024
+++ src/doc/TODO.smpnet Sun Jun 9 20:30:35 2024
@@ -1,4 +1,4 @@
-$NetBSD: TODO.smpnet,v 1.48 2024/04/24 06:44:18 nia Exp $
+$NetBSD: TODO.smpnet,v 1.49 2024/06/09 20:30:35 mrg Exp $
MP-safe components
==================
@@ -58,6 +58,7 @@ kernel option. Some components scale up
- vlan(4)
- Packet filters
- npf(7)
+ - ipf(4)
- Others
- bpf(4)
- ipsec(4)
@@ -106,7 +107,6 @@ Unprotected ones
- stf(4)
- if_srt
- Packet filters
- - ipf(4)
- pf(4)
- Others
- AppleTalk (sys/netatalk/)
Index: src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c
diff -u src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.38 src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.39
--- src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c:1.38 Sat Jun 24 05:16:15 2023
+++ src/sys/external/bsd/ipf/netinet/ip_fil_netbsd.c Sun Jun 9 20:30:36 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_fil_netbsd.c,v 1.38 2023/06/24 05:16:15 msaitoh Exp $ */
+/* $NetBSD: ip_fil_netbsd.c,v 1.39 2024/06/09 20:30:36 mrg Exp $ */
/*
* Copyright (C) 2012 by Darren Reed.
@@ -8,7 +8,7 @@
#if !defined(lint)
#if defined(__NetBSD__)
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.38 2023/06/24 05:16:15 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_fil_netbsd.c,v 1.39 2024/06/09 20:30:36 mrg Exp $");
#else
static const char sccsid[] = "@(#)ip_fil.c 2.41 6/5/96 (C) 1993-2000 Darren Reed";
static const char rcsid[] = "@(#)Id: ip_fil_netbsd.c,v 1.1.1.2 2012/07/22 13:45:17 darrenr Exp";
@@ -159,6 +159,9 @@ const struct cdevsw ipl_cdevsw = {
.d_discard = nodiscard,
#ifdef D_OTHER
.d_flag = D_OTHER
+# if __NetBSD_Version__ >= 799003200
+ | D_MPSAFE
+# endif
#else
.d_flag = 0
#endif
@@ -1346,9 +1349,13 @@ sendorfree:
m0 = m->m_act;
m->m_act = 0;
if (error == 0) {
+# if __NetBSD_Version__ >= 799003200
+ error = if_output_lock(ifp, ifp, m, dst, rt);
+# else
KERNEL_LOCK(1, NULL);
error = (*ifp->if_output)(ifp, m, dst, rt);
KERNEL_UNLOCK_ONE(NULL);
+# endif
} else {
FREE_MB_T(m);
}