Make ifq_drops in struct ifqueue and struct ifaltq 64 bit.

This commit is contained in:
msaitoh 2022-10-24 08:11:24 +00:00
parent d130a40a15
commit 926e2913c5
6 changed files with 24 additions and 24 deletions

View File

@ -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 ifaltq {
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 */

View File

@ -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 @@ static void
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 @@ sysctl_percpuq_drops_handler(SYSCTLFN_ARGS)
{
struct sysctlnode node;
struct if_percpuq *ipq;
int sum = 0;
uint64_t sum = 0;
int error;
node = *rnode;
@ -1017,7 +1017,7 @@ sysctl_percpuq_setup(struct sysctllog **clog, const char* ifname,
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 @@ sysctl_sndq_setup(struct sysctllog **clog, const char *ifname,
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)

View File

@ -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 ifqueue {
struct mbuf *ifq_tail;
int ifq_len;
int ifq_maxlen;
int ifq_drops;
uint64_t ifq_drops;
kmutex_t *ifq_lock;
};

View File

@ -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_pwrsave(struct ieee80211com *ic, struct ieee80211_node *ni,
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);

View File

@ -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 @@ print_addr(const int ifindex, struct sockaddr *sa, struct sockaddr **rtinfo,
(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');

View File

@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\
#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 @@ print_softintrq(void)
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);
}
}