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
MFC after:	10 days
Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D30515
This commit is contained in:
Bjoern A. Zeeb 2021-06-04 15:36:08 +00:00
parent 801cf532e7
commit 1411f52fac
23 changed files with 145 additions and 145 deletions

View File

@ -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);

View File

@ -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 @@ int mlx4_en_start_port(struct net_device *dev)
}
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 @@ static void mlx4_en_restart(struct work_struct *work)
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 @@ static int mlx4_en_ioctl(struct ifnet *dev, u_long command, caddr_t data)
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 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
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;

View File

@ -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;

View File

@ -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);

View File

@ -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 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
/* 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;

View File

@ -308,7 +308,7 @@ mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
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;

View File

@ -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];

View File

@ -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 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev,
}
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)

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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 @@ int ib_cache_gid_del(struct ib_device *ib_dev, u8 port,
}
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)
{

View File

@ -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) {

View File

@ -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 @@ static int cma_ib_handler(struct ib_cm_id *cm_id, struct ib_cm_event *ib_event)
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 @@ static struct rdma_id_private *cma_new_conn_id(struct rdma_cm_id *listen_id,
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;
struct ifnet *ndev = NULL;
if (dev_addr->bound_dev_if)
ndev = dev_get_by_index(dev_addr->net,

View File

@ -732,7 +732,7 @@ void ib_enum_roce_netdev(struct ib_device *ib_dev,
for (port = rdma_start_port(ib_dev); port <= rdma_end_port(ib_dev);
port++)
if (rdma_protocol_roce(ib_dev, port)) {
struct net_device *idev = NULL;
struct ifnet *idev = NULL;
if (ib_dev->get_netdev)
idev = ib_dev->get_netdev(ib_dev, port);
@ -779,7 +779,7 @@ void ib_enum_all_roce_netdevs(roce_netdev_filter filter,
*
* @ndev: Pointer to netdevice
*/
void ib_cache_gid_del_all_by_netdev(struct net_device *ndev)
void ib_cache_gid_del_all_by_netdev(struct ifnet *ndev)
{
struct ib_device *ib_dev;
u8 port;
@ -872,7 +872,7 @@ EXPORT_SYMBOL(ib_modify_port);
* parameter may be NULL.
*/
int ib_find_gid(struct ib_device *device, union ib_gid *gid,
enum ib_gid_type gid_type, struct net_device *ndev,
enum ib_gid_type gid_type, struct ifnet *ndev,
u8 *port_num, u16 *index)
{
union ib_gid tmp_gid;
@ -956,13 +956,13 @@ EXPORT_SYMBOL(ib_find_pkey);
* @addr: Contains the IP address that the request specified as its
* destination.
*/
struct net_device *ib_get_net_dev_by_params(struct ib_device *dev,
struct ifnet *ib_get_net_dev_by_params(struct ib_device *dev,
u8 port,
u16 pkey,
const union ib_gid *gid,
const struct sockaddr *addr)
{
struct net_device *net_dev = NULL;
struct ifnet *net_dev = NULL;
struct ib_client_data *context;
if (!rdma_protocol_ib(dev, port))

View File

@ -723,7 +723,7 @@ EXPORT_SYMBOL(ib_sa_get_mcmember_rec);
int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num,
struct ib_sa_mcmember_rec *rec,
struct net_device *ndev,
struct ifnet *ndev,
enum ib_gid_type gid_type,
struct ib_ah_attr *ah_attr)
{

View File

@ -56,7 +56,7 @@ enum gid_op_type {
struct roce_netdev_event_work {
struct work_struct work;
struct net_device *ndev;
struct ifnet *ndev;
};
struct roce_rescan_work {
@ -91,7 +91,7 @@ unsigned long roce_gid_type_mask_support(struct ib_device *ib_dev, u8 port)
EXPORT_SYMBOL(roce_gid_type_mask_support);
static void update_gid(enum gid_op_type gid_op, struct ib_device *ib_dev,
u8 port, union ib_gid *gid, struct net_device *ndev)
u8 port, union ib_gid *gid, struct ifnet *ndev)
{
int i;
unsigned long gid_type_mask = roce_gid_type_mask_support(ib_dev, port);
@ -119,9 +119,9 @@ static void update_gid(enum gid_op_type gid_op, struct ib_device *ib_dev,
static int
roce_gid_match_netdev(struct ib_device *ib_dev, u8 port,
struct net_device *idev, void *cookie)
struct ifnet *idev, void *cookie)
{
struct net_device *ndev = (struct net_device *)cookie;
struct ifnet *ndev = (struct ifnet *)cookie;
if (idev == NULL)
return (0);
return (ndev == idev);
@ -129,7 +129,7 @@ roce_gid_match_netdev(struct ib_device *ib_dev, u8 port,
static int
roce_gid_match_all(struct ib_device *ib_dev, u8 port,
struct net_device *idev, void *cookie)
struct ifnet *idev, void *cookie)
{
if (idev == NULL)
return (0);
@ -138,7 +138,7 @@ roce_gid_match_all(struct ib_device *ib_dev, u8 port,
static int
roce_gid_enum_netdev_default(struct ib_device *ib_dev,
u8 port, struct net_device *idev)
u8 port, struct ifnet *idev)
{
unsigned long gid_type_mask;
@ -152,7 +152,7 @@ roce_gid_enum_netdev_default(struct ib_device *ib_dev,
static void
roce_gid_update_addr_callback(struct ib_device *device, u8 port,
struct net_device *ndev, void *cookie)
struct ifnet *ndev, void *cookie)
{
struct ipx_entry {
STAILQ_ENTRY(ipx_entry) entry;
@ -161,10 +161,10 @@ roce_gid_update_addr_callback(struct ib_device *device, u8 port,
struct sockaddr_in v4;
struct sockaddr_in6 v6;
} ipx_addr;
struct net_device *ndev;
struct ifnet *ndev;
};
struct ipx_entry *entry;
struct net_device *idev;
struct ifnet *idev;
#if defined(INET) || defined(INET6)
struct ifaddr *ifa;
#endif
@ -315,7 +315,7 @@ roce_gid_queue_scan_event_handler(struct work_struct *_work)
}
static void
roce_gid_queue_scan_event(struct net_device *ndev)
roce_gid_queue_scan_event(struct ifnet *ndev)
{
struct roce_netdev_event_work *work;
@ -358,7 +358,7 @@ roce_gid_delete_all_event_handler(struct work_struct *_work)
}
static void
roce_gid_delete_all_event(struct net_device *ndev)
roce_gid_delete_all_event(struct ifnet *ndev)
{
struct roce_netdev_event_work *work;
@ -380,7 +380,7 @@ roce_gid_delete_all_event(struct net_device *ndev)
static int
inetaddr_event(struct notifier_block *this, unsigned long event, void *ptr)
{
struct net_device *ndev = netdev_notifier_info_to_dev(ptr);
struct ifnet *ndev = netdev_notifier_info_to_ifp(ptr);
switch (event) {
case NETDEV_UNREGISTER:

View File

@ -652,7 +652,7 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
int ret;
u16 gid_index;
int use_roce;
struct net_device *ndev = NULL;
struct ifnet *ndev = NULL;
memset(ah_attr, 0, sizeof *ah_attr);
ah_attr->dlid = be16_to_cpu(rec->dlid);
@ -665,8 +665,8 @@ int ib_init_ah_from_path(struct ib_device *device, u8 port_num,
use_roce = rdma_cap_eth_ah(device, port_num);
if (use_roce) {
struct net_device *idev;
struct net_device *resolved_dev;
struct ifnet *idev;
struct ifnet *resolved_dev;
struct rdma_dev_addr dev_addr = {.bound_dev_if = rec->ifindex,
.net = rec->net ? rec->net :
&init_net};

View File

@ -89,7 +89,7 @@ struct ib_sa_client ipoib_sa_client;
static void ipoib_add_one(struct ib_device *device);
static void ipoib_remove_one(struct ib_device *device, void *client_data);
static struct net_device *ipoib_get_net_dev_by_params(
static struct ifnet *ipoib_get_net_dev_by_params(
struct ib_device *dev, u8 port, u16 pkey,
const union ib_gid *gid, const struct sockaddr *addr,
void *client_data);
@ -1104,7 +1104,7 @@ ipoib_remove_one(struct ib_device *device, void *client_data)
}
static int
ipoib_match_dev_addr(const struct sockaddr *addr, struct net_device *dev)
ipoib_match_dev_addr(const struct sockaddr *addr, struct ifnet *dev)
{
struct epoch_tracker et;
struct ifaddr *ifa;
@ -1138,7 +1138,7 @@ ipoib_match_dev_addr(const struct sockaddr *addr, struct net_device *dev)
static int
ipoib_match_gid_pkey_addr(struct ipoib_dev_priv *priv,
const union ib_gid *gid, u16 pkey_index, const struct sockaddr *addr,
struct net_device **found_net_dev)
struct ifnet **found_net_dev)
{
struct ipoib_dev_priv *child_priv;
int matches = 0;
@ -1147,7 +1147,7 @@ ipoib_match_gid_pkey_addr(struct ipoib_dev_priv *priv,
(!gid || !memcmp(gid, &priv->local_gid, sizeof(*gid)))) {
if (addr == NULL || ipoib_match_dev_addr(addr, priv->dev) != 0) {
if (*found_net_dev == NULL) {
struct net_device *net_dev;
struct ifnet *net_dev;
if (priv->parent != NULL)
net_dev = priv->parent;
@ -1182,7 +1182,7 @@ ipoib_match_gid_pkey_addr(struct ipoib_dev_priv *priv,
static int
__ipoib_get_net_dev_by_params(struct list_head *dev_list, u8 port,
u16 pkey_index, const union ib_gid *gid,
const struct sockaddr *addr, struct net_device **net_dev)
const struct sockaddr *addr, struct ifnet **net_dev)
{
struct ipoib_dev_priv *priv;
int matches = 0;
@ -1203,11 +1203,11 @@ __ipoib_get_net_dev_by_params(struct list_head *dev_list, u8 port,
return matches;
}
static struct net_device *
static struct ifnet *
ipoib_get_net_dev_by_params(struct ib_device *dev, u8 port, u16 pkey,
const union ib_gid *gid, const struct sockaddr *addr, void *client_data)
{
struct net_device *net_dev;
struct ifnet *net_dev;
struct list_head *dev_list = client_data;
u16 pkey_index;
int matches;

View File

@ -142,7 +142,7 @@ int rdma_resolve_ip_route(struct sockaddr *src_addr,
void rdma_addr_cancel(struct rdma_dev_addr *addr);
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);
int rdma_addr_size(struct sockaddr *addr);
@ -151,7 +151,7 @@ int rdma_addr_size_kss(struct sockaddr_storage *addr);
int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
const union ib_gid *dgid,
u8 *smac, struct net_device *dev,
u8 *smac, struct ifnet *dev,
int *hoplimit);
static inline u16 ib_addr_get_pkey(struct rdma_dev_addr *dev_addr)
@ -176,7 +176,7 @@ static inline int rdma_addr_gid_offset(struct rdma_dev_addr *dev_addr)
return dev_addr->dev_type == ARPHRD_INFINIBAND ? 4 : 0;
}
static inline u16 rdma_vlan_dev_vlan_id(const struct net_device *dev)
static inline u16 rdma_vlan_dev_vlan_id(const struct ifnet *dev)
{
uint16_t tag;
@ -231,7 +231,7 @@ static inline void rdma_gid2ip(struct sockaddr *out, const union ib_gid *gid)
static inline void iboe_addr_get_sgid(struct rdma_dev_addr *dev_addr,
union ib_gid *gid)
{
struct net_device *dev;
struct ifnet *dev;
struct ifaddr *ifa;
#ifdef VIMAGE
@ -300,7 +300,7 @@ static inline enum ib_mtu iboe_get_mtu(int mtu)
return 0;
}
static inline int iboe_get_rate(struct net_device *dev)
static inline int iboe_get_rate(struct ifnet *dev)
{
uint64_t baudrate = dev->if_baudrate;
#ifdef if_baudrate_pf
@ -365,7 +365,7 @@ static inline u16 rdma_get_vlan_id(union ib_gid *dgid)
return vid < 0x1000 ? vid : 0xffff;
}
static inline struct net_device *rdma_vlan_dev_real_dev(struct net_device *dev)
static inline struct ifnet *rdma_vlan_dev_real_dev(struct ifnet *dev)
{
struct epoch_tracker et;

View File

@ -76,7 +76,7 @@ int ib_get_cached_gid(struct ib_device *device,
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);
@ -99,7 +99,7 @@ int ib_find_cached_gid_by_port(struct ib_device *device,
const union ib_gid *gid,
enum ib_gid_type gid_type,
u8 port_num,
struct net_device *ndev,
struct ifnet *ndev,
u16 *index);
int ib_find_gid_by_filter(struct ib_device *device,

View File

@ -181,7 +181,7 @@ struct ib_sa_path_rec {
enum ib_gid_type gid_type;
};
static inline struct net_device *ib_get_ndev_from_path(struct ib_sa_path_rec *rec)
static inline struct ifnet *ib_get_ndev_from_path(struct ib_sa_path_rec *rec)
{
#ifdef VIMAGE
if (rec->net == NULL)
@ -425,7 +425,7 @@ int ib_sa_get_mcmember_rec(struct ib_device *device, u8 port_num,
*/
int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num,
struct ib_sa_mcmember_rec *rec,
struct net_device *ndev,
struct ifnet *ndev,
enum ib_gid_type gid_type,
struct ib_ah_attr *ah_attr);

View File

@ -92,7 +92,7 @@ enum ib_gid_type {
#define ROCE_V2_UDP_DPORT 4791
struct ib_gid_attr {
enum ib_gid_type gid_type;
struct net_device *ndev;
struct ifnet *ndev;
};
enum rdma_node_type {
@ -1892,7 +1892,7 @@ struct ib_device {
* that this function returns NULL before the net device reaches
* NETDEV_UNREGISTER_FINAL state.
*/
struct net_device *(*get_netdev)(struct ib_device *device,
struct ifnet *(*get_netdev)(struct ib_device *device,
u8 port_num);
int (*query_gid)(struct ib_device *device,
u8 port_num, int index,
@ -2139,7 +2139,7 @@ struct ib_client {
*
* The caller is responsible for calling dev_put on the returned
* netdev. */
struct net_device *(*get_net_dev_by_params)(
struct ifnet *(*get_net_dev_by_params)(
struct ib_device *dev,
u8 port,
u16 pkey,
@ -2564,7 +2564,7 @@ int ib_modify_port(struct ib_device *device,
struct ib_port_modify *port_modify);
int ib_find_gid(struct ib_device *device, union ib_gid *gid,
enum ib_gid_type gid_type, struct net_device *ndev,
enum ib_gid_type gid_type, struct ifnet *ndev,
u8 *port_num, u16 *index);
int ib_find_pkey(struct ib_device *device,
@ -3341,7 +3341,7 @@ static inline int ib_check_mr_access(int flags)
int ib_check_mr_status(struct ib_mr *mr, u32 check_mask,
struct ib_mr_status *mr_status);
struct net_device *ib_get_net_dev_by_params(struct ib_device *dev, u8 port,
struct ifnet *ib_get_net_dev_by_params(struct ib_device *dev, u8 port,
u16 pkey, const union ib_gid *gid,
const struct sockaddr *addr);
struct ib_wq *ib_create_wq(struct ib_pd *pd,