Date: Wed, 27 Jan 2016 00:20:07 +0000 (UTC) From: Gleb Smirnoff <glebius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r294867 - in head/sys: net netinet Message-ID: <201601270020.u0R0K7Ed024149@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: glebius Date: Wed Jan 27 00:20:07 2016 New Revision: 294867 URL: https://svnweb.freebsd.org/changeset/base/294867 Log: Provide TCPSTAT_DEC() and TCPSTAT_FETCH() macros. Modified: head/sys/net/vnet.h head/sys/netinet/tcp_var.h Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Wed Jan 27 00:12:58 2016 (r294866) +++ head/sys/net/vnet.h Wed Jan 27 00:20:07 2016 (r294867) @@ -101,6 +101,9 @@ struct vnet { #define VNET_PCPUSTAT_ADD(type, name, f, v) \ counter_u64_add(VNET(name)[offsetof(type, f) / sizeof(uint64_t)], (v)) +#define VNET_PCPUSTAT_FETCH(type, name, f) \ + counter_u64_fetch(VNET(name)[offsetof(type, f) / sizeof(uint64_t)]) + #define VNET_PCPUSTAT_SYSINIT(name) \ static void \ vnet_##name##_init(const void *unused) \ Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Wed Jan 27 00:12:58 2016 (r294866) +++ head/sys/netinet/tcp_var.h Wed Jan 27 00:20:07 2016 (r294867) @@ -605,6 +605,9 @@ VNET_PCPUSTAT_DECLARE(struct tcpstat, tc #define TCPSTAT_ADD(name, val) \ VNET_PCPUSTAT_ADD(struct tcpstat, tcpstat, name, (val)) #define TCPSTAT_INC(name) TCPSTAT_ADD(name, 1) +#define TCPSTAT_DEC(name) TCPSTAT_ADD(name, -1) +#define TCPSTAT_FETCH(name) VNET_PCPUSTAT_FETCH(struct tcpstat, tcpstat, \ + name) /* * Kernel module consumers must use this accessor macro.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201601270020.u0R0K7Ed024149>