Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c
Show All 12 Lines | |||||
const char **desc, unsigned num, u64 * arg) | const char **desc, unsigned num, u64 * arg) | ||||
{ | { | ||||
struct sysctl_oid *node; | struct sysctl_oid *node; | ||||
unsigned x; | unsigned x; | ||||
sysctl_ctx_init(ctx); | sysctl_ctx_init(ctx); | ||||
node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, | node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, | ||||
buffer, CTLFLAG_RD, NULL, "Statistics"); | buffer, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics"); | ||||
if (node == NULL) | if (node == NULL) | ||||
return; | return; | ||||
for (x = 0; x != num; x++) { | for (x = 0; x != num; x++) { | ||||
SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, | SYSCTL_ADD_UQUAD(ctx, SYSCTL_CHILDREN(node), OID_AUTO, | ||||
desc[2 * x], CTLFLAG_RD, arg + x, desc[2 * x + 1]); | desc[2 * x], CTLFLAG_RD, arg + x, desc[2 * x + 1]); | ||||
} | } | ||||
} | } | ||||
void | void | ||||
mlx5e_create_counter_stats(struct sysctl_ctx_list *ctx, | mlx5e_create_counter_stats(struct sysctl_ctx_list *ctx, | ||||
struct sysctl_oid_list *parent, const char *buffer, | struct sysctl_oid_list *parent, const char *buffer, | ||||
const char **desc, unsigned num, counter_u64_t *arg) | const char **desc, unsigned num, counter_u64_t *arg) | ||||
{ | { | ||||
struct sysctl_oid *node; | struct sysctl_oid *node; | ||||
unsigned x; | unsigned x; | ||||
sysctl_ctx_init(ctx); | sysctl_ctx_init(ctx); | ||||
node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, | node = SYSCTL_ADD_NODE(ctx, parent, OID_AUTO, | ||||
buffer, CTLFLAG_RD, NULL, "Statistics"); | buffer, CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Statistics"); | ||||
if (node == NULL) | if (node == NULL) | ||||
return; | return; | ||||
for (x = 0; x != num; x++) { | for (x = 0; x != num; x++) { | ||||
SYSCTL_ADD_COUNTER_U64(ctx, SYSCTL_CHILDREN(node), OID_AUTO, | SYSCTL_ADD_COUNTER_U64(ctx, SYSCTL_CHILDREN(node), OID_AUTO, | ||||
desc[2 * x], CTLFLAG_RD, arg + x, desc[2 * x + 1]); | desc[2 * x], CTLFLAG_RD, arg + x, desc[2 * x + 1]); | ||||
} | } | ||||
} | } | ||||
Show All 24 Lines | |||||
int x; | int x; | ||||
/* sysctl context we are using */ | /* sysctl context we are using */ | ||||
ctx = &priv->sysctl_ctx; | ctx = &priv->sysctl_ctx; | ||||
/* create root node */ | /* create root node */ | ||||
node = SYSCTL_ADD_NODE(ctx, | node = SYSCTL_ADD_NODE(ctx, | ||||
SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, | SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, | ||||
"diagnostics", CTLFLAG_RD, NULL, "Diagnostics"); | "diagnostics", CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, "Diagnostics"); | ||||
if (node == NULL) | if (node == NULL) | ||||
return; | return; | ||||
/* create PCI diagnostics */ | /* create PCI diagnostics */ | ||||
for (x = 0; x != MLX5_CORE_PCI_DIAGNOSTICS_NUM; x++) { | for (x = 0; x != MLX5_CORE_PCI_DIAGNOSTICS_NUM; x++) { | ||||
entry = mlx5_core_pci_diagnostics_table[x]; | entry = mlx5_core_pci_diagnostics_table[x]; | ||||
if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) | if (mlx5_core_supports_diagnostics(priv->mdev, entry.counter_id) == 0) | ||||
continue; | continue; | ||||
Show All 24 Lines | |||||
err = mlx5_nic_vport_query_local_lb(priv->mdev, MLX5_LOCAL_UC_LB, &val); | err = mlx5_nic_vport_query_local_lb(priv->mdev, MLX5_LOCAL_UC_LB, &val); | ||||
if (err == 0) | if (err == 0) | ||||
priv->params_ethtool.uc_local_lb = val; | priv->params_ethtool.uc_local_lb = val; | ||||
} | } | ||||
/* create root node */ | /* create root node */ | ||||
node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, | node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, | ||||
SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, | SYSCTL_CHILDREN(priv->sysctl_ifnet), OID_AUTO, | ||||
"conf", CTLFLAG_RW, NULL, "Configuration"); | "conf", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, "Configuration"); | ||||
if (node == NULL) | if (node == NULL) | ||||
return; | return; | ||||
for (x = 0; x != MLX5E_PARAMS_NUM; x++) { | for (x = 0; x != MLX5E_PARAMS_NUM; x++) { | ||||
/* check for read-only parameter */ | /* check for read-only parameter */ | ||||
if (strstr(mlx5e_params_desc[2 * x], "_max") != NULL || | if (strstr(mlx5e_params_desc[2 * x], "_max") != NULL || | ||||
strstr(mlx5e_params_desc[2 * x], "_mtu") != NULL) { | strstr(mlx5e_params_desc[2 * x], "_mtu") != NULL) { | ||||
SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, | SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(node), OID_AUTO, | ||||
mlx5e_params_desc[2 * x], CTLTYPE_U64 | CTLFLAG_RD | | mlx5e_params_desc[2 * x], CTLTYPE_U64 | CTLFLAG_RD | | ||||
Show All 24 Lines | |||||
mlx5e_ethtool_handler(NULL, priv, x, NULL); | mlx5e_ethtool_handler(NULL, priv, x, NULL); | ||||
#endif | #endif | ||||
} | } | ||||
} | } | ||||
/* create fec node */ | /* create fec node */ | ||||
fec_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, | fec_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, | ||||
SYSCTL_CHILDREN(node), OID_AUTO, | SYSCTL_CHILDREN(node), OID_AUTO, | ||||
"fec", CTLFLAG_RW, NULL, "Forward Error Correction"); | "fec", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, | ||||
"Forward Error Correction"); | |||||
if (fec_node == NULL) | if (fec_node == NULL) | ||||
return; | return; | ||||
if (mlx5e_fec_update(priv) == 0) { | if (mlx5e_fec_update(priv) == 0) { | ||||
SYSCTL_ADD_U32(&priv->sysctl_ctx, SYSCTL_CHILDREN(fec_node), OID_AUTO, | SYSCTL_ADD_U32(&priv->sysctl_ctx, SYSCTL_CHILDREN(fec_node), OID_AUTO, | ||||
"mode_active", CTLFLAG_RD | CTLFLAG_MPSAFE, | "mode_active", CTLFLAG_RD | CTLFLAG_MPSAFE, | ||||
&priv->params_ethtool.fec_mode_active, 0, | &priv->params_ethtool.fec_mode_active, 0, | ||||
"Current FEC mode bit, if any."); | "Current FEC mode bit, if any."); | ||||
Show All 24 Lines | |||||
"PCI device name"); | "PCI device name"); | ||||
/* Diagnostics support */ | /* Diagnostics support */ | ||||
mlx5e_create_diagnostics(priv); | mlx5e_create_diagnostics(priv); | ||||
/* create qos node */ | /* create qos node */ | ||||
qos_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, | qos_node = SYSCTL_ADD_NODE(&priv->sysctl_ctx, | ||||
SYSCTL_CHILDREN(node), OID_AUTO, | SYSCTL_CHILDREN(node), OID_AUTO, | ||||
"qos", CTLFLAG_RW, NULL, "Quality Of Service configuration"); | "qos", CTLFLAG_RW | CTLFLAG_MPSAFE, NULL, | ||||
"Quality Of Service configuration"); | |||||
if (qos_node == NULL) | if (qos_node == NULL) | ||||
return; | return; | ||||
/* Priority rate limit support */ | /* Priority rate limit support */ | ||||
if (mlx5e_getmaxrate(priv) == 0) { | if (mlx5e_getmaxrate(priv) == 0) { | ||||
SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), | SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(qos_node), | ||||
OID_AUTO, "tc_max_rate", CTLTYPE_U64 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, | OID_AUTO, "tc_max_rate", CTLTYPE_U64 | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, | ||||
priv, 0, mlx5e_tc_maxrate_handler, "QU", | priv, 0, mlx5e_tc_maxrate_handler, "QU", | ||||
Show All 12 Lines |