Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/net Pull up following revision(s) (requested by msait...



details:   https://anonhg.NetBSD.org/src/rev/953bc2e4318f
branches:  netbsd-9
changeset: 963084:953bc2e4318f
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Oct 08 17:02:24 2019 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #292):

        sys/net/if_ethersubr.c: revision 1.277
        sys/net/if_ethersubr.c: revision 1.278

Increment if_iqdrops when dropping an oversized frame.

 -

Print oversized frame's message only when DIAGNOSTIC is set. The message
is not so important because we increment if_iqdrops now.

diffstat:

 sys/net/if_ethersubr.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (57 lines):

diff -r 97d5a2b8ab53 -r 953bc2e4318f sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c    Tue Oct 08 16:56:37 2019 +0000
+++ b/sys/net/if_ethersubr.c    Tue Oct 08 17:02:24 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ethersubr.c,v 1.276 2019/07/17 03:26:24 msaitoh Exp $       */
+/*     $NetBSD: if_ethersubr.c,v 1.276.2.1 2019/10/08 17:02:24 martin Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.276 2019/07/17 03:26:24 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.276.2.1 2019/10/08 17:02:24 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -164,10 +164,12 @@
 #include <netmpls/mpls_var.h>
 #endif
 
+#ifdef DIAGNOSTIC
 static struct timeval bigpktppslim_last;
 static int bigpktppslim = 2;   /* XXX */
 static int bigpktpps_count;
 static kmutex_t bigpktpps_lock __cacheline_aligned;
+#endif
 
 const uint8_t etherbroadcastaddr[ETHER_ADDR_LEN] =
     { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
@@ -612,6 +614,7 @@
         */
        if (etype != ETHERTYPE_MPLS && m->m_pkthdr.len >
            ETHER_MAX_FRAME(ifp, etype, m->m_flags & M_HASFCS)) {
+#ifdef DIAGNOSTIC
                mutex_enter(&bigpktpps_lock);
                if (ppsratecheck(&bigpktppslim_last, &bigpktpps_count,
                    bigpktppslim)) {
@@ -619,6 +622,8 @@
                            ifp->if_xname, m->m_pkthdr.len);
                }
                mutex_exit(&bigpktpps_lock);
+#endif
+               ifp->if_iqdrops++;
                m_freem(m);
                return;
        }
@@ -1717,6 +1722,8 @@
 etherinit(void)
 {
 
+#ifdef DIAGNOSTIC
        mutex_init(&bigpktpps_lock, MUTEX_DEFAULT, IPL_NET);
+#endif
        ether_sysctl_setup(NULL);
 }



Home | Main Index | Thread Index | Old Index