git: 22bf2a479f68 - main - netmap: get rid of WNA() macro
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 11 Mar 2023 17:19:46 UTC
The branch main has been updated by vmaffione: URL: https://cgit.FreeBSD.org/src/commit/?id=22bf2a479f68d5a5b8c002a9103d95f3c7547067 commit 22bf2a479f68d5a5b8c002a9103d95f3c7547067 Author: Vincenzo Maffione <vmaffione@FreeBSD.org> AuthorDate: 2023-03-11 17:19:01 +0000 Commit: Vincenzo Maffione <vmaffione@FreeBSD.org> CommitDate: 2023-03-11 17:19:40 +0000 netmap: get rid of WNA() macro MFC after: 7 days --- sys/dev/netmap/netmap_generic.c | 4 ---- sys/dev/netmap/netmap_kern.h | 9 ++++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/sys/dev/netmap/netmap_generic.c b/sys/dev/netmap/netmap_generic.c index 038d6efc33f5..77c56c74df65 100644 --- a/sys/dev/netmap/netmap_generic.c +++ b/sys/dev/netmap/netmap_generic.c @@ -1034,10 +1034,6 @@ generic_netmap_dtor(struct netmap_adapter *na) nm_prinf("Native netmap adapter for %s restored", prev_na->name); } NM_RESTORE_NA(ifp, prev_na); - /* - * netmap_detach_common(), that it's called after this function, - * overrides WNA(ifp) if na->ifp is not NULL. - */ na->ifp = NULL; nm_prinf("Emulated netmap adapter for %s destroyed", na->name); } diff --git a/sys/dev/netmap/netmap_kern.h b/sys/dev/netmap/netmap_kern.h index b4c7e4c83f6b..c34733f912fd 100644 --- a/sys/dev/netmap/netmap_kern.h +++ b/sys/dev/netmap/netmap_kern.h @@ -110,8 +110,6 @@ #define NM_ATOMIC_TEST_AND_SET(p) (!atomic_cmpset_acq_int((p), 0, 1)) #define NM_ATOMIC_CLEAR(p) atomic_store_rel_int((p), 0) -#define WNA(_ifp) if_getnetmapadapter(_ifp) - struct netmap_adapter *netmap_getna(if_t ifp); #define MBUF_REFCNT(m) ((m)->m_ext.ext_count) @@ -1690,13 +1688,14 @@ extern int netmap_generic_txqdisc; /* * NA returns a pointer to the struct netmap adapter from the ifp. - * WNA is os-specific and must be defined in glue code. + * The if_getnetmapadapter() and if_setnetmapadapter() helpers are + * os-specific and must be defined in glue code. */ -#define NA(_ifp) ((struct netmap_adapter *)WNA(_ifp)) +#define NA(_ifp) (if_getnetmapadapter(_ifp)) /* * we provide a default implementation of NM_ATTACH_NA/NM_DETACH_NA - * based on the WNA field. + * based on the if_setnetmapadapter() setter function. * Glue code may override this by defining its own NM_ATTACH_NA */ #ifndef NM_ATTACH_NA