Lines Matching refs:ksp
174 kstat_t *ksp; in flow_kstats() local
191 ksp = dladm_kstat_lookup(kcp, NULL, -1, attr->fa_flowname, "flow"); in flow_kstats()
193 if (ksp == NULL) in flow_kstats()
197 dladm_get_stats(kcp, ksp, &currstats); in flow_kstats()
200 (void) dladm_kstat_value(ksp, "ifspeed", KSTAT_DATA_UINT64, in flow_kstats()
288 kstat_t *ksp; in link_kstats() local
318 ksp = dladm_kstat_lookup(kcp, NULL, -1, flist->linkname, "net"); in link_kstats()
320 if (ksp == NULL) in link_kstats()
324 dladm_get_stats(kcp, ksp, &currstats); in link_kstats()
327 (void) dladm_kstat_value(ksp, "ifspeed", KSTAT_DATA_UINT64, in link_kstats()
550 kstat_t *ksp = NULL; in dladm_kstat_lookup() local
552 for (ksp = kcp->kc_chain; ksp != NULL; ksp = ksp->ks_next) { in dladm_kstat_lookup()
553 if ((module == NULL || strcmp(ksp->ks_module, module) == 0) && in dladm_kstat_lookup()
554 (instance == -1 || ksp->ks_instance == instance) && in dladm_kstat_lookup()
555 (name == NULL || strcmp(ksp->ks_name, name) == 0) && in dladm_kstat_lookup()
556 (class == NULL || strcmp(ksp->ks_class, class) == 0)) in dladm_kstat_lookup()
557 return (ksp); in dladm_kstat_lookup()
570 dladm_get_stats(kstat_ctl_t *kcp, kstat_t *ksp, pktsum_t *stats) in dladm_get_stats() argument
573 if (kstat_read(kcp, ksp, NULL) == -1) in dladm_get_stats()
578 if (dladm_kstat_value(ksp, "ipackets64", KSTAT_DATA_UINT64, in dladm_get_stats()
580 if (dladm_kstat_value(ksp, "ipackets", KSTAT_DATA_UINT64, in dladm_get_stats()
585 if (dladm_kstat_value(ksp, "opackets64", KSTAT_DATA_UINT64, in dladm_get_stats()
587 if (dladm_kstat_value(ksp, "opackets", KSTAT_DATA_UINT64, in dladm_get_stats()
592 if (dladm_kstat_value(ksp, "rbytes64", KSTAT_DATA_UINT64, in dladm_get_stats()
594 if (dladm_kstat_value(ksp, "rbytes", KSTAT_DATA_UINT64, in dladm_get_stats()
599 if (dladm_kstat_value(ksp, "obytes64", KSTAT_DATA_UINT64, in dladm_get_stats()
601 if (dladm_kstat_value(ksp, "obytes", KSTAT_DATA_UINT64, in dladm_get_stats()
606 if (dladm_kstat_value(ksp, "ierrors", KSTAT_DATA_UINT32, in dladm_get_stats()
608 if (dladm_kstat_value(ksp, "ierrors", KSTAT_DATA_UINT64, in dladm_get_stats()
613 if (dladm_kstat_value(ksp, "oerrors", KSTAT_DATA_UINT32, in dladm_get_stats()
615 if (dladm_kstat_value(ksp, "oerrors", KSTAT_DATA_UINT64, in dladm_get_stats()
622 dladm_kstat_value(kstat_t *ksp, const char *name, uint8_t type, void *buf) in dladm_kstat_value() argument
626 if ((knp = kstat_data_lookup(ksp, (char *)name)) == NULL) in dladm_kstat_value()
656 kstat_t *ksp; in dladm_get_single_mac_stat() local
685 if ((ksp = kstat_lookup(kcp, module, instance, "mac")) == NULL && in dladm_get_single_mac_stat()
686 (ksp = kstat_lookup(kcp, module, instance, NULL)) == NULL) in dladm_get_single_mac_stat()
689 if (kstat_read(kcp, ksp, NULL) == -1) in dladm_get_single_mac_stat()
692 if (dladm_kstat_value(ksp, name, type, val) < 0) in dladm_get_single_mac_stat()
1137 i_dlstat_get_stats(kstat_ctl_t *kcp, kstat_t *ksp, void *stats, in i_dlstat_get_stats() argument
1142 if (kstat_read(kcp, ksp, NULL) == -1) in i_dlstat_get_stats()
1149 if (dladm_kstat_value(ksp, stats_list[i].si_name, in i_dlstat_get_stats()
1202 kstat_t *ksp; in i_query_legacy_stats() local
1209 ksp = dladm_kstat_lookup(kcp, "link", 0, linkname, NULL); in i_query_legacy_stats()
1211 if (ksp != NULL) in i_query_legacy_stats()
1212 dladm_get_stats(kcp, ksp, stats); in i_query_legacy_stats()
1302 i_dlstat_rx_hwlane_search(kstat_t *ksp) in i_dlstat_rx_hwlane_search() argument
1304 return (ksp->ks_instance == 0 && in i_dlstat_rx_hwlane_search()
1305 strstr(ksp->ks_name, "mac_rx") != 0 && in i_dlstat_rx_hwlane_search()
1306 strstr(ksp->ks_name, "hwlane") != 0 && in i_dlstat_rx_hwlane_search()
1307 strstr(ksp->ks_name, "fanout") == 0 && in i_dlstat_rx_hwlane_search()
1308 strcmp(ksp->ks_class, "net") == 0); in i_dlstat_rx_hwlane_search()
1313 i_dlstat_tx_hwlane_search(kstat_t *ksp) in i_dlstat_tx_hwlane_search() argument
1315 return (ksp->ks_instance == 0 && in i_dlstat_tx_hwlane_search()
1316 strstr(ksp->ks_name, "mac_tx") != 0 && in i_dlstat_tx_hwlane_search()
1317 strstr(ksp->ks_name, "hwlane") != 0 && in i_dlstat_tx_hwlane_search()
1318 strcmp(ksp->ks_class, "net") == 0); in i_dlstat_tx_hwlane_search()
1323 i_dlstat_fanout_search(kstat_t *ksp) in i_dlstat_fanout_search() argument
1325 return (ksp->ks_instance == 0 && in i_dlstat_fanout_search()
1326 strstr(ksp->ks_name, "mac_rx") != 0 && in i_dlstat_fanout_search()
1327 strstr(ksp->ks_name, "swlane") != 0 && in i_dlstat_fanout_search()
1328 strstr(ksp->ks_name, "fanout") != 0 && in i_dlstat_fanout_search()
1329 strcmp(ksp->ks_class, "net") == 0); in i_dlstat_fanout_search()
1334 i_dlstat_rx_ring_search(kstat_t *ksp) in i_dlstat_rx_ring_search() argument
1336 return (ksp->ks_instance == 0 && in i_dlstat_rx_ring_search()
1337 strstr(ksp->ks_name, "mac_rx") != 0 && in i_dlstat_rx_ring_search()
1338 strstr(ksp->ks_name, "ring") != 0 && in i_dlstat_rx_ring_search()
1339 strcmp(ksp->ks_class, "net") == 0); in i_dlstat_rx_ring_search()
1344 i_dlstat_tx_ring_search(kstat_t *ksp) in i_dlstat_tx_ring_search() argument
1346 return (ksp->ks_instance == 0) && in i_dlstat_tx_ring_search()
1347 strstr(ksp->ks_name, "mac_tx") != 0 && in i_dlstat_tx_ring_search()
1348 strstr(ksp->ks_name, "ring") != 0 && in i_dlstat_tx_ring_search()
1349 strcmp(ksp->ks_class, "net") == 0; in i_dlstat_tx_ring_search()
1377 kstat_t *ksp; in i_dlstat_get_idlist() local
1392 for (ksp = kcp->kc_chain; ksp != NULL; ksp = ksp->ks_next) { in i_dlstat_get_idlist()
1393 if ((strcmp(ksp->ks_module, modname) == 0) && in i_dlstat_get_idlist()
1394 fptr_searchkstat(ksp)) { in i_dlstat_get_idlist()
1395 idlist[(*size)++] = atoi(&ksp->ks_name[prefixlen]); in i_dlstat_get_idlist()
1410 kstat_t *ksp; in i_dlstat_query_stats() local
1427 ksp = dladm_kstat_lookup(kcp, modname, 0, statname, NULL); in i_dlstat_query_stats()
1428 if (ksp == NULL) in i_dlstat_query_stats()
1435 curr->dc_statentry = fn(kcp, ksp, index); in i_dlstat_query_stats()
1461 kstat_t *ksp; in i_dlstat_misc_stats() local
1467 ksp = dladm_kstat_lookup(kcp, linkname, 0, DLSTAT_MAC_MISC_STAT, NULL); in i_dlstat_misc_stats()
1468 if (ksp == NULL) in i_dlstat_misc_stats()
1475 i_dlstat_get_stats(kcp, ksp, &misc_stat_entry->mse_stats, in i_dlstat_misc_stats()
1515 i_dlstat_rx_hwlane_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_rx_hwlane_retrieve_stat() argument
1526 i_dlstat_get_stats(kcp, ksp, &rx_lane_stat_entry->rle_stats, in i_dlstat_rx_hwlane_retrieve_stat()
1535 i_dlstat_rx_swlane_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_rx_swlane_retrieve_stat() argument
1546 i_dlstat_get_stats(kcp, ksp, &rx_lane_stat_entry->rle_stats, in i_dlstat_rx_swlane_retrieve_stat()
1559 i_dlstat_rx_local_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_rx_local_retrieve_stat() argument
1575 i_dlstat_get_stats(kcp, ksp, &rx_lane_stat_entry->rle_stats, in i_dlstat_rx_local_retrieve_stat()
1792 i_dlstat_tx_hwlane_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_tx_hwlane_retrieve_stat() argument
1803 i_dlstat_get_stats(kcp, ksp, &tx_lane_stat_entry->tle_stats, in i_dlstat_tx_hwlane_retrieve_stat()
1812 i_dlstat_tx_swlane_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_tx_swlane_retrieve_stat() argument
1823 i_dlstat_get_stats(kcp, ksp, &tx_lane_stat_entry->tle_stats, in i_dlstat_tx_swlane_retrieve_stat()
2094 i_dlstat_fanout_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_fanout_retrieve_stat() argument
2108 i_dlstat_get_stats(kcp, ksp, &fanout_stat_entry->fe_stats, in i_dlstat_fanout_retrieve_stat()
2266 i_dlstat_rx_ring_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_rx_ring_retrieve_stat() argument
2276 i_dlstat_get_stats(kcp, ksp, &rx_ring_stat_entry->re_stats, in i_dlstat_rx_ring_retrieve_stat()
2353 i_dlstat_tx_ring_retrieve_stat(kstat_ctl_t *kcp, kstat_t *ksp, int i) in i_dlstat_tx_ring_retrieve_stat() argument
2363 i_dlstat_get_stats(kcp, ksp, &tx_ring_stat_entry->re_stats, in i_dlstat_tx_ring_retrieve_stat()
2653 kstat_t *ksp; in i_dlstat_single_port_stats() local
2666 ksp = dladm_kstat_lookup(kcp, module, instance, "mac", NULL); in i_dlstat_single_port_stats()
2667 if (ksp == NULL) in i_dlstat_single_port_stats()
2677 i_dlstat_get_stats(kcp, ksp, &aggr_port_stat_entry->ape_stats, in i_dlstat_single_port_stats()
2996 kstat_t *ksp; in dladm_flow_stat_query() local
3006 ksp = dladm_kstat_lookup(kcp, NULL, -1, flowname, "flow"); in dladm_flow_stat_query()
3008 if (ksp != NULL) { in dladm_flow_stat_query()
3009 i_dlstat_get_stats(kcp, ksp, flow_stat, flow_stats_list, in dladm_flow_stat_query()