Page MenuHomeFreeBSD

D36872.diff
No OneTemporary

D36872.diff

diff --git a/sys/net/if.c b/sys/net/if.c
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -1692,19 +1692,6 @@
return (counter_u64_fetch(ifp->if_counters[cnt]));
}
-/*
- * Increase an ifnet counter. Usually used for counters shared
- * between the stack and a driver, but function supports them all.
- */
-void
-if_inc_counter(struct ifnet *ifp, ift_counter cnt, int64_t inc)
-{
-
- KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt));
-
- counter_u64_add(ifp->if_counters[cnt], inc);
-}
-
/*
* Copy data from ifnet to userland API structure if_data.
*/
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -724,7 +724,18 @@
void if_deregister_com_alloc(u_char type);
void if_data_copy(struct ifnet *, struct if_data *);
uint64_t if_get_counter_default(struct ifnet *, ift_counter);
-void if_inc_counter(struct ifnet *, ift_counter, int64_t);
+
+/*
+ * Increase an ifnet counter. Usually used for counters shared
+ * between the stack and a driver, but function supports them all.
+ */
+static __inline void
+if_inc_counter(struct ifnet *ifp, ift_counter cnt, int64_t inc)
+{
+ KASSERT(cnt < IFCOUNTERS, ("%s: invalid cnt %d", __func__, cnt));
+
+ counter_u64_add(ifp->if_counters[cnt], inc);
+}
#define IF_LLADDR(ifp) \
LLADDR((struct sockaddr_dl *)((ifp)->if_addr->ifa_addr))

File Metadata

Mime Type
text/plain
Expires
Wed, Sep 9, 9:20 AM (3 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38557708
Default Alt Text
D36872.diff (1 KB)

Event Timeline