Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet Use IFQ_LOCK instead of splnet for if_snd
details: https://anonhg.NetBSD.org/src/rev/db9416d36c67
branches: trunk
changeset: 351430:db9416d36c67
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Mon Feb 13 04:06:39 2017 +0000
description:
Use IFQ_LOCK instead of splnet for if_snd
diffstat:
sys/netinet/ip_output.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diffs (43 lines):
diff -r 43d76a525061 -r db9416d36c67 sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c Mon Feb 13 04:05:58 2017 +0000
+++ b/sys/netinet/ip_output.c Mon Feb 13 04:06:39 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_output.c,v 1.269 2017/01/16 15:14:16 christos Exp $ */
+/* $NetBSD: ip_output.c,v 1.270 2017/02/13 04:06:39 ozaki-r Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.269 2017/01/16 15:14:16 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.270 2017/02/13 04:06:39 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -794,7 +794,6 @@
struct mbuf **mnext;
int sw_csum = m->m_pkthdr.csum_flags;
int fragments = 0;
- int s;
int error = 0;
ip = mtod(m, struct ip *);
@@ -901,14 +900,14 @@
* any of them.
*/
if (ifp != NULL) {
- s = splnet();
+ IFQ_LOCK(&ifp->if_snd);
if (ifp->if_snd.ifq_maxlen - ifp->if_snd.ifq_len < fragments &&
error == 0) {
error = ENOBUFS;
IP_STATINC(IP_STAT_ODROPPED);
IFQ_INC_DROPS(&ifp->if_snd);
}
- splx(s);
+ IFQ_UNLOCK(&ifp->if_snd);
}
if (error) {
for (m = m0; m; m = m0) {
Home |
Main Index |
Thread Index |
Old Index