Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Fix missing kpreempt_disable() before softint_schedu...



details:   https://anonhg.NetBSD.org/src/rev/1551648a326b
branches:  trunk
changeset: 455397:1551648a326b
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Wed Oct 16 06:53:34 2019 +0000

description:
Fix missing kpreempt_disable() before softint_schedule() like if_vmx.c:r1.51.

diffstat:

 sys/net/if_gre.c  |   9 ++++++---
 sys/net/if_l2tp.c |   6 ++++--
 sys/net/if_tap.c  |  14 ++++++++++----
 3 files changed, 20 insertions(+), 9 deletions(-)

diffs (103 lines):

diff -r dc9a968fec0e -r 1551648a326b sys/net/if_gre.c
--- a/sys/net/if_gre.c  Wed Oct 16 06:36:00 2019 +0000
+++ b/sys/net/if_gre.c  Wed Oct 16 06:53:34 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gre.c,v 1.175 2019/04/26 11:51:56 pgoyette Exp $ */
+/*     $NetBSD: if_gre.c,v 1.176 2019/10/16 06:53:34 knakahara Exp $ */
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.175 2019/04/26 11:51:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gre.c,v 1.176 2019/10/16 06:53:34 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_atalk.h"
@@ -964,8 +964,11 @@
        if ((error = gre_bufq_enqueue(&sc->sc_snd, m)) != 0) {
                sc->sc_oflow_ev.ev_count++;
                m_freem(m);
-       } else
+       } else {
+               kpreempt_disable();
                softint_schedule(sc->sc_si);
+               kpreempt_enable();
+       }
 
 end:
        if (error)
diff -r dc9a968fec0e -r 1551648a326b sys/net/if_l2tp.c
--- a/sys/net/if_l2tp.c Wed Oct 16 06:36:00 2019 +0000
+++ b/sys/net/if_l2tp.c Wed Oct 16 06:53:34 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_l2tp.c,v 1.39 2019/09/19 06:09:52 knakahara Exp $   */
+/*     $NetBSD: if_l2tp.c,v 1.40 2019/10/16 06:53:34 knakahara Exp $   */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.39 2019/09/19 06:09:52 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.40 2019/10/16 06:53:34 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -673,7 +673,9 @@
        if (var->lv_psrc == NULL || var->lv_pdst == NULL)
                return;
 
+       kpreempt_disable();
        softint_schedule(sc->l2tp_si);
+       kpreempt_enable();
        l2tp_putref_variant(var, &psref);
 }
 
diff -r dc9a968fec0e -r 1551648a326b sys/net/if_tap.c
--- a/sys/net/if_tap.c  Wed Oct 16 06:36:00 2019 +0000
+++ b/sys/net/if_tap.c  Wed Oct 16 06:53:34 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_tap.c,v 1.113 2019/05/29 10:07:30 msaitoh Exp $     */
+/*     $NetBSD: if_tap.c,v 1.114 2019/10/16 06:53:34 knakahara Exp $   */
 
 /*
  *  Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation.
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.113 2019/05/29 10:07:30 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.114 2019/10/16 06:53:34 knakahara Exp $");
 
 #if defined(_KERNEL_OPT)
 
@@ -533,8 +533,11 @@
                ifp->if_flags |= IFF_OACTIVE;
                cv_broadcast(&sc->sc_cv);
                selnotify(&sc->sc_rsel, 0, 1);
-               if (sc->sc_flags & TAP_ASYNCIO)
+               if (sc->sc_flags & TAP_ASYNCIO) {
+                       kpreempt_disable();
                        softint_schedule(sc->sc_sih);
+                       kpreempt_enable();
+               }
        }
 done:
        mutex_exit(&sc->sc_lock);
@@ -643,8 +646,11 @@
        ifp->if_flags &= ~IFF_RUNNING;
        cv_broadcast(&sc->sc_cv);
        selnotify(&sc->sc_rsel, 0, 1);
-       if (sc->sc_flags & TAP_ASYNCIO)
+       if (sc->sc_flags & TAP_ASYNCIO) {
+               kpreempt_disable();
                softint_schedule(sc->sc_sih);
+               kpreempt_enable();
+       }
        mutex_exit(&sc->sc_lock);
 }
 



Home | Main Index | Thread Index | Old Index