From 825b7d4c9d1d7cb0c79ffe002bc1bd58f28e1a67 Mon Sep 17 00:00:00 2001 From: "Bjoern A. Zeeb" Date: Wed, 26 May 2021 17:51:24 +0000 Subject: [PATCH] OFED: migrate LinuxKPI net_device/ifnet macros into ofed The LinuxKPI net_device actually is an ifnet; in order to further clean that up so we can extend "net_device" migrate the few macros left into ofed and make sure the header is included in all files which need access to the macros. Sponsored by: The FreeBSD Foundation MFC after: 12 days Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D30477 --- sys/ofed/drivers/infiniband/core/ib_cache.c | 1 + sys/ofed/drivers/infiniband/core/ib_cm.c | 1 + sys/ofed/drivers/infiniband/core/ib_sysfs.c | 1 + sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c | 1 + sys/ofed/include/rdma/ib_addr.h | 7 +++++++ 5 files changed, 11 insertions(+) diff --git a/sys/ofed/drivers/infiniband/core/ib_cache.c b/sys/ofed/drivers/infiniband/core/ib_cache.c index ac6382f69b95..a5bc498303c6 100644 --- a/sys/ofed/drivers/infiniband/core/ib_cache.c +++ b/sys/ofed/drivers/infiniband/core/ib_cache.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "core_priv.h" diff --git a/sys/ofed/drivers/infiniband/core/ib_cm.c b/sys/ofed/drivers/infiniband/core/ib_cm.c index 28c52c0cb2f2..7d5197cc4a0d 100644 --- a/sys/ofed/drivers/infiniband/core/ib_cm.c +++ b/sys/ofed/drivers/infiniband/core/ib_cm.c @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include "cm_msgs.h" diff --git a/sys/ofed/drivers/infiniband/core/ib_sysfs.c b/sys/ofed/drivers/infiniband/core/ib_sysfs.c index 5f848a7a69db..fb9884a7ea08 100644 --- a/sys/ofed/drivers/infiniband/core/ib_sysfs.c +++ b/sys/ofed/drivers/infiniband/core/ib_sysfs.c @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include diff --git a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c index 27f4da93ccba..1e4358ba0a15 100644 --- a/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include MODULE_AUTHOR("Roland Dreier"); diff --git a/sys/ofed/include/rdma/ib_addr.h b/sys/ofed/include/rdma/ib_addr.h index 535e6c2b3b14..cea39f288207 100644 --- a/sys/ofed/include/rdma/ib_addr.h +++ b/sys/ofed/include/rdma/ib_addr.h @@ -51,6 +51,13 @@ #include #include +/* Linux netdevice.h but for working on an ifnet rather than a net_device. */ +#define dev_hold(d) if_ref(d) +#define dev_put(d) if_rele(d) +#define dev_net(d) ((d)->if_vnet) +#define net_eq(a,b) ((a) == (b)) + + struct rdma_addr_client { atomic_t refcount; struct completion comp;