return priv->netdev->num_rx_queues / max_t(u8, profile->rq_groups, 1);
}
-int mlx5e_netdev_init(struct net_device *netdev,
- struct mlx5e_priv *priv,
- struct mlx5_core_dev *mdev);
-void mlx5e_netdev_cleanup(struct net_device *netdev, struct mlx5e_priv *priv);
+int mlx5e_priv_init(struct mlx5e_priv *priv,
+ struct net_device *netdev,
+ struct mlx5_core_dev *mdev);
+void mlx5e_priv_cleanup(struct mlx5e_priv *priv);
struct net_device *
mlx5e_create_netdev(struct mlx5_core_dev *mdev, unsigned int txqs, unsigned int rxqs);
int mlx5e_attach_netdev(struct mlx5e_priv *priv);
};
/* mlx5e generic netdev management API (move to en_common.c) */
-int mlx5e_netdev_init(struct net_device *netdev,
- struct mlx5e_priv *priv,
- struct mlx5_core_dev *mdev)
+int mlx5e_priv_init(struct mlx5e_priv *priv,
+ struct net_device *netdev,
+ struct mlx5_core_dev *mdev)
{
memset(priv, 0, sizeof(*priv));
return -ENOMEM;
}
-void mlx5e_netdev_cleanup(struct net_device *netdev, struct mlx5e_priv *priv)
+void mlx5e_priv_cleanup(struct mlx5e_priv *priv)
{
int i;
return NULL;
}
- err = mlx5e_netdev_init(netdev, netdev_priv(netdev), mdev);
+ err = mlx5e_priv_init(netdev_priv(netdev), netdev, mdev);
if (err) {
- mlx5_core_err(mdev, "mlx5e_netdev_init failed, err=%d\n", err);
+ mlx5_core_err(mdev, "mlx5e_priv_init failed, err=%d\n", err);
goto err_free_netdev;
}
dev_net_set(netdev, mlx5_core_net(mdev));
struct mlx5_core_dev *mdev = priv->mdev;
int err;
- err = mlx5e_netdev_init(netdev, priv, mdev);
+ err = mlx5e_priv_init(priv, netdev, mdev);
if (err) {
- mlx5_core_err(mdev, "mlx5e_netdev_init failed, err=%d\n", err);
+ mlx5_core_err(mdev, "mlx5e_priv_init failed, err=%d\n", err);
return err;
}
priv->profile = new_profile;
/* cleanup old profile */
mlx5e_detach_netdev(priv);
priv->profile->cleanup(priv);
- mlx5e_netdev_cleanup(priv->netdev, priv);
+ mlx5e_priv_cleanup(priv);
err = mlx5e_netdev_attach_profile(priv, new_profile, new_ppriv);
if (err) { /* roll back to original profile */
{
struct net_device *netdev = priv->netdev;
- mlx5e_netdev_cleanup(netdev, priv);
+ mlx5e_priv_cleanup(priv);
free_netdev(netdev);
}
/* Called directly before IPoIB netdevice is destroyed to cleanup SW structs */
void mlx5i_cleanup(struct mlx5e_priv *priv)
{
- mlx5e_netdev_cleanup(priv->netdev, priv);
+ mlx5e_priv_cleanup(priv);
}
static void mlx5i_grp_sw_update_stats(struct mlx5e_priv *priv)
goto destroy_ht;
}
- err = mlx5e_netdev_init(netdev, epriv, mdev);
+ err = mlx5e_priv_init(epriv, netdev, mdev);
if (err)
goto destroy_mdev_resources;