Source-Changes-HG archive

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

[src/trunk]: src Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.



details:   https://anonhg.NetBSD.org/src/rev/682ff5fbd2f4
branches:  trunk
changeset: 371991:682ff5fbd2f4
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Mon Oct 24 08:11:24 2022 +0000

description:
Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.

diffstat:

 sys/altq/if_altq.h              |   6 +++---
 sys/net/if.c                    |  12 ++++++------
 sys/net/if.h                    |   4 ++--
 sys/net80211/ieee80211_output.c |  11 ++++++-----
 usr.bin/netstat/if.c            |   9 ++++-----
 usr.bin/netstat/main.c          |   6 +++---
 6 files changed, 24 insertions(+), 24 deletions(-)

diffs (181 lines):

diff -r 88b561bb7a68 -r 682ff5fbd2f4 sys/altq/if_altq.h
--- a/sys/altq/if_altq.h        Mon Oct 24 07:45:44 2022 +0000
+++ b/sys/altq/if_altq.h        Mon Oct 24 08:11:24 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_altq.h,v 1.15 2016/04/20 08:58:48 knakahara Exp $   */
+/*     $NetBSD: if_altq.h,v 1.16 2022/10/24 08:11:24 msaitoh Exp $     */
 /*     $KAME: if_altq.h,v 1.12 2005/04/13 03:44:25 suz Exp $   */
 
 /*
@@ -44,8 +44,8 @@
        struct  mbuf *ifq_tail;
        int     ifq_len;
        int     ifq_maxlen;
-       int     ifq_drops;
-       kmutex_t        *ifq_lock;
+       uint64_t ifq_drops;
+       kmutex_t *ifq_lock;
 
        /* alternate queueing related fields */
        int     altq_type;              /* discipline type */
diff -r 88b561bb7a68 -r 682ff5fbd2f4 sys/net/if.c
--- a/sys/net/if.c      Mon Oct 24 07:45:44 2022 +0000
+++ b/sys/net/if.c      Mon Oct 24 08:11:24 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.526 2022/09/20 02:23:37 knakahara Exp $       */
+/*     $NetBSD: if.c,v 1.527 2022/10/24 08:11:25 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.526 2022/09/20 02:23:37 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.527 2022/10/24 08:11:25 msaitoh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -940,7 +940,7 @@
 if_percpuq_drops(void *p, void *arg, struct cpu_info *ci __unused)
 {
        struct ifqueue *const ifq = p;
-       int *sum = arg;
+       uint64_t *sum = arg;
 
        *sum += ifq->ifq_drops;
 }
@@ -950,7 +950,7 @@
 {
        struct sysctlnode node;
        struct if_percpuq *ipq;
-       int sum = 0;
+       uint64_t sum = 0;
        int error;
 
        node = *rnode;
@@ -1017,7 +1017,7 @@
 
        if (sysctl_createv(clog, 0, &rnode, &cnode,
                       CTLFLAG_PERMANENT,
-                      CTLTYPE_INT, "drops",
+                      CTLTYPE_QUAD, "drops",
                       SYSCTL_DESCR("Total packets dropped due to full input queue"),
                       sysctl_percpuq_drops_handler, 0, (void *)ipq, 0,
                       CTL_CREATE, CTL_EOL) != 0)
@@ -4031,7 +4031,7 @@
 
        if (sysctl_createv(clog, 0, &rnode, &cnode,
                       CTLFLAG_PERMANENT,
-                      CTLTYPE_INT, "drops",
+                      CTLTYPE_QUAD, "drops",
                       SYSCTL_DESCR("Packets dropped due to full output queue"),
                       NULL, 0, &ifq->ifq_drops, 0,
                       CTL_CREATE, CTL_EOL) != 0)
diff -r 88b561bb7a68 -r 682ff5fbd2f4 sys/net/if.h
--- a/sys/net/if.h      Mon Oct 24 07:45:44 2022 +0000
+++ b/sys/net/if.h      Mon Oct 24 08:11:24 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.302 2022/09/18 16:58:54 martin Exp $  */
+/*     $NetBSD: if.h,v 1.303 2022/10/24 08:11:25 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -241,7 +241,7 @@
        struct          mbuf *ifq_tail;
        int             ifq_len;
        int             ifq_maxlen;
-       int             ifq_drops;
+       uint64_t        ifq_drops;
        kmutex_t        *ifq_lock;
 };
 
diff -r 88b561bb7a68 -r 682ff5fbd2f4 sys/net80211/ieee80211_output.c
--- a/sys/net80211/ieee80211_output.c   Mon Oct 24 07:45:44 2022 +0000
+++ b/sys/net80211/ieee80211_output.c   Mon Oct 24 08:11:24 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ieee80211_output.c,v 1.66 2021/07/24 21:31:38 andvar Exp $     */
+/*     $NetBSD: ieee80211_output.c,v 1.67 2022/10/24 08:11:25 msaitoh Exp $    */
 
 /*
  * Copyright (c) 2001 Atsushi Onoe
@@ -37,7 +37,7 @@
 __FBSDID("$FreeBSD: src/sys/net80211/ieee80211_output.c,v 1.34 2005/08/10 16:22:29 sam Exp $");
 #endif
 #ifdef __NetBSD__
-__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.66 2021/07/24 21:31:38 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ieee80211_output.c,v 1.67 2022/10/24 08:11:25 msaitoh Exp $");
 #endif
 
 #ifdef _KERNEL_OPT
@@ -2133,9 +2133,10 @@
                IEEE80211_NODE_SAVEQ_UNLOCK(ni);
 
                IEEE80211_DPRINTF(ic, IEEE80211_MSG_ANY,
-                       "[%s] pwr save q overflow, drops %d (size %d)\n",
-                       ether_sprintf(ni->ni_macaddr), 
-                       ni->ni_savedq.ifq_drops, IEEE80211_PS_MAX_QUEUE);
+                   "[%s] pwr save q overflow, drops %" PRIu64
+                   " (size %d)\n",
+                   ether_sprintf(ni->ni_macaddr), 
+                   ni->ni_savedq.ifq_drops, IEEE80211_PS_MAX_QUEUE);
 #ifdef IEEE80211_DEBUG
                if (ieee80211_msg_dumppkts(ic))
                        ieee80211_dump_pkt(mtod(m, void *), m->m_len, -1, -1);
diff -r 88b561bb7a68 -r 682ff5fbd2f4 usr.bin/netstat/if.c
--- a/usr.bin/netstat/if.c      Mon Oct 24 07:45:44 2022 +0000
+++ b/usr.bin/netstat/if.c      Mon Oct 24 08:11:24 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.105 2022/09/21 07:59:19 msaitoh Exp $ */
+/*     $NetBSD: if.c,v 1.106 2022/10/24 08:11:25 msaitoh Exp $ */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "from: @(#)if.c 8.2 (Berkeley) 2/21/94";
 #else
-__RCSID("$NetBSD: if.c,v 1.105 2022/09/21 07:59:19 msaitoh Exp $");
+__RCSID("$NetBSD: if.c,v 1.106 2022/10/24 08:11:25 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -685,9 +685,8 @@
                        (unsigned long long)ifd->ifi_collisions);
        }
        if (dflag)
-               printf(" %6lld", ifnet ?
-                   (unsigned long long)ifnet->if_snd.ifq_drops :
-                       dext->ifi_oqdrops);
+               printf(" %6" PRIu64, ifnet ?
+                   ifnet->if_snd.ifq_drops : dext->ifi_oqdrops);
        if (tflag)
                printf(" %4d", ifnet ? ifnet->if_timer : 0);
        putchar('\n');
diff -r 88b561bb7a68 -r 682ff5fbd2f4 usr.bin/netstat/main.c
--- a/usr.bin/netstat/main.c    Mon Oct 24 07:45:44 2022 +0000
+++ b/usr.bin/netstat/main.c    Mon Oct 24 08:11:24 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.103 2022/09/02 06:25:43 msaitoh Exp $       */
+/*     $NetBSD: main.c,v 1.104 2022/10/24 08:11:25 msaitoh Exp $       */
 
 /*
  * Copyright (c) 1983, 1988, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "from: @(#)main.c       8.4 (Berkeley) 3/1/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.103 2022/09/02 06:25:43 msaitoh Exp $");
+__RCSID("$NetBSD: main.c,v 1.104 2022/10/24 08:11:25 msaitoh Exp $");
 #endif
 #endif /* not lint */
 
@@ -778,7 +778,7 @@
                printf("%s:\n", siq->siq_name);
                printf("\tqueue length: %d\n", ifq->ifq_len);
                printf("\tmaximum queue length: %d\n", ifq->ifq_maxlen);
-               printf("\tpackets dropped: %d\n", ifq->ifq_drops);
+               printf("\tpackets dropped: %" PRIu64 "\n", ifq->ifq_drops);
        }
 }
 



Home | Main Index | Thread Index | Old Index