Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixl_pf_main.c
Show First 20 Lines • Show All 802 Lines • ▼ Show 20 Lines | ixl_vsi_add_sysctls(struct ixl_vsi * vsi, const char * sysctl_name, bool queues_sysctls) | ||||
tree = device_get_sysctl_tree(vsi->dev); | tree = device_get_sysctl_tree(vsi->dev); | ||||
child = SYSCTL_CHILDREN(tree); | child = SYSCTL_CHILDREN(tree); | ||||
vsi->vsi_node = SYSCTL_ADD_NODE(&vsi->sysctl_ctx, child, OID_AUTO, sysctl_name, | vsi->vsi_node = SYSCTL_ADD_NODE(&vsi->sysctl_ctx, child, OID_AUTO, sysctl_name, | ||||
CTLFLAG_RD, NULL, "VSI Number"); | CTLFLAG_RD, NULL, "VSI Number"); | ||||
vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); | vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); | ||||
ixl_add_sysctls_eth_stats(&vsi->sysctl_ctx, vsi_list, &vsi->eth_stats); | ixl_add_sysctls_eth_stats(&vsi->sysctl_ctx, vsi_list, &vsi->eth_stats); | ||||
/* Copy of netstat RX errors counter for validation purposes */ | |||||
SYSCTL_ADD_UQUAD(&vsi->sysctl_ctx, vsi_list, OID_AUTO, "rx_errors", | |||||
CTLFLAG_RD, &vsi->ierrors, | |||||
"RX packet errors"); | |||||
if (queues_sysctls) | if (queues_sysctls) | ||||
ixl_vsi_add_queues_stats(vsi, &vsi->sysctl_ctx); | ixl_vsi_add_queues_stats(vsi, &vsi->sysctl_ctx); | ||||
} | } | ||||
/* | /* | ||||
* Used to set the Tx ITR value for all of the PF LAN VSI's queues. | * Used to set the Tx ITR value for all of the PF LAN VSI's queues. | ||||
* Writes to the ITR registers immediately. | * Writes to the ITR registers immediately. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 1,359 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void | void | ||||
ixl_update_vsi_stats(struct ixl_vsi *vsi) | ixl_update_vsi_stats(struct ixl_vsi *vsi) | ||||
{ | { | ||||
struct ixl_pf *pf; | struct ixl_pf *pf; | ||||
struct ifnet *ifp; | struct ifnet *ifp; | ||||
struct i40e_eth_stats *es; | struct i40e_eth_stats *es; | ||||
u64 tx_discards; | u64 tx_discards, csum_errs; | ||||
struct i40e_hw_port_stats *nsd; | struct i40e_hw_port_stats *nsd; | ||||
pf = vsi->back; | pf = vsi->back; | ||||
ifp = vsi->ifp; | ifp = vsi->ifp; | ||||
es = &vsi->eth_stats; | es = &vsi->eth_stats; | ||||
nsd = &pf->stats; | nsd = &pf->stats; | ||||
ixl_update_eth_stats(vsi); | ixl_update_eth_stats(vsi); | ||||
tx_discards = es->tx_discards + nsd->tx_dropped_link_down; | tx_discards = es->tx_discards + nsd->tx_dropped_link_down; | ||||
csum_errs = 0; | |||||
for (int i = 0; i < vsi->num_rx_queues; i++) | |||||
csum_errs += vsi->rx_queues[i].rxr.csum_errs; | |||||
nsd->checksum_error = csum_errs; | |||||
/* Update ifnet stats */ | /* Update ifnet stats */ | ||||
IXL_SET_IPACKETS(vsi, es->rx_unicast + | IXL_SET_IPACKETS(vsi, es->rx_unicast + | ||||
es->rx_multicast + | es->rx_multicast + | ||||
es->rx_broadcast); | es->rx_broadcast); | ||||
IXL_SET_OPACKETS(vsi, es->tx_unicast + | IXL_SET_OPACKETS(vsi, es->tx_unicast + | ||||
es->tx_multicast + | es->tx_multicast + | ||||
es->tx_broadcast); | es->tx_broadcast); | ||||
IXL_SET_IBYTES(vsi, es->rx_bytes); | IXL_SET_IBYTES(vsi, es->rx_bytes); | ||||
IXL_SET_OBYTES(vsi, es->tx_bytes); | IXL_SET_OBYTES(vsi, es->tx_bytes); | ||||
IXL_SET_IMCASTS(vsi, es->rx_multicast); | IXL_SET_IMCASTS(vsi, es->rx_multicast); | ||||
IXL_SET_OMCASTS(vsi, es->tx_multicast); | IXL_SET_OMCASTS(vsi, es->tx_multicast); | ||||
IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes + | IXL_SET_IERRORS(vsi, nsd->crc_errors + nsd->illegal_bytes + | ||||
nsd->rx_undersize + nsd->rx_oversize + nsd->rx_fragments + | nsd->checksum_error + nsd->rx_length_errors + | ||||
nsd->rx_undersize + nsd->rx_fragments + nsd->rx_oversize + | |||||
nsd->rx_jabber); | nsd->rx_jabber); | ||||
IXL_SET_OERRORS(vsi, es->tx_errors); | IXL_SET_OERRORS(vsi, es->tx_errors); | ||||
IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); | IXL_SET_IQDROPS(vsi, es->rx_discards + nsd->eth.rx_discards); | ||||
IXL_SET_OQDROPS(vsi, tx_discards); | IXL_SET_OQDROPS(vsi, tx_discards); | ||||
IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); | IXL_SET_NOPROTO(vsi, es->rx_unknown_protocol); | ||||
IXL_SET_COLLISIONS(vsi, 0); | IXL_SET_COLLISIONS(vsi, 0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 2,332 Lines • Show Last 20 Lines |