diff --git a/sys/dev/mlx4/mlx4_en/en.h b/sys/dev/mlx4/mlx4_en/en.h --- a/sys/dev/mlx4/mlx4_en/en.h +++ b/sys/dev/mlx4/mlx4_en/en.h @@ -392,7 +392,7 @@ struct mlx4_hwq_resources wqres; int ring; spinlock_t lock; - struct ifnet *dev; + if_t dev; /* Per-core Tx cq processing support */ struct timer_list timer; int size; @@ -452,7 +452,7 @@ struct mlx4_dev *dev; struct pci_dev *pdev; struct mutex state_lock; - struct ifnet *pndev[MLX4_MAX_PORTS + 1]; + if_t pndev[MLX4_MAX_PORTS + 1]; u32 port_cnt; bool device_up; struct mlx4_en_profile profile; @@ -543,7 +543,7 @@ struct mlx4_en_priv { struct mlx4_en_dev *mdev; struct mlx4_en_port_profile *prof; - struct ifnet *dev; + if_t dev; unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; struct mlx4_en_port_state port_state; spinlock_t stats_lock; @@ -662,7 +662,7 @@ }; static inline void * -mlx4_netdev_priv(const struct ifnet *dev) +mlx4_netdev_priv(const if_t dev) { return (dev->if_softc); } @@ -716,7 +716,7 @@ int rc = true; spin_lock_bh(&cq->poll_lock); if ((cq->state & MLX4_CQ_LOCKED)) { - struct ifnet *dev = cq->dev; + if_t dev = cq->dev; struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; @@ -785,12 +785,12 @@ #define MLX4_EN_WOL_DO_MODIFY (1ULL << 63) -void mlx4_en_destroy_netdev(struct ifnet *dev); +void mlx4_en_destroy_netdev(if_t 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 ifnet *dev); -void mlx4_en_stop_port(struct ifnet *dev); +int mlx4_en_start_port(if_t dev); +void mlx4_en_stop_port(if_t dev); void mlx4_en_free_resources(struct mlx4_en_priv *priv); int mlx4_en_alloc_resources(struct mlx4_en_priv *priv); @@ -806,10 +806,10 @@ 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 ifnet *dev, struct mbuf *mb); +u16 mlx4_en_select_queue(if_t 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); +int mlx4_en_transmit(if_t dev, struct mbuf *m); int mlx4_en_create_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring **pring, u32 size, u16 stride, int node, int queue_idx); @@ -821,7 +821,7 @@ void mlx4_en_deactivate_tx_ring(struct mlx4_en_priv *priv, struct mlx4_en_tx_ring *ring); void mlx4_en_set_num_rx_rings(struct mlx4_en_dev *mdev); -void mlx4_en_qflush(struct ifnet *dev); +void mlx4_en_qflush(if_t dev); int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring **pring, @@ -833,7 +833,7 @@ 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 ifnet *dev, +int mlx4_en_process_rx_cq(if_t dev, struct mlx4_en_cq *cq, int budget); void mlx4_en_poll_tx_cq(unsigned long data); @@ -843,7 +843,7 @@ 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 ifnet *dev); +void mlx4_en_calc_rx_buf(if_t 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); @@ -851,7 +851,7 @@ 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 ifnet *dev, struct mlx4_en_tx_ring *ring); +int mlx4_en_free_tx_buf(if_t 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); @@ -869,7 +869,7 @@ extern const struct dcbnl_rtnl_ops mlx4_en_dcbnl_pfc_ops; #endif -int mlx4_en_setup_tc(struct ifnet *dev, u8 up); +int mlx4_en_setup_tc(if_t dev, u8 up); #ifdef CONFIG_RFS_ACCEL void mlx4_en_cleanup_filters(struct mlx4_en_priv *priv, @@ -877,7 +877,7 @@ #endif #define MLX4_EN_NUM_SELF_TEST 5 -void mlx4_en_ex_selftest(struct ifnet *dev, u32 *flags, u64 *buf); +void mlx4_en_ex_selftest(if_t dev, u32 *flags, u64 *buf); void mlx4_en_ptp_overflow_check(struct mlx4_en_dev *mdev); /* @@ -889,7 +889,7 @@ u64 mlx4_en_get_cqe_ts(struct mlx4_cqe *cqe); /* Functions for caching and restoring statistics */ -int mlx4_en_get_sset_count(struct ifnet *dev, int sset); +int mlx4_en_get_sset_count(if_t 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 --- 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 int mlx4_en_low_latency_recv(struct napi_struct *napi) { struct mlx4_en_cq *cq = container_of(napi, struct mlx4_en_cq, napi); - struct ifnet *dev = cq->dev; + if_t dev = cq->dev; struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_rx_ring *rx_ring = priv->rx_ring[cq->ring]; int done; @@ -288,7 +288,7 @@ } static int -mlx4_en_filter_rfs(struct ifnet *net_dev, const struct sk_buff *skb, +mlx4_en_filter_rfs(if_t net_dev, const struct sk_buff *skb, u16 rxq_index, u32 flow_id) { struct mlx4_en_priv *priv = mlx4_netdev_priv(net_dev); @@ -400,7 +400,7 @@ } #endif -static void mlx4_en_vlan_rx_add_vid(void *arg, struct ifnet *dev, u16 vid) +static void mlx4_en_vlan_rx_add_vid(void *arg, if_t dev, u16 vid) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -427,7 +427,7 @@ } -static void mlx4_en_vlan_rx_kill_vid(void *arg, struct ifnet *dev, u16 vid) +static void mlx4_en_vlan_rx_kill_vid(void *arg, if_t dev, u16 vid) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -558,15 +558,15 @@ int index = 0; int err = 0; int *qpn = &priv->base_qpn; - u64 mac = mlx4_mac_to_u64(IF_LLADDR(priv->dev)); + u64 mac = mlx4_mac_to_u64(if_getlladdr(priv->dev)); en_dbg(DRV, priv, "Registering MAC: %pM for adding\n", - IF_LLADDR(priv->dev)); + if_getlladdr(priv->dev)); index = mlx4_register_mac(dev, priv->port, mac); if (index < 0) { err = index; en_err(priv, "Failed adding MAC: %pM\n", - IF_LLADDR(priv->dev)); + if_getlladdr(priv->dev)); return err; } @@ -594,9 +594,9 @@ int qpn = priv->base_qpn; if (dev->caps.steering_mode == MLX4_STEERING_MODE_A0) { - u64 mac = mlx4_mac_to_u64(IF_LLADDR(priv->dev)); + u64 mac = mlx4_mac_to_u64(if_getlladdr(priv->dev)); en_dbg(DRV, priv, "Registering MAC: %pM for deleting\n", - IF_LLADDR(priv->dev)); + if_getlladdr(priv->dev)); mlx4_unregister_mac(dev, priv->port, mac); } else { en_dbg(DRV, priv, "Releasing qp: port %d, qpn %d\n", @@ -606,7 +606,7 @@ } } -static void mlx4_en_clear_uclist(struct ifnet *dev) +static void mlx4_en_clear_uclist(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_addr_list *tmp, *uc_to_del; @@ -635,7 +635,7 @@ return (1); } -static void mlx4_en_cache_uclist(struct ifnet *dev) +static void mlx4_en_cache_uclist(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); @@ -643,7 +643,7 @@ if_foreach_lladdr(dev, mlx4_copy_addr, priv); } -static void mlx4_en_clear_mclist(struct ifnet *dev) +static void mlx4_en_clear_mclist(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_addr_list *tmp, *mc_to_del; @@ -671,7 +671,7 @@ return (1); } -static void mlx4_en_cache_mclist(struct ifnet *dev) +static void mlx4_en_cache_mclist(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); @@ -728,7 +728,7 @@ } } -static void mlx4_en_set_rx_mode(struct ifnet *dev) +static void mlx4_en_set_rx_mode(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); @@ -842,7 +842,7 @@ } static void mlx4_en_do_multicast(struct mlx4_en_priv *priv, - struct ifnet *dev, + if_t dev, struct mlx4_en_dev *mdev) { struct mlx4_en_addr_list *addr_list, *tmp; @@ -977,7 +977,7 @@ } static void mlx4_en_do_unicast(struct mlx4_en_priv *priv, - struct ifnet *dev, + if_t dev, struct mlx4_en_dev *mdev) { struct mlx4_en_addr_list *addr_list, *tmp; @@ -1011,7 +1011,7 @@ struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, rx_mode_task); struct mlx4_en_dev *mdev = priv->mdev; - struct ifnet *dev = priv->dev; + if_t dev = priv->dev; mutex_lock(&mdev->state_lock); if (!mdev->device_up) { @@ -1258,7 +1258,7 @@ } -int mlx4_en_start_port(struct ifnet *dev) +int mlx4_en_start_port(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -1451,7 +1451,7 @@ } -void mlx4_en_stop_port(struct ifnet *dev) +void mlx4_en_stop_port(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -1568,7 +1568,7 @@ struct mlx4_en_priv *priv = container_of(work, struct mlx4_en_priv, watchdog_task); struct mlx4_en_dev *mdev = priv->mdev; - struct ifnet *dev = priv->dev; + if_t dev = priv->dev; struct mlx4_en_tx_ring *ring; int i; @@ -1601,7 +1601,7 @@ mutex_unlock(&mdev->state_lock); } -static void mlx4_en_clear_stats(struct ifnet *dev) +static void mlx4_en_clear_stats(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -1635,7 +1635,7 @@ struct mlx4_en_priv *priv; struct mlx4_en_dev *mdev; - struct ifnet *dev; + if_t dev; int err = 0; priv = arg; @@ -1760,7 +1760,7 @@ #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 ifnet *dev) +void mlx4_en_destroy_netdev(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -1815,7 +1815,7 @@ } -static int mlx4_en_change_mtu(struct ifnet *dev, int new_mtu) +static int mlx4_en_change_mtu(if_t dev, int new_mtu) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -1886,7 +1886,7 @@ return (active); } -static void mlx4_en_media_status(struct ifnet *dev, struct ifmediareq *ifmr) +static void mlx4_en_media_status(if_t dev, struct ifmediareq *ifmr) { struct mlx4_en_priv *priv; @@ -1899,7 +1899,7 @@ return; } -static int mlx4_en_media_change(struct ifnet *dev) +static int mlx4_en_media_change(if_t dev) { struct mlx4_en_priv *priv; struct ifmedia *ifm; @@ -1946,7 +1946,7 @@ return (error); } -static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data) +static int mlx4_en_ioctl(if_t dev, u_long command, caddr_t data) { struct mlx4_en_priv *priv; struct mlx4_en_dev *mdev; @@ -2137,7 +2137,7 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port, struct mlx4_en_port_profile *prof) { - struct ifnet *dev; + if_t dev; struct mlx4_en_priv *priv; uint8_t dev_addr[ETHER_ADDR_LEN]; int err; @@ -2350,7 +2350,7 @@ return err; } -static int mlx4_en_set_ring_size(struct ifnet *dev, +static int mlx4_en_set_ring_size(if_t dev, int rx_size, int tx_size) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); @@ -2424,7 +2424,7 @@ return (error); } -static int mlx4_en_get_module_info(struct ifnet *dev, +static int mlx4_en_get_module_info(if_t dev, struct ethtool_modinfo *modinfo) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); @@ -2471,7 +2471,7 @@ return 0; } -static int mlx4_en_get_module_eeprom(struct ifnet *dev, +static int mlx4_en_get_module_eeprom(if_t dev, struct ethtool_eeprom *ee, u8 *data) { @@ -2655,7 +2655,7 @@ static void mlx4_en_sysctl_conf(struct mlx4_en_priv *priv) { - struct ifnet *dev; + if_t dev; struct sysctl_ctx_list *ctx; struct sysctl_oid *node; struct sysctl_oid_list *node_list; @@ -2896,7 +2896,7 @@ #ifdef DEBUGNET static void -mlx4_en_debugnet_init(struct ifnet *dev, int *nrxr, int *ncl, int *clsize) +mlx4_en_debugnet_init(if_t dev, int *nrxr, int *ncl, int *clsize) { struct mlx4_en_priv *priv; @@ -2909,12 +2909,12 @@ } static void -mlx4_en_debugnet_event(struct ifnet *dev, enum debugnet_ev event) +mlx4_en_debugnet_event(if_t dev, enum debugnet_ev event) { } static int -mlx4_en_debugnet_transmit(struct ifnet *dev, struct mbuf *m) +mlx4_en_debugnet_transmit(if_t dev, struct mbuf *m) { struct mlx4_en_priv *priv; int err; @@ -2931,7 +2931,7 @@ } static int -mlx4_en_debugnet_poll(struct ifnet *dev, int count) +mlx4_en_debugnet_poll(if_t dev, int count) { struct mlx4_en_priv *priv; diff --git a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c --- a/sys/dev/mlx4/mlx4_en/mlx4_en_port.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_port.c @@ -149,7 +149,7 @@ return ret; } -static void mlx4_en_fold_software_stats(struct ifnet *dev) +static void mlx4_en_fold_software_stats(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_dev *mdev = priv->mdev; @@ -187,7 +187,7 @@ 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 ifnet *dev = mdev->pndev[port]; + if_t dev = mdev->pndev[port]; struct mlx4_en_priv *priv = mlx4_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 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_resources.c @@ -43,7 +43,7 @@ int user_prio, struct mlx4_qp_context *context) { struct mlx4_en_dev *mdev = priv->mdev; - struct ifnet *dev = priv->dev; + if_t 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 --- 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_calc_rx_buf(struct ifnet *dev) +void mlx4_en_calc_rx_buf(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); int eff_mtu = dev->if_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN + @@ -735,7 +735,7 @@ * 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 ifnet *dev, struct mlx4_en_cq *cq, int budget) +int mlx4_en_process_rx_cq(if_t dev, struct mlx4_en_cq *cq, int budget) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_cqe *cqe; @@ -866,7 +866,7 @@ /* Rx CQ polling - called by NAPI */ static int mlx4_en_poll_rx_cq(struct mlx4_en_cq *cq, int budget) { - struct ifnet *dev = cq->dev; + if_t 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 --- a/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c +++ b/sys/dev/mlx4/mlx4_en/mlx4_en_tx.c @@ -308,7 +308,7 @@ return (tx_info->nr_txbb); } -int mlx4_en_free_tx_buf(struct ifnet *dev, struct mlx4_en_tx_ring *ring) +int mlx4_en_free_tx_buf(if_t dev, struct mlx4_en_tx_ring *ring) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); int cnt = 0; @@ -344,7 +344,7 @@ return (wqs < (HEADROOM + (2 * MLX4_EN_TX_WQE_MAX_WQEBBS))); } -static int mlx4_en_process_tx_cq(struct ifnet *dev, +static int mlx4_en_process_tx_cq(if_t dev, struct mlx4_en_cq *cq) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); @@ -604,7 +604,7 @@ } SYSINIT(hashrandom_init, SI_SUB_RANDOM, SI_ORDER_ANY, &hashrandom_init, NULL); -u16 mlx4_en_select_queue(struct ifnet *dev, struct mbuf *mb) +u16 mlx4_en_select_queue(if_t dev, struct mbuf *mb) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); u32 rings_p_up = priv->num_tx_rings_p_up; @@ -640,7 +640,7 @@ volatile struct mlx4_wqe_data_seg *dseg_inline; volatile struct mlx4_en_tx_desc *tx_desc; struct mlx4_en_tx_ring *ring = priv->tx_ring[tx_ind]; - struct ifnet *ifp = priv->dev; + if_t ifp = priv->dev; struct mlx4_en_tx_info *tx_info; struct mbuf *mb = *mbp; struct mbuf *m; @@ -927,13 +927,13 @@ } static int -mlx4_en_transmit_locked(struct ifnet *ifp, int tx_ind, struct mbuf *mb) +mlx4_en_transmit_locked(if_t ifp, int tx_ind, struct mbuf *mb) { struct mlx4_en_priv *priv = mlx4_netdev_priv(ifp); struct mlx4_en_tx_ring *ring = priv->tx_ring[tx_ind]; int err = 0; - if (unlikely((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + if (unlikely((if_getdrvflags(ifp) & IFF_DRV_RUNNING) == 0 || READ_ONCE(priv->port_up) == 0)) { m_freem(mb); return (ENETDOWN); @@ -952,7 +952,7 @@ } int -mlx4_en_transmit(struct ifnet *dev, struct mbuf *m) +mlx4_en_transmit(if_t dev, struct mbuf *m) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); struct mlx4_en_tx_ring *ring; @@ -992,7 +992,7 @@ * Flush ring buffers. */ void -mlx4_en_qflush(struct ifnet *dev) +mlx4_en_qflush(if_t dev) { struct mlx4_en_priv *priv = mlx4_netdev_priv(dev); diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib.h b/sys/dev/mlx4/mlx4_ib/mlx4_ib.h --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib.h +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib.h @@ -495,7 +495,7 @@ struct mlx4_ib_iboe { spinlock_t lock; - struct ifnet *netdevs[MLX4_MAX_PORTS]; + if_t 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_ah.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_ah.c @@ -98,7 +98,7 @@ eth_zero_addr(ah->av.eth.s_mac); if (gid_attr.ndev) { vlan_tag = rdma_vlan_dev_vlan_id(gid_attr.ndev); - memcpy(ah->av.eth.s_mac, IF_LLADDR(gid_attr.ndev), ETH_ALEN); + memcpy(ah->av.eth.s_mac, if_getlladdr(gid_attr.ndev), ETH_ALEN); if_rele(gid_attr.ndev); } if (vlan_tag < 0x1000) diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_main.c @@ -131,10 +131,10 @@ return ib_ports; } -static struct ifnet *mlx4_ib_get_netdev(struct ib_device *device, u8 port_num) +static if_t mlx4_ib_get_netdev(struct ib_device *device, u8 port_num) { struct mlx4_ib_dev *ibdev = to_mdev(device); - struct ifnet *dev; + if_t dev; rcu_read_lock(); dev = mlx4_get_protocol_dev(ibdev->dev, MLX4_PROT_ETH, port_num); @@ -142,11 +142,11 @@ #if 0 if (dev) { if (mlx4_is_bonded(ibdev->dev)) { - struct ifnet *upper = NULL; + if_t upper = NULL; upper = netdev_master_upper_dev_get_rcu(dev); if (upper) { - struct ifnet *active; + if_t active; active = bond_option_active_slave_get_rcu(mlx4_netdev_priv(upper)); if (active) @@ -691,7 +691,7 @@ struct mlx4_ib_dev *mdev = to_mdev(ibdev); struct mlx4_ib_iboe *iboe = &mdev->iboe; - struct ifnet *ndev; + if_t ndev; enum ib_mtu tmp; struct mlx4_cmd_mailbox *mailbox; int err = 0; @@ -1252,7 +1252,7 @@ int mlx4_ib_add_mc(struct mlx4_ib_dev *mdev, struct mlx4_ib_qp *mqp, union ib_gid *gid) { - struct ifnet *ndev; + if_t ndev; int ret = 0; if (!mqp->port) @@ -1868,7 +1868,7 @@ struct mlx4_ib_dev *mdev = to_mdev(ibqp->device); struct mlx4_dev *dev = mdev->dev; struct mlx4_ib_qp *mqp = to_mqp(ibqp); - struct ifnet *ndev; + if_t ndev; struct mlx4_ib_gid_entry *ge; struct mlx4_flow_reg_id reg_id = {0, 0}; enum mlx4_protocol prot = MLX4_PROT_IB_IPV6; @@ -2192,14 +2192,14 @@ #define MLX4_IB_INVALID_MAC ((u64)-1) static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev, - struct ifnet *dev, + if_t dev, int port) { u64 new_smac = 0; u64 release_mac = MLX4_IB_INVALID_MAC; struct mlx4_ib_qp *qp; - new_smac = mlx4_mac_to_u64(IF_LLADDR(dev)); + new_smac = mlx4_mac_to_u64(if_getlladdr(dev)); atomic64_set(&ibdev->iboe.mac[port - 1], new_smac); @@ -2247,7 +2247,7 @@ } static void mlx4_ib_scan_netdevs(struct mlx4_ib_dev *ibdev, - struct ifnet *dev, + if_t dev, unsigned long event) { @@ -2278,7 +2278,7 @@ static int mlx4_ib_netdev_event(struct notifier_block *this, unsigned long event, void *ptr) { - struct ifnet *dev = netdev_notifier_info_to_ifp(ptr); + if_t dev = netdev_notifier_info_to_ifp(ptr); struct mlx4_ib_dev *ibdev; if (dev->if_vnet != &init_net) @@ -3014,7 +3014,7 @@ kfree(ew); spin_lock_bh(&ibdev->iboe.lock); for (i = 0; i < MLX4_MAX_PORTS; ++i) { - struct ifnet *curr_netdev = ibdev->iboe.netdevs[i]; + if_t curr_netdev = ibdev->iboe.netdevs[i]; enum ib_port_state curr_port_state; if (!curr_netdev) diff --git a/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c b/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c --- a/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c +++ b/sys/dev/mlx4/mlx4_ib/mlx4_ib_qp.c @@ -1790,7 +1790,7 @@ status = -ENOENT; if (!status && gid_attr.ndev) { vlan = rdma_vlan_dev_vlan_id(gid_attr.ndev); - memcpy(smac, IF_LLADDR(gid_attr.ndev), ETH_ALEN); + memcpy(smac, if_getlladdr(gid_attr.ndev), ETH_ALEN); if_rele(gid_attr.ndev); } }