Print this page
2904 hxge forgets C isn't math


 876          * Loopback statistics.
 877          */
 878         hxgekp->lb_mode.value.ul = psp->lb_mode;
 879 
 880         HXGE_DEBUG_MSG((hxgep, KST_CTL, "<== hxge_port_kstat_update"));
 881         return (0);
 882 }
 883 
 884 /*
 885  * Retrieve a value for one of the statistics for a particular rx ring
 886  */
 887 int
 888 hxge_rx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
 889 {
 890         p_hxge_ring_handle_t    rhp = (p_hxge_ring_handle_t)rdriver;
 891         p_hxge_t                hxgep = rhp->hxgep;
 892 
 893         ASSERT(rhp != NULL);
 894         ASSERT(hxgep != NULL);
 895         ASSERT(hxgep->statsp != NULL);
 896         ASSERT(0 <= rhp->index < HXGE_MAX_RDCS);
 897 
 898         switch (stat) {
 899         case MAC_STAT_IERRORS:
 900                 *val = hxgep->statsp->rdc_stats[rhp->index].ierrors;
 901                 break;
 902         case MAC_STAT_RBYTES:
 903                 *val = hxgep->statsp->rdc_stats[rhp->index].ibytes;
 904                 break;
 905         case MAC_STAT_IPACKETS:
 906                 *val = hxgep->statsp->rdc_stats[rhp->index].ipackets;
 907                 break;
 908         default:
 909                 *val = 0;
 910                 return (ENOTSUP);
 911         }
 912 
 913         return (0);
 914 }
 915 
 916 /*
 917  * Retrieve a value for one of the statistics for a particular tx ring
 918  */
 919 int
 920 hxge_tx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
 921 {
 922         p_hxge_ring_handle_t    rhp = (p_hxge_ring_handle_t)rdriver;
 923         p_hxge_t                hxgep = rhp->hxgep;
 924 
 925         ASSERT(rhp != NULL);
 926         ASSERT(hxgep != NULL);
 927         ASSERT(hxgep->statsp != NULL);
 928         ASSERT(0 <= rhp->index < HXGE_MAX_TDCS);
 929 
 930         switch (stat) {
 931         case MAC_STAT_OERRORS:
 932                 *val = hxgep->statsp->tdc_stats[rhp->index].oerrors;
 933                 break;
 934         case MAC_STAT_OBYTES:
 935                 *val = hxgep->statsp->tdc_stats[rhp->index].obytes;
 936                 break;
 937         case MAC_STAT_OPACKETS:
 938                 *val = hxgep->statsp->tdc_stats[rhp->index].opackets;
 939                 break;
 940         default:
 941                 *val = 0;
 942                 return (ENOTSUP);
 943         }
 944 
 945         return (0);
 946 }
 947 
 948 int




 876          * Loopback statistics.
 877          */
 878         hxgekp->lb_mode.value.ul = psp->lb_mode;
 879 
 880         HXGE_DEBUG_MSG((hxgep, KST_CTL, "<== hxge_port_kstat_update"));
 881         return (0);
 882 }
 883 
 884 /*
 885  * Retrieve a value for one of the statistics for a particular rx ring
 886  */
 887 int
 888 hxge_rx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
 889 {
 890         p_hxge_ring_handle_t    rhp = (p_hxge_ring_handle_t)rdriver;
 891         p_hxge_t                hxgep = rhp->hxgep;
 892 
 893         ASSERT(rhp != NULL);
 894         ASSERT(hxgep != NULL);
 895         ASSERT(hxgep->statsp != NULL);
 896         ASSERT((rhp->index >= 0) && (rhp->index < HXGE_MAX_RDCS));
 897 
 898         switch (stat) {
 899         case MAC_STAT_IERRORS:
 900                 *val = hxgep->statsp->rdc_stats[rhp->index].ierrors;
 901                 break;
 902         case MAC_STAT_RBYTES:
 903                 *val = hxgep->statsp->rdc_stats[rhp->index].ibytes;
 904                 break;
 905         case MAC_STAT_IPACKETS:
 906                 *val = hxgep->statsp->rdc_stats[rhp->index].ipackets;
 907                 break;
 908         default:
 909                 *val = 0;
 910                 return (ENOTSUP);
 911         }
 912 
 913         return (0);
 914 }
 915 
 916 /*
 917  * Retrieve a value for one of the statistics for a particular tx ring
 918  */
 919 int
 920 hxge_tx_ring_stat(mac_ring_driver_t rdriver, uint_t stat, uint64_t *val)
 921 {
 922         p_hxge_ring_handle_t    rhp = (p_hxge_ring_handle_t)rdriver;
 923         p_hxge_t                hxgep = rhp->hxgep;
 924 
 925         ASSERT(rhp != NULL);
 926         ASSERT(hxgep != NULL);
 927         ASSERT(hxgep->statsp != NULL);
 928         ASSERT((rhp->index >= 0) && (rhp->index < HXGE_MAX_TDCS));
 929 
 930         switch (stat) {
 931         case MAC_STAT_OERRORS:
 932                 *val = hxgep->statsp->tdc_stats[rhp->index].oerrors;
 933                 break;
 934         case MAC_STAT_OBYTES:
 935                 *val = hxgep->statsp->tdc_stats[rhp->index].obytes;
 936                 break;
 937         case MAC_STAT_OPACKETS:
 938                 *val = hxgep->statsp->tdc_stats[rhp->index].opackets;
 939                 break;
 940         default:
 941                 *val = 0;
 942                 return (ENOTSUP);
 943         }
 944 
 945         return (0);
 946 }
 947 
 948 int