Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_en/mlx5_en_main.c
Show First 20 Lines • Show All 3,658 Lines • ▼ Show 20 Lines | |||||
mlx5e_create_ifp(struct mlx5_core_dev *mdev) | mlx5e_create_ifp(struct mlx5_core_dev *mdev) | ||||
{ | { | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct mlx5e_priv *priv; | struct mlx5e_priv *priv; | ||||
u8 dev_addr[ETHER_ADDR_LEN] __aligned(4); | u8 dev_addr[ETHER_ADDR_LEN] __aligned(4); | ||||
struct sysctl_oid_list *child; | struct sysctl_oid_list *child; | ||||
int ncv = mdev->priv.eq_table.num_comp_vectors; | int ncv = mdev->priv.eq_table.num_comp_vectors; | ||||
char unit[16]; | char unit[16]; | ||||
struct pfil_head_args pa; | |||||
int err; | int err; | ||||
int i; | int i; | ||||
u32 eth_proto_cap; | u32 eth_proto_cap; | ||||
if (mlx5e_check_required_hca_cap(mdev)) { | if (mlx5e_check_required_hca_cap(mdev)) { | ||||
mlx5_core_dbg(mdev, "mlx5e_check_required_hca_cap() failed\n"); | mlx5_core_dbg(mdev, "mlx5e_check_required_hca_cap() failed\n"); | ||||
return (NULL); | return (NULL); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 218 Lines • ▼ Show 20 Lines | #endif | ||||
SYSCTL_ADD_INT(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), | SYSCTL_ADD_INT(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), | ||||
OID_AUTO, "rx_clbr_done", CTLFLAG_RD, | OID_AUTO, "rx_clbr_done", CTLFLAG_RD, | ||||
&priv->clbr_done, 0, | &priv->clbr_done, 0, | ||||
"RX timestamps calibration state"); | "RX timestamps calibration state"); | ||||
callout_init(&priv->tstmp_clbr, CALLOUT_DIRECT); | callout_init(&priv->tstmp_clbr, CALLOUT_DIRECT); | ||||
mlx5e_reset_calibration_callout(priv); | mlx5e_reset_calibration_callout(priv); | ||||
pa.pa_version = PFIL_VERSION; | |||||
pa.pa_flags = PFIL_IN; | |||||
pa.pa_type = PFIL_TYPE_ETHERNET; | |||||
pa.pa_headname = ifp->if_xname; | |||||
priv->pfil = pfil_head_register(&pa); | |||||
return (priv); | return (priv); | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
err_create_mkey: | err_create_mkey: | ||||
mlx5_core_destroy_mkey(priv->mdev, &priv->mr); | mlx5_core_destroy_mkey(priv->mdev, &priv->mr); | ||||
#endif | #endif | ||||
err_dealloc_transport_domain: | err_dealloc_transport_domain: | ||||
mlx5_dealloc_transport_domain(mdev, priv->tdn); | mlx5_dealloc_transport_domain(mdev, priv->tdn); | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | #endif | ||||
mlx5e_close_locked(ifp); | mlx5e_close_locked(ifp); | ||||
PRIV_UNLOCK(priv); | PRIV_UNLOCK(priv); | ||||
/* wait for all unlimited send tags to go away */ | /* wait for all unlimited send tags to go away */ | ||||
while (priv->channel_refs != 0) { | while (priv->channel_refs != 0) { | ||||
if_printf(priv->ifp, "Waiting for all unlimited connections " | if_printf(priv->ifp, "Waiting for all unlimited connections " | ||||
"to terminate\n"); | "to terminate\n"); | ||||
pause("W", hz); | pause("W", hz); | ||||
} | |||||
/* deregister pfil */ | |||||
if (priv->pfil != NULL) { | |||||
pfil_head_unregister(priv->pfil); | |||||
priv->pfil = NULL; | |||||
} | } | ||||
/* unregister device */ | /* unregister device */ | ||||
ifmedia_removeall(&priv->media); | ifmedia_removeall(&priv->media); | ||||
ether_ifdetach(ifp); | ether_ifdetach(ifp); | ||||
if_free(ifp); | if_free(ifp); | ||||
#ifdef RATELIMIT | #ifdef RATELIMIT | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |