FreeBSD/sys/dev/nxge/xgehal/xgehal-stats.c
/*
 * __hal_stats_soft_reset - Reset software-maintained statistics.
 */
Reset software-maintained statistics.
Reset software - maintained statistics .
void
__hal_stats_soft_reset (xge_hal_device_h devh, int reset_all)
{
	xge_list_t *item;
	xge_hal_channel_t *channel;
	xge_hal_device_t *hldev = (xge_hal_device_t *)devh;
	    if (reset_all)  {
	    if (xge_hal_device_check_id(hldev) != XGE_HAL_CARD_TITAN) {
	        xge_os_memzero(&hldev->stats.hw_info_saved,
	                   sizeof(xge_hal_stats_hw_info_t));
	        xge_os_memzero(&hldev->stats.hw_info_latest,
	                   sizeof(xge_hal_stats_hw_info_t));
	    } else {
	        xge_os_memzero(&hldev->stats.pcim_info_saved,
	                   sizeof(xge_hal_stats_pcim_info_t));
	        xge_os_memzero(&hldev->stats.pcim_info_latest,
	                   sizeof(xge_hal_stats_pcim_info_t));
	    }
	    }
	xge_os_memzero(&hldev->stats.sw_dev_err_stats,
	             sizeof(xge_hal_stats_sw_err_t));
	xge_os_memzero(&hldev->stats.sw_dev_info_stats,
	             sizeof(xge_hal_stats_device_info_t));
	xge_list_for_each(item, &hldev->ring_channels) {
	    channel = xge_container_of(item, xge_hal_channel_t, item);
	    xge_os_memzero(&channel->stats,
	                 sizeof(xge_hal_stats_channel_info_t));
	}
	xge_list_for_each(item, &hldev->fifo_channels) {
	    channel = xge_container_of(item, xge_hal_channel_t, item);
	    xge_os_memzero(&channel->stats,
	                 sizeof(xge_hal_stats_channel_info_t));
	}
}
void __hal_stats_soft_reset ( xge_hal_device_h devh , int reset_all ) { xge_list_t * item ; xge_hal_channel_t * channel ; xge_hal_device_t * hldev = ( xge_hal_device_t * ) devh ; if ( reset_all ) { if ( xge_hal_device_check_id ( hldev ) != XGE_HAL_CARD_TITAN ) { xge_os_memzero ( & hldev -> stats . hw_info_saved , sizeof ( xge_hal_stats_hw_info_t ) ) ; xge_os_memzero ( & hldev -> stats . hw_info_latest , sizeof ( xge_hal_stats_hw_info_t ) ) ; } else { xge_os_memzero ( & hldev -> stats . pcim_info_saved , sizeof ( xge_hal_stats_pcim_info_t ) ) ; xge_os_memzero ( & hldev -> stats . pcim_info_latest , sizeof ( xge_hal_stats_pcim_info_t ) ) ; } } xge_os_memzero ( & hldev -> stats . sw_dev_err_stats , sizeof ( xge_hal_stats_sw_err_t ) ) ; xge_os_memzero ( & hldev -> stats . sw_dev_info_stats , sizeof ( xge_hal_stats_device_info_t ) ) ; xge_list_for_each ( item , & hldev -> ring_channels ) { channel = xge_container_of ( item , xge_hal_channel_t , item ) ; xge_os_memzero ( & channel -> stats , sizeof ( xge_hal_stats_channel_info_t ) ) ; } xge_list_for_each ( item , & hldev -> fifo_channels ) { channel = xge_container_of ( item , xge_hal_channel_t , item ) ; xge_os_memzero ( & channel -> stats , sizeof ( xge_hal_stats_channel_info_t ) ) ; } }
__hal_stats_soft_reset - Reset software-maintained statistics.
__hal_stats_soft_reset - Reset software - maintained statistics .
/* Reset the "soft" error and informational statistics */ /* for each Rx channel */ /* for each Tx channel */