Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Show First 20 Lines • Show All 3,676 Lines • ▼ Show 20 Lines | mlx5e_create_ifp(struct mlx5_core_dev *mdev) | ||||
* Try to allocate the priv and make room for worst-case | * Try to allocate the priv and make room for worst-case | ||||
* number of channel structures: | * number of channel structures: | ||||
*/ | */ | ||||
priv = malloc(sizeof(*priv) + | priv = malloc(sizeof(*priv) + | ||||
(sizeof(priv->channel[0]) * mdev->priv.eq_table.num_comp_vectors), | (sizeof(priv->channel[0]) * mdev->priv.eq_table.num_comp_vectors), | ||||
M_MLX5EN, M_WAITOK | M_ZERO); | M_MLX5EN, M_WAITOK | M_ZERO); | ||||
mlx5e_priv_mtx_init(priv); | mlx5e_priv_mtx_init(priv); | ||||
ifp = priv->ifp = if_alloc(IFT_ETHER); | ifp = priv->ifp = if_alloc_dev(IFT_ETHER, mdev->pdev->dev.bsddev); | ||||
if (ifp == NULL) { | if (ifp == NULL) { | ||||
mlx5_core_err(mdev, "if_alloc() failed\n"); | mlx5_core_err(mdev, "if_alloc() failed\n"); | ||||
goto err_free_priv; | goto err_free_priv; | ||||
} | } | ||||
ifp->if_softc = priv; | ifp->if_softc = priv; | ||||
if_initname(ifp, "mce", device_get_unit(mdev->pdev->dev.bsddev)); | if_initname(ifp, "mce", device_get_unit(mdev->pdev->dev.bsddev)); | ||||
ifp->if_mtu = ETHERMTU; | ifp->if_mtu = ETHERMTU; | ||||
ifp->if_init = mlx5e_open; | ifp->if_init = mlx5e_open; | ||||
▲ Show 20 Lines • Show All 365 Lines • Show Last 20 Lines |