Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jul 2021 00:36:46 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b9e51ecb5a47 - stable/13 - mlx4/OFED: replace the struct net_device with struct ifnet
Message-ID:  <202107180036.16I0akHn049564@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=b9e51ecb5a477ed5b0c3e9c67f09472ed6d0a46a

commit b9e51ecb5a477ed5b0c3e9c67f09472ed6d0a46a
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2021-06-04 15:36:08 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2021-07-18 00:35:03 +0000

    mlx4/OFED: replace the struct net_device with struct ifnet
    
    Given all the code does operate on struct ifnet, the last step in this
    longer series of changes now is to rename struct net_device to
    struct ifnet (that is what it was defined to in the LinuxKPi code).
    While mlx4 and OFED are "shared" code the decision was made years ago
    to not write it based on the netdevice KPI but the native ifnet KPI
    for most of it.  This commit simply spells this out and with that
    frees "struct netdevice" to be re-done on LinuxKPI to become a more
    native/mixed implementation over time as needed by, e.g., wireless
    drivers.
    
    Sponsored by:   The FreeBSD Foundation
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D30515
    
    (cherry picked from commit 1411f52facc2b955584f2cb453b912a903e319ed)
---
 sys/dev/mlx4/mlx4_en/en.h                          | 30 ++++++-------
 sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c              | 50 +++++++++++-----------
 sys/dev/mlx4/mlx4_en/mlx4_en_port.c                |  4 +-
 sys/dev/mlx4/mlx4_en/mlx4_en_resources.c           |  2 +-
 sys/dev/mlx4/mlx4_en/mlx4_en_rx.c                  |  6 +--
 sys/dev/mlx4/mlx4_en/mlx4_en_tx.c                  |  6 +--
 sys/dev/mlx4/mlx4_ib/mlx4_ib.h                     |  2 +-
 sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c                | 22 +++++-----
 sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c                |  2 +-
 sys/ofed/drivers/infiniband/core/core_priv.h       | 10 ++---
 sys/ofed/drivers/infiniband/core/ib_addr.c         |  8 ++--
 sys/ofed/drivers/infiniband/core/ib_cache.c        | 16 +++----
 sys/ofed/drivers/infiniband/core/ib_cm.c           |  2 +-
 sys/ofed/drivers/infiniband/core/ib_cma.c          | 44 +++++++++----------
 sys/ofed/drivers/infiniband/core/ib_device.c       | 10 ++---
 sys/ofed/drivers/infiniband/core/ib_multicast.c    |  2 +-
 .../drivers/infiniband/core/ib_roce_gid_mgmt.c     | 24 +++++------
 sys/ofed/drivers/infiniband/core/ib_sa_query.c     |  6 +--
 sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c | 14 +++---
 sys/ofed/include/rdma/ib_addr.h                    | 12 +++---
 sys/ofed/include/rdma/ib_cache.h                   |  4 +-
 sys/ofed/include/rdma/ib_sa.h                      |  4 +-
 sys/ofed/include/rdma/ib_verbs.h                   | 10 ++---
 23 files changed, 145 insertions(+), 145 deletions(-)

diff --git a/sys/dev/mlx4/mlx4_en/en.h b/sys/dev/mlx4/mlx4_en/en.h
index e63027bc9dc0..4a8b4fbd5fd4 100644
--- a/sys/dev/mlx4/mlx4_en/en.h
+++ b/sys/dev/mlx4/mlx4_en/en.h
@@ -385,7 +385,7 @@ struct mlx4_en_cq {
 	struct mlx4_hwq_resources wqres;
 	int                     ring;
 	spinlock_t              lock;
-	struct net_device      *dev;
+	struct ifnet      *dev;
         /* Per-core Tx cq processing support */
         struct timer_list timer;
 	int size;
@@ -445,7 +445,7 @@ struct mlx4_en_dev {
 	struct mlx4_dev		*dev;
 	struct pci_dev		*pdev;
 	struct mutex		state_lock;
-	struct net_device	*pndev[MLX4_MAX_PORTS + 1];
+	struct ifnet		*pndev[MLX4_MAX_PORTS + 1];
 	u32			port_cnt;
 	bool			device_up;
 	struct mlx4_en_profile	profile;
@@ -536,7 +536,7 @@ struct en_port {
 struct mlx4_en_priv {
 	struct mlx4_en_dev *mdev;
 	struct mlx4_en_port_profile *prof;
-	struct net_device *dev;
+	struct ifnet *dev;
 	unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
 	struct mlx4_en_port_state port_state;
 	spinlock_t stats_lock;
@@ -655,7 +655,7 @@ struct mlx4_mac_entry {
 };
 
 static inline void *
-netdev_priv(const struct net_device *dev)
+netdev_priv(const struct ifnet *dev)
 {
 	return (dev->if_softc);
 }
@@ -709,7 +709,7 @@ static inline bool mlx4_en_cq_lock_poll(struct mlx4_en_cq *cq)
 	int rc = true;
 	spin_lock_bh(&cq->poll_lock);
 	if ((cq->state & MLX4_CQ_LOCKED)) {
-		struct net_device *dev = cq->dev;
+		struct ifnet *dev = cq->dev;
 		struct mlx4_en_priv *priv = netdev_priv(dev);
 		struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring];
 
@@ -778,12 +778,12 @@ static inline bool mlx4_en_cq_busy_polling(struct mlx4_en_cq *cq)
 
 #define MLX4_EN_WOL_DO_MODIFY (1ULL << 63)
 
-void mlx4_en_destroy_netdev(struct net_device *dev);
+void mlx4_en_destroy_netdev(struct ifnet *dev);
 int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 			struct mlx4_en_port_profile *prof);
 
-int mlx4_en_start_port(struct net_device *dev);
-void mlx4_en_stop_port(struct net_device *dev);
+int mlx4_en_start_port(struct ifnet *dev);
+void mlx4_en_stop_port(struct ifnet *dev);
 
 void mlx4_en_free_resources(struct mlx4_en_priv *priv);
 int mlx4_en_alloc_resources(struct mlx4_en_priv *priv);
@@ -799,7 +799,7 @@ int mlx4_en_set_cq_moder(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
 int mlx4_en_arm_cq(struct mlx4_en_priv *priv, struct mlx4_en_cq *cq);
 
 void mlx4_en_tx_irq(struct mlx4_cq *mcq);
-u16 mlx4_en_select_queue(struct net_device *dev, struct mbuf *mb);
+u16 mlx4_en_select_queue(struct ifnet *dev, struct mbuf *mb);
 
 int mlx4_en_xmit(struct mlx4_en_priv *priv, int tx_ind, struct mbuf **mbp);
 int mlx4_en_transmit(struct ifnet *dev, struct mbuf *m);
@@ -826,7 +826,7 @@ void mlx4_en_rx_que(void *context, int pending);
 int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv);
 void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv,
 				struct mlx4_en_rx_ring *ring);
-int mlx4_en_process_rx_cq(struct net_device *dev,
+int mlx4_en_process_rx_cq(struct ifnet *dev,
 			  struct mlx4_en_cq *cq,
 			  int budget);
 void mlx4_en_poll_tx_cq(unsigned long data);
@@ -836,7 +836,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
 void mlx4_en_sqp_event(struct mlx4_qp *qp, enum mlx4_event event);
 int mlx4_en_map_buffer(struct mlx4_buf *buf);
 void mlx4_en_unmap_buffer(struct mlx4_buf *buf);
-void mlx4_en_calc_rx_buf(struct net_device *dev);
+void mlx4_en_calc_rx_buf(struct ifnet *dev);
 
 const u32 *mlx4_en_get_rss_key(struct mlx4_en_priv *priv, u16 *keylen);
 u8 mlx4_en_get_rss_mask(struct mlx4_en_priv *priv);
@@ -844,7 +844,7 @@ int mlx4_en_config_rss_steer(struct mlx4_en_priv *priv);
 void mlx4_en_release_rss_steer(struct mlx4_en_priv *priv);
 int mlx4_en_create_drop_qp(struct mlx4_en_priv *priv);
 void mlx4_en_destroy_drop_qp(struct mlx4_en_priv *priv);
-int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring);
+int mlx4_en_free_tx_buf(struct ifnet *dev, struct mlx4_en_tx_ring *ring);
 void mlx4_en_rx_irq(struct mlx4_cq *mcq);
 
 int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, struct mlx4_en_priv *priv);
@@ -862,7 +862,7 @@ extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_ops;
 extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_pfc_ops;
 #endif
 
-int mlx4_en_setup_tc(struct net_device *dev, u8 up);
+int mlx4_en_setup_tc(struct ifnet *dev, u8 up);
 
 #ifdef CONFIG_RFS_ACCEL
 void mlx4_en_cleanup_filters(struct mlx4_en_priv *priv,
@@ -870,7 +870,7 @@ void mlx4_en_cleanup_filters(struct mlx4_en_priv *priv,
 #endif
 
 #define MLX4_EN_NUM_SELF_TEST	5
-void mlx4_en_ex_selftest(struct net_device *dev, u32 *flags, u64 *buf);
+void mlx4_en_ex_selftest(struct ifnet *dev, u32 *flags, u64 *buf);
 void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev);
 
 /*
@@ -882,7 +882,7 @@ void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev);
 u64 mlx4_en_get_cqe_ts(struct mlx4_cqe *cqe);
 
 /* Functions for caching and restoring statistics */
-int mlx4_en_get_sset_count(struct net_device *dev, int sset);
+int mlx4_en_get_sset_count(struct ifnet *dev, int sset);
 void mlx4_en_restore_ethtool_stats(struct mlx4_en_priv *priv,
 				    u64 *data);
 
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
index b36afc66d476..eec620f5b90e 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_netdev.c
@@ -64,7 +64,7 @@ static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv);
 static int mlx4_en_low_latency_recv(struct napi_struct *napi)
 {
 	struct mlx4_en_cq *cq = container_of(napi, struct mlx4_en_cq, napi);
-	struct net_device *dev = cq->dev;
+	struct ifnet *dev = cq->dev;
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring];
 	int done;
@@ -288,7 +288,7 @@ mlx4_en_filter_find(struct mlx4_en_priv *priv, __be32 src_ip, __be32 dst_ip,
 }
 
 static int
-mlx4_en_filter_rfs(struct net_device *net_dev, const struct sk_buff *skb,
+mlx4_en_filter_rfs(struct ifnet *net_dev, const struct sk_buff *skb,
 		   u16 rxq_index, u32 flow_id)
 {
 	struct mlx4_en_priv *priv = netdev_priv(net_dev);
@@ -400,7 +400,7 @@ static void mlx4_en_filter_rfs_expire(struct mlx4_en_priv *priv)
 }
 #endif
 
-static void mlx4_en_vlan_rx_add_vid(void *arg, struct net_device *dev, u16 vid)
+static void mlx4_en_vlan_rx_add_vid(void *arg, struct ifnet *dev, u16 vid)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -427,7 +427,7 @@ static void mlx4_en_vlan_rx_add_vid(void *arg, struct net_device *dev, u16 vid)
 
 }
 
-static void mlx4_en_vlan_rx_kill_vid(void *arg, struct net_device *dev, u16 vid)
+static void mlx4_en_vlan_rx_kill_vid(void *arg, struct ifnet *dev, u16 vid)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -606,7 +606,7 @@ static void mlx4_en_put_qp(struct mlx4_en_priv *priv)
 	}
 }
 
-static void mlx4_en_clear_uclist(struct net_device *dev)
+static void mlx4_en_clear_uclist(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_addr_list *tmp, *uc_to_del;
@@ -635,7 +635,7 @@ static u_int mlx4_copy_addr(void *arg, struct sockaddr_dl *sdl, u_int cnt)
 	return (1);
 }
 
-static void mlx4_en_cache_uclist(struct net_device *dev)
+static void mlx4_en_cache_uclist(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 
@@ -643,7 +643,7 @@ static void mlx4_en_cache_uclist(struct net_device *dev)
 	if_foreach_lladdr(dev, mlx4_copy_addr, priv);
 }
 
-static void mlx4_en_clear_mclist(struct net_device *dev)
+static void mlx4_en_clear_mclist(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_addr_list *tmp, *mc_to_del;
@@ -671,7 +671,7 @@ static u_int mlx4_copy_maddr(void *arg, struct sockaddr_dl *sdl, u_int count)
 	return (1);
 }
 
-static void mlx4_en_cache_mclist(struct net_device *dev)
+static void mlx4_en_cache_mclist(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 
@@ -728,7 +728,7 @@ static void update_addr_list_flags(struct mlx4_en_priv *priv,
 	}
 }
 
-static void mlx4_en_set_rx_mode(struct net_device *dev)
+static void mlx4_en_set_rx_mode(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 
@@ -842,7 +842,7 @@ static void mlx4_en_clear_promisc_mode(struct mlx4_en_priv *priv,
 }
 
 static void mlx4_en_do_multicast(struct mlx4_en_priv *priv,
-				 struct net_device *dev,
+				 struct ifnet *dev,
 				 struct mlx4_en_dev *mdev)
 {
 	struct mlx4_en_addr_list *addr_list, *tmp;
@@ -977,7 +977,7 @@ static void mlx4_en_do_multicast(struct mlx4_en_priv *priv,
 }
 
 static void mlx4_en_do_unicast(struct mlx4_en_priv *priv,
-			       struct net_device *dev,
+			       struct ifnet *dev,
 			       struct mlx4_en_dev *mdev)
 {
 	struct mlx4_en_addr_list *addr_list, *tmp;
@@ -1011,7 +1011,7 @@ static void mlx4_en_do_set_rx_mode(struct work_struct *work)
 	struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv,
 						 rx_mode_task);
 	struct mlx4_en_dev *mdev = priv->mdev;
-	struct net_device *dev = priv->dev;
+	struct ifnet *dev = priv->dev;
 
 	mutex_lock(&mdev->state_lock);
 	if (!mdev->device_up) {
@@ -1258,7 +1258,7 @@ static void mlx4_en_linkstate(struct work_struct *work)
 }
 
 
-int mlx4_en_start_port(struct net_device *dev)
+int mlx4_en_start_port(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -1451,7 +1451,7 @@ cq_err:
 }
 
 
-void mlx4_en_stop_port(struct net_device *dev)
+void mlx4_en_stop_port(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -1568,7 +1568,7 @@ static void mlx4_en_restart(struct work_struct *work)
 	struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv,
 						 watchdog_task);
 	struct mlx4_en_dev *mdev = priv->mdev;
-	struct net_device *dev = priv->dev;
+	struct ifnet *dev = priv->dev;
 	struct mlx4_en_tx_ring *ring;
 	int i;
 
@@ -1601,7 +1601,7 @@ reset:
 	mutex_unlock(&mdev->state_lock);
 }
 
-static void mlx4_en_clear_stats(struct net_device *dev)
+static void mlx4_en_clear_stats(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -1635,7 +1635,7 @@ static void mlx4_en_open(void* arg)
 
         struct mlx4_en_priv *priv;
         struct mlx4_en_dev *mdev;
-        struct net_device *dev;
+        struct ifnet *dev;
         int err = 0;
 
         priv = arg;
@@ -1760,7 +1760,7 @@ struct en_port_attribute en_port_attr_##_name = __ATTR_RO(_name)
 #define EN_PORT_ATTR(_name, _mode, _show, _store) \
 struct en_port_attribute en_port_attr_##_name = __ATTR(_name, _mode, _show, _store)
 
-void mlx4_en_destroy_netdev(struct net_device *dev)
+void mlx4_en_destroy_netdev(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -1815,7 +1815,7 @@ void mlx4_en_destroy_netdev(struct net_device *dev)
 
 }
 
-static int mlx4_en_change_mtu(struct net_device *dev, int new_mtu)
+static int mlx4_en_change_mtu(struct ifnet *dev, int new_mtu)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -2137,7 +2137,7 @@ out:
 int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
 			struct mlx4_en_port_profile *prof)
 {
-	struct net_device *dev;
+	struct ifnet *dev;
 	struct mlx4_en_priv *priv;
 	uint8_t dev_addr[ETHER_ADDR_LEN];
 	int err;
@@ -2350,7 +2350,7 @@ out:
 	return err;
 }
 
-static int mlx4_en_set_ring_size(struct net_device *dev,
+static int mlx4_en_set_ring_size(struct ifnet *dev,
     int rx_size, int tx_size)
 {
         struct mlx4_en_priv *priv = netdev_priv(dev);
@@ -2424,7 +2424,7 @@ static int mlx4_en_set_tx_ring_size(SYSCTL_HANDLER_ARGS)
         return (error);
 }
 
-static int mlx4_en_get_module_info(struct net_device *dev,
+static int mlx4_en_get_module_info(struct ifnet *dev,
 				   struct ethtool_modinfo *modinfo)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
@@ -2471,7 +2471,7 @@ static int mlx4_en_get_module_info(struct net_device *dev,
 	return 0;
 }
 
-static int mlx4_en_get_module_eeprom(struct net_device *dev,
+static int mlx4_en_get_module_eeprom(struct ifnet *dev,
 				     struct ethtool_eeprom *ee,
 				     u8 *data)
 {
@@ -2539,7 +2539,7 @@ static int mlx4_en_read_eeprom(SYSCTL_HANDLER_ARGS)
 	int		error;
 	int		result = 0;
 	struct		mlx4_en_priv *priv;
-	struct		net_device *dev;
+	struct		ifnet *dev;
 	struct		ethtool_modinfo modinfo;
 	struct		ethtool_eeprom ee;
 
@@ -2655,7 +2655,7 @@ static int mlx4_en_set_rx_ppp(SYSCTL_HANDLER_ARGS)
 
 static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv)
 {
-        struct net_device *dev;
+        struct ifnet *dev;
         struct sysctl_ctx_list *ctx;
         struct sysctl_oid *node;
         struct sysctl_oid_list *node_list;
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
index 7e8d2c1550e4..9a0edac109f4 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c
@@ -149,7 +149,7 @@ static u64 en_stats_adder(__be64 *start, __be64 *next, int num)
 	return ret;
 }
 
-static void mlx4_en_fold_software_stats(struct net_device *dev)
+static void mlx4_en_fold_software_stats(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_dev *mdev = priv->mdev;
@@ -187,7 +187,7 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_en_dev *mdev, u8 port, u8 reset)
 	struct mlx4_counter tmp_vport_stats;
 	struct mlx4_en_stat_out_mbox *mlx4_en_stats;
 	struct mlx4_en_stat_out_flow_control_mbox *flowstats;
-	struct net_device *dev = mdev->pndev[port];
+	struct ifnet *dev = mdev->pndev[port];
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_en_vport_stats *vport_stats = &priv->vport_stats;
 	struct mlx4_cmd_mailbox *mailbox;
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c b/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c
index db8beb501594..5d5508eebebf 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c
@@ -43,7 +43,7 @@ void mlx4_en_fill_qp_context(struct mlx4_en_priv *priv, int size, int stride,
 			     int user_prio, struct mlx4_qp_context *context)
 {
 	struct mlx4_en_dev *mdev = priv->mdev;
-	struct net_device *dev = priv->dev;
+	struct ifnet *dev = priv->dev;
 
 	memset(context, 0, sizeof *context);
 	context->flags = cpu_to_be32(7 << 16 | rss << MLX4_RSS_QPC_FLAG_OFFSET);
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
index e9f0d2f640e1..9e6f4df107bd 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_rx.c
@@ -338,7 +338,7 @@ void mlx4_en_set_num_rx_rings(struct mlx4_en_dev *mdev)
 	}
 }
 
-void mlx4_en_calc_rx_buf(struct net_device *dev)
+void mlx4_en_calc_rx_buf(struct ifnet *dev)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	int eff_mtu = dev->if_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN +
@@ -735,7 +735,7 @@ mlx4_en_rss_hash(__be16 status, int udp_rss)
  * The following calc ensures that when factor==1, it means we are aligned to 64B
  * and we get the real cqe data*/
 #define CQE_FACTOR_INDEX(index, factor) (((index) << (factor)) + (factor))
-int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int budget)
+int mlx4_en_process_rx_cq(struct ifnet *dev, struct mlx4_en_cq *cq, int budget)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	struct mlx4_cqe *cqe;
@@ -866,7 +866,7 @@ out:
 /* Rx CQ polling - called by NAPI */
 static int mlx4_en_poll_rx_cq(struct mlx4_en_cq *cq, int budget)
 {
-	struct net_device *dev = cq->dev;
+	struct ifnet *dev = cq->dev;
 	struct epoch_tracker et;
 	int done;
 
diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
index e07964f3225e..f3a41a15f8b6 100644
--- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
+++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c
@@ -308,7 +308,7 @@ done:
 	return (tx_info->nr_txbb);
 }
 
-int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring)
+int mlx4_en_free_tx_buf(struct ifnet *dev, struct mlx4_en_tx_ring *ring)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	int cnt = 0;
@@ -344,7 +344,7 @@ mlx4_en_tx_ring_is_full(struct mlx4_en_tx_ring *ring)
 	return (wqs < (HEADROOM + (2 * MLX4_EN_TX_WQE_MAX_WQEBBS)));
 }
 
-static int mlx4_en_process_tx_cq(struct net_device *dev,
+static int mlx4_en_process_tx_cq(struct ifnet *dev,
 				 struct mlx4_en_cq *cq)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
@@ -604,7 +604,7 @@ static void hashrandom_init(void *arg)
 }
 SYSINIT(hashrandom_init, SI_SUB_RANDOM, SI_ORDER_ANY, &hashrandom_init, NULL);
 
-u16 mlx4_en_select_queue(struct net_device *dev, struct mbuf *mb)
+u16 mlx4_en_select_queue(struct ifnet *dev, struct mbuf *mb)
 {
 	struct mlx4_en_priv *priv = netdev_priv(dev);
 	u32 rings_p_up = priv->num_tx_rings_p_up;
diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib.h b/sys/dev/mlx4/mlx4_ib/mlx4_ib.h
index d8926110a7a1..100a06b75af7 100644
--- a/sys/dev/mlx4/mlx4_ib/mlx4_ib.h
+++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib.h
@@ -500,7 +500,7 @@ struct mlx4_port_gid_table {
 
 struct mlx4_ib_iboe {
 	spinlock_t		lock;
-	struct net_device      *netdevs[MLX4_MAX_PORTS];
+	struct ifnet      *netdevs[MLX4_MAX_PORTS];
 	atomic64_t		mac[MLX4_MAX_PORTS];
 	struct notifier_block 	nb;
 	struct mlx4_port_gid_table gids[MLX4_MAX_PORTS];
diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
index b050272e49d0..62956607974b 100644
--- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
+++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c
@@ -131,10 +131,10 @@ static int num_ib_ports(struct mlx4_dev *dev)
 	return ib_ports;
 }
 
-static struct net_device *mlx4_ib_get_netdev(struct ib_device *device, u8 port_num)
+static struct ifnet *mlx4_ib_get_netdev(struct ib_device *device, u8 port_num)
 {
 	struct mlx4_ib_dev *ibdev = to_mdev(device);
-	struct net_device *dev;
+	struct ifnet *dev;
 
 	rcu_read_lock();
 	dev = mlx4_get_protocol_dev(ibdev->dev, MLX4_PROT_ETH, port_num);
@@ -142,11 +142,11 @@ static struct net_device *mlx4_ib_get_netdev(struct ib_device *device, u8 port_n
 #if 0
 	if (dev) {
 		if (mlx4_is_bonded(ibdev->dev)) {
-			struct net_device *upper = NULL;
+			struct ifnet *upper = NULL;
 
 			upper = netdev_master_upper_dev_get_rcu(dev);
 			if (upper) {
-				struct net_device *active;
+				struct ifnet *active;
 
 				active = bond_option_active_slave_get_rcu(netdev_priv(upper));
 				if (active)
@@ -693,7 +693,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,
 
 	struct mlx4_ib_dev *mdev = to_mdev(ibdev);
 	struct mlx4_ib_iboe *iboe = &mdev->iboe;
-	struct net_device *ndev;
+	struct ifnet *ndev;
 	enum ib_mtu tmp;
 	struct mlx4_cmd_mailbox *mailbox;
 	int err = 0;
@@ -1348,7 +1348,7 @@ static void mlx4_ib_delete_counters_table(struct mlx4_ib_dev *ibdev,
 int mlx4_ib_add_mc(struct mlx4_ib_dev *mdev, struct mlx4_ib_qp *mqp,
 		   union ib_gid *gid)
 {
-	struct net_device *ndev;
+	struct ifnet *ndev;
 	int ret = 0;
 
 	if (!mqp->port)
@@ -1960,7 +1960,7 @@ static int mlx4_ib_mcg_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 	struct mlx4_ib_dev *mdev = to_mdev(ibqp->device);
 	struct mlx4_dev *dev = mdev->dev;
 	struct mlx4_ib_qp *mqp = to_mqp(ibqp);
-	struct net_device *ndev;
+	struct ifnet *ndev;
 	struct mlx4_ib_gid_entry *ge;
 	struct mlx4_flow_reg_id reg_id = {0, 0};
 	enum mlx4_protocol prot =  MLX4_PROT_IB_IPV6;
@@ -2284,7 +2284,7 @@ static void mlx4_ib_diag_cleanup(struct mlx4_ib_dev *ibdev)
 
 #define MLX4_IB_INVALID_MAC	((u64)-1)
 static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev,
-			       struct net_device *dev,
+			       struct ifnet *dev,
 			       int port)
 {
 	u64 new_smac = 0;
@@ -2339,7 +2339,7 @@ unlock:
 }
 
 static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
-				 struct net_device *dev,
+				 struct ifnet *dev,
 				 unsigned long event)
 
 {
@@ -2370,7 +2370,7 @@ static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev,
 static int mlx4_ib_netdev_event(struct notifier_block *this,
 				unsigned long event, void *ptr)
 {
-	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
+	struct ifnet *dev = netdev_notifier_info_to_ifp(ptr);
 	struct mlx4_ib_dev *ibdev;
 
 	if (dev->if_vnet != &init_net)
@@ -3105,7 +3105,7 @@ static void handle_bonded_port_state_event(struct work_struct *work)
 	kfree(ew);
 	spin_lock_bh(&ibdev->iboe.lock);
 	for (i = 0; i < MLX4_MAX_PORTS; ++i) {
-		struct net_device *curr_netdev = ibdev->iboe.netdevs[i];
+		struct ifnet *curr_netdev = ibdev->iboe.netdevs[i];
 		enum ib_port_state curr_port_state;
 
 		if (!curr_netdev)
diff --git a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
index c2a01b26de1c..68dddeb8f1f1 100644
--- a/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
+++ b/sys/dev/mlx5/mlx5_ib/mlx5_ib_main.c
@@ -107,7 +107,7 @@ static bool mlx5_netdev_match(struct ifnet *ndev,
 static int mlx5_netdev_event(struct notifier_block *this,
 			     unsigned long event, void *ptr)
 {
-	struct ifnet *ndev = netdev_notifier_info_to_dev(ptr);
+	struct ifnet *ndev = netdev_notifier_info_to_ifp(ptr);
 	struct mlx5_ib_dev *ibdev = container_of(this, struct mlx5_ib_dev,
 						 roce.nb);
 
diff --git a/sys/ofed/drivers/infiniband/core/core_priv.h b/sys/ofed/drivers/infiniband/core/core_priv.h
index 7e3401ddf90a..62772fc2a6c5 100644
--- a/sys/ofed/drivers/infiniband/core/core_priv.h
+++ b/sys/ofed/drivers/infiniband/core/core_priv.h
@@ -79,10 +79,10 @@ void ib_cache_setup(void);
 void ib_cache_cleanup(void);
 
 typedef void (*roce_netdev_callback)(struct ib_device *device, u8 port,
-	      struct net_device *idev, void *cookie);
+	      struct ifnet *idev, void *cookie);
 
 typedef int (*roce_netdev_filter)(struct ib_device *device, u8 port,
-	     struct net_device *idev, void *cookie);
+	     struct ifnet *idev, void *cookie);
 
 void ib_enum_roce_netdev(struct ib_device *ib_dev,
 			 roce_netdev_filter filter,
@@ -104,7 +104,7 @@ int ib_cache_gid_parse_type_str(const char *buf);
 const char *ib_cache_gid_type_str(enum ib_gid_type gid_type);
 
 void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port,
-				  struct net_device *ndev,
+				  struct ifnet *ndev,
 				  unsigned long gid_type_mask,
 				  enum ib_cache_gid_default_mode mode);
 
@@ -115,8 +115,8 @@ int ib_cache_gid_del(struct ib_device *ib_dev, u8 port,
 		     union ib_gid *gid, struct ib_gid_attr *attr);
 
 int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u8 port,
-				     struct net_device *ndev);
-void ib_cache_gid_del_all_by_netdev(struct net_device *ndev);
+				     struct ifnet *ndev);
+void ib_cache_gid_del_all_by_netdev(struct ifnet *ndev);
 
 int roce_gid_mgmt_init(void);
 void roce_gid_mgmt_cleanup(void);
diff --git a/sys/ofed/drivers/infiniband/core/ib_addr.c b/sys/ofed/drivers/infiniband/core/ib_addr.c
index ef5e264577e0..a8e951721b8d 100644
--- a/sys/ofed/drivers/infiniband/core/ib_addr.c
+++ b/sys/ofed/drivers/infiniband/core/ib_addr.c
@@ -139,7 +139,7 @@ rdma_copy_addr_sub(u8 *dst, const u8 *src, unsigned min, unsigned max)
 	memset(dst + min, 0, max - min);
 }
 
-int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
+int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct ifnet *dev,
 		     const unsigned char *dst_dev_addr)
 {
 	/* check for loopback device */
@@ -172,7 +172,7 @@ EXPORT_SYMBOL(rdma_copy_addr);
 int rdma_translate_ip(const struct sockaddr *addr,
 		      struct rdma_dev_addr *dev_addr)
 {
-	struct net_device *dev;
+	struct ifnet *dev;
 	int ret;
 
 	if (dev_addr->bound_dev_if) {
@@ -662,7 +662,7 @@ static int addr_resolve(struct sockaddr *src_in,
 			struct rdma_dev_addr *addr)
 {
 	struct epoch_tracker et;
-	struct net_device *ndev = NULL;
+	struct ifnet *ndev = NULL;
 	u8 edst[MAX_ADDR_LEN];
 	int ret;
 
@@ -852,7 +852,7 @@ static void resolve_cb(int status, struct sockaddr *src_addr,
 
 int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
 				 const union ib_gid *dgid,
-				 u8 *dmac, struct net_device *dev,
+				 u8 *dmac, struct ifnet *dev,
 				 int *hoplimit)
 {
 	int ret = 0;
diff --git a/sys/ofed/drivers/infiniband/core/ib_cache.c b/sys/ofed/drivers/infiniband/core/ib_cache.c
index a5bc498303c6..3680b97ad2bf 100644
--- a/sys/ofed/drivers/infiniband/core/ib_cache.c
+++ b/sys/ofed/drivers/infiniband/core/ib_cache.c
@@ -183,7 +183,7 @@ static int write_gid(struct ib_device *ib_dev, u8 port,
 	__releases(&table->rwlock) __acquires(&table->rwlock)
 {
 	int ret = 0;
-	struct net_device *old_net_dev;
+	struct ifnet *old_net_dev;
 	enum ib_gid_type old_gid_type;
 
 	/* in rdma_cap_roce_gid_table, this funciton should be protected by a
@@ -311,7 +311,7 @@ static int find_gid(struct ib_gid_table *table, const union ib_gid *gid,
 	return found;
 }
 
-static void addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
+static void addrconf_ifid_eui48(u8 *eui, struct ifnet *dev)
 {
 	if (dev->if_addrlen != ETH_ALEN)
 		return;
@@ -325,7 +325,7 @@ static void addrconf_ifid_eui48(u8 *eui, struct net_device *dev)
 	eui[0] ^= 2;
 }
 
-static void make_default_gid(struct  net_device *dev, union ib_gid *gid)
+static void make_default_gid(struct ifnet *dev, union ib_gid *gid)
 {
 	gid->global.subnet_prefix = cpu_to_be64(0xfe80000000000000LL);
 	addrconf_ifid_eui48(&gid->raw[8], dev);
@@ -400,7 +400,7 @@ out_unlock:
 }
 
 int ib_cache_gid_del_all_netdev_gids(struct ib_device *ib_dev, u8 port,
-				     struct net_device *ndev)
+				     struct ifnet *ndev)
 {
 	struct ib_gid_table **ports_table = ib_dev->cache.gid_cache;
 	struct ib_gid_table *table;
@@ -490,7 +490,7 @@ static int _ib_cache_gid_table_find(struct ib_device *ib_dev,
 static int ib_cache_gid_find(struct ib_device *ib_dev,
 			     const union ib_gid *gid,
 			     enum ib_gid_type gid_type,
-			     struct net_device *ndev, u8 *port,
+			     struct ifnet *ndev, u8 *port,
 			     u16 *index)
 {
 	unsigned long mask = GID_ATTR_FIND_MASK_GID |
@@ -507,7 +507,7 @@ static int ib_cache_gid_find(struct ib_device *ib_dev,
 int ib_find_cached_gid_by_port(struct ib_device *ib_dev,
 			       const union ib_gid *gid,
 			       enum ib_gid_type gid_type,
-			       u8 port, struct net_device *ndev,
+			       u8 port, struct ifnet *ndev,
 			       u16 *index)
 {
 	int local_index;
@@ -672,7 +672,7 @@ static void cleanup_gid_table_port(struct ib_device *ib_dev, u8 port,
 }
 
 void ib_cache_gid_set_default_gid(struct ib_device *ib_dev, u8 port,
-				  struct net_device *ndev,
+				  struct ifnet *ndev,
 				  unsigned long gid_type_mask,
 				  enum ib_cache_gid_default_mode mode)
 {
@@ -899,7 +899,7 @@ EXPORT_SYMBOL(ib_get_cached_gid);
 int ib_find_cached_gid(struct ib_device *device,
 		       const union ib_gid *gid,
 		       enum ib_gid_type gid_type,
-		       struct net_device *ndev,
+		       struct ifnet *ndev,
 		       u8               *port_num,
 		       u16              *index)
 {
diff --git a/sys/ofed/drivers/infiniband/core/ib_cm.c b/sys/ofed/drivers/infiniband/core/ib_cm.c
index 7d5197cc4a0d..95b442eb0dd1 100644
--- a/sys/ofed/drivers/infiniband/core/ib_cm.c
+++ b/sys/ofed/drivers/infiniband/core/ib_cm.c
@@ -429,7 +429,7 @@ static int cm_init_av_by_path(struct ib_sa_path_rec *path, struct cm_av *av,
 	unsigned long flags;
 	int ret;
 	u8 p;
-	struct net_device *ndev = ib_get_ndev_from_path(path);
+	struct ifnet *ndev = ib_get_ndev_from_path(path);
 
 	read_lock_irqsave(&cm.device_lock, flags);
 	list_for_each_entry(cm_dev, &cm.device_list, list) {
diff --git a/sys/ofed/drivers/infiniband/core/ib_cma.c b/sys/ofed/drivers/infiniband/core/ib_cma.c
index 7c03841d51d7..829d668dbd05 100644
--- a/sys/ofed/drivers/infiniband/core/ib_cma.c
+++ b/sys/ofed/drivers/infiniband/core/ib_cma.c
@@ -444,7 +444,7 @@ static inline void sdp_set_ip_ver(struct sdp_hh *hh, u8 ip_ver)
 	hh->ipv_cap = (ip_ver << 4) | (hh->ipv_cap & 0xF);
 }
 
-static int cma_igmp_send(struct net_device *ndev, const union ib_gid *mgid, bool join)
+static int cma_igmp_send(struct ifnet *ndev, const union ib_gid *mgid, bool join)
 {
 	int retval;
 
@@ -586,7 +586,7 @@ static inline int cma_validate_port(struct ib_device *device, u8 port,
 				    const struct rdma_dev_addr *dev_addr)
 {
 	const int dev_type = dev_addr->dev_type;
-	struct net_device *ndev;
+	struct ifnet *ndev;
 	int ret = -ENODEV;
 
 	if ((dev_type == ARPHRD_INFINIBAND) && !rdma_protocol_ib(device, port))
@@ -1346,14 +1346,14 @@ static int cma_save_req_info(const struct ib_cm_event *ib_event,
 	return 0;
 }
 
-static bool validate_ipv4_net_dev(struct net_device *net_dev,
+static bool validate_ipv4_net_dev(struct ifnet *net_dev,
 				  const struct sockaddr_in *dst_addr,
 				  const struct sockaddr_in *src_addr)
 {
 #ifdef INET
 	__be32 daddr = dst_addr->sin_addr.s_addr,
 	       saddr = src_addr->sin_addr.s_addr;
-	struct net_device *dst_dev;
+	struct ifnet *dst_dev;
 	struct nhop_object *nh;
 	bool ret;
 
@@ -1390,14 +1390,14 @@ static bool validate_ipv4_net_dev(struct net_device *net_dev,
 #endif
 }
 
-static bool validate_ipv6_net_dev(struct net_device *net_dev,
+static bool validate_ipv6_net_dev(struct ifnet *net_dev,
 				  const struct sockaddr_in6 *dst_addr,
 				  const struct sockaddr_in6 *src_addr)
 {
 #ifdef INET6
 	struct sockaddr_in6 src_tmp = *src_addr;
 	struct sockaddr_in6 dst_tmp = *dst_addr;
-	struct net_device *dst_dev;
+	struct ifnet *dst_dev;
 	struct nhop_object *nh;
 	bool ret;
 
@@ -1444,7 +1444,7 @@ static bool validate_ipv6_net_dev(struct net_device *net_dev,
 #endif
 }
 
-static bool validate_net_dev(struct net_device *net_dev,
+static bool validate_net_dev(struct ifnet *net_dev,
 			     const struct sockaddr *daddr,
 			     const struct sockaddr *saddr)
 {
@@ -1467,7 +1467,7 @@ static bool validate_net_dev(struct net_device *net_dev,
 	}
 }
 
-static struct net_device *
+static struct ifnet *
 roce_get_net_dev_by_cm_event(struct ib_device *device, u8 port_num,
     const struct ib_cm_event *ib_event)
 {
@@ -1487,13 +1487,13 @@ roce_get_net_dev_by_cm_event(struct ib_device *device, u8 port_num,
 	return (sgid_attr.ndev);
 }
 
-static struct net_device *cma_get_net_dev(struct ib_cm_event *ib_event,
+static struct ifnet *cma_get_net_dev(struct ib_cm_event *ib_event,
 					  const struct cma_req_info *req)
 {
 	struct sockaddr_storage listen_addr_storage, src_addr_storage;
 	struct sockaddr *listen_addr = (struct sockaddr *)&listen_addr_storage,
 			*src_addr = (struct sockaddr *)&src_addr_storage;
-	struct net_device *net_dev;
+	struct ifnet *net_dev;
 	const union ib_gid *gid = req->has_gid ? &req->local_gid : NULL;
 	struct epoch_tracker et;
 	int err;
@@ -1623,7 +1623,7 @@ static bool cma_protocol_roce(const struct rdma_cm_id *id)
 }
 
 static bool cma_match_net_dev(const struct rdma_cm_id *id,
-			      const struct net_device *net_dev,
+			      const struct ifnet *net_dev,
 			      u8 port_num)
 {
 	const struct rdma_addr *addr = &id->route.addr;
@@ -1653,7 +1653,7 @@ static struct rdma_id_private *cma_find_listener(
 		const struct ib_cm_id *cm_id,
 		const struct ib_cm_event *ib_event,
 		const struct cma_req_info *req,
-		const struct net_device *net_dev)
+		const struct ifnet *net_dev)
 {
 	struct rdma_id_private *id_priv, *id_priv_dev;
 
@@ -1680,7 +1680,7 @@ static struct rdma_id_private *cma_find_listener(
 
 static struct rdma_id_private *cma_id_from_event(struct ib_cm_id *cm_id,
 						 struct ib_cm_event *ib_event,
-						 struct net_device **net_dev)
+						 struct ifnet **net_dev)
 {
 	struct cma_req_info req;
 	struct rdma_bind_list *bind_list;
@@ -1813,7 +1813,7 @@ static void cma_leave_mc_groups(struct rdma_id_private *id_priv)
 			if (mc->igmp_joined) {
 				struct rdma_dev_addr *dev_addr =
 					&id_priv->id.route.addr.dev_addr;
-				struct net_device *ndev = NULL;
+				struct ifnet *ndev = NULL;
 
 				if (dev_addr->bound_dev_if)
 					ndev = dev_get_by_index(dev_addr->net,
@@ -2002,7 +2002,7 @@ out:
 
 static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id,
 					       struct ib_cm_event *ib_event,
-					       struct net_device *net_dev)
+					       struct ifnet *net_dev)
 {
 	struct rdma_id_private *id_priv;
 	struct rdma_cm_id *id;
@@ -2063,7 +2063,7 @@ err:
 
 static struct rdma_id_private *cma_new_udp_id(struct rdma_cm_id *listen_id,
 					      struct ib_cm_event *ib_event,
-					      struct net_device *net_dev)
+					      struct ifnet *net_dev)
 {
 	struct rdma_id_private *id_priv;
 	struct rdma_cm_id *id;
@@ -2131,7 +2131,7 @@ static int cma_req_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
 {
 	struct rdma_id_private *listen_id, *conn_id = NULL;
 	struct rdma_cm_event event;
-	struct net_device *net_dev;
+	struct ifnet *net_dev;
 	int offset, ret;
 
 	listen_id = cma_id_from_event(cm_id, ib_event, &net_dev);
@@ -2651,7 +2651,7 @@ static int cma_resolve_iw_route(struct rdma_id_private *id_priv, int timeout_ms)
 	return 0;
 }
 
-static int iboe_tos_to_sl(struct net_device *ndev, int tos)
+static int iboe_tos_to_sl(struct ifnet *ndev, int tos)
 {
 	/* get service level, SL, from IPv4 type of service, TOS */
 	int sl = (tos >> 5) & 0x7;
@@ -2678,7 +2678,7 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
 	struct rdma_addr *addr = &route->addr;
 	struct cma_work *work;
 	int ret;
-	struct net_device *ndev = NULL;
+	struct ifnet *ndev = NULL;
 
 
 	work = kzalloc(sizeof *work, GFP_KERNEL);
@@ -3999,7 +3999,7 @@ static int cma_ib_mc_handler(int status, struct ib_sa_multicast *multicast)
 	if (!status) {
 		struct rdma_dev_addr *dev_addr =
 			&id_priv->id.route.addr.dev_addr;
-		struct net_device *ndev =
+		struct ifnet *ndev =
 			dev_get_by_index(dev_addr->net, dev_addr->bound_dev_if);
 		enum ib_gid_type gid_type =
 			id_priv->cma_dev->default_gid_type[id_priv->id.port_num -
@@ -4226,7 +4226,7 @@ static int cma_iboe_join_multicast(struct rdma_id_private *id_priv,
 	struct rdma_dev_addr *dev_addr = &id_priv->id.route.addr.dev_addr;
 	int err = 0;
 	struct sockaddr *addr = (struct sockaddr *)&mc->addr;
-	struct net_device *ndev = NULL;
+	struct ifnet *ndev = NULL;
 	enum ib_gid_type gid_type;
 	bool send_only;
 
@@ -4372,7 +4372,7 @@ void rdma_leave_multicast(struct rdma_cm_id *id, struct sockaddr *addr)
 				if (mc->igmp_joined) {
 					struct rdma_dev_addr *dev_addr =
 						&id->route.addr.dev_addr;
-					struct net_device *ndev = NULL;
*** 403 LINES SKIPPED ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107180036.16I0akHn049564>