src/dpdk/drivers/net/qede/base/ecore_l2.c
void ecore_reset_vport_stats(struct ecore_dev *p_dev)
{
	int i;

	for_each_hwfn(p_dev, i) {
		struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
		struct eth_mstorm_per_queue_stat mstats;
		struct eth_ustorm_per_queue_stat ustats;
		struct eth_pstorm_per_queue_stat pstats;
		struct ecore_ptt *p_ptt = IS_PF(p_dev) ?
		    ecore_ptt_acquire(p_hwfn) : OSAL_NULL;
		u32 addr = 0, len = 0;

		if (IS_PF(p_dev) && !p_ptt) {
			DP_ERR(p_hwfn, "Failed to acquire ptt\n");
			continue;
		}

		OSAL_MEMSET(&mstats, 0, sizeof(mstats));
		__ecore_get_vport_mstats_addrlen(p_hwfn, &addr, &len, 0);
		ecore_memcpy_to(p_hwfn, p_ptt, addr, &mstats, len);

		OSAL_MEMSET(&ustats, 0, sizeof(ustats));
		__ecore_get_vport_ustats_addrlen(p_hwfn, &addr, &len, 0);
		ecore_memcpy_to(p_hwfn, p_ptt, addr, &ustats, len);

		OSAL_MEMSET(&pstats, 0, sizeof(pstats));
		__ecore_get_vport_pstats_addrlen(p_hwfn, &addr, &len, 0);
		ecore_memcpy_to(p_hwfn, p_ptt, addr, &pstats, len);

		if (IS_PF(p_dev))
			ecore_ptt_release(p_hwfn, p_ptt);
	}

	/* PORT statistics are not necessarily reset, so we need to
	 * read and create a baseline for future statistics.
	 * Link change stat is maintained by MFW, return its value as is.
	 */
	if (!p_dev->reset_stats)
		DP_INFO(p_dev, "Reset stats not allocated\n");
	else {
		_ecore_get_vport_stats(p_dev, p_dev->reset_stats);
		p_dev->reset_stats->common.link_change_count = 0;
	}
}
/* zeroes V-PORT specific portion of stats (Port stats remains untouched) */
zeroes V-PORT specific portion of stats (Port stats remains untouched)
zeroes V - PORT specific portion of stats ( Port stats remains untouched )
void ecore_reset_vport_stats(struct ecore_dev *p_dev)
{
	int i;
	for_each_hwfn(p_dev, i) {
		struct ecore_hwfn *p_hwfn = &p_dev->hwfns[i];
		struct eth_mstorm_per_queue_stat mstats;
		struct eth_ustorm_per_queue_stat ustats;
		struct eth_pstorm_per_queue_stat pstats;
		struct ecore_ptt *p_ptt = IS_PF(p_dev) ?
		    ecore_ptt_acquire(p_hwfn) : OSAL_NULL;
		u32 addr = 0, len = 0;
		if (IS_PF(p_dev) && !p_ptt) {
			DP_ERR(p_hwfn, "Failed to acquire ptt\n");
			continue;
		}
		OSAL_MEMSET(&mstats, 0, sizeof(mstats));
		__ecore_get_vport_mstats_addrlen(p_hwfn, &addr, &len, 0);
		ecore_memcpy_to(p_hwfn, p_ptt, addr, &mstats, len);
		OSAL_MEMSET(&ustats, 0, sizeof(ustats));
		__ecore_get_vport_ustats_addrlen(p_hwfn, &addr, &len, 0);
		ecore_memcpy_to(p_hwfn, p_ptt, addr, &ustats, len);
		OSAL_MEMSET(&pstats, 0, sizeof(pstats));
		__ecore_get_vport_pstats_addrlen(p_hwfn, &addr, &len, 0);
		ecore_memcpy_to(p_hwfn, p_ptt, addr, &pstats, len);
		if (IS_PF(p_dev))
			ecore_ptt_release(p_hwfn, p_ptt);
	}
	if (!p_dev->reset_stats)
		DP_INFO(p_dev, "Reset stats not allocated\n");
	else {
		_ecore_get_vport_stats(p_dev, p_dev->reset_stats);
		p_dev->reset_stats->common.link_change_count = 0;
	}
}
void ecore_reset_vport_stats ( struct ecore_dev * p_dev ) { int i ; for_each_hwfn ( p_dev , i ) { struct ecore_hwfn * p_hwfn = & p_dev -> hwfns [ i ] ; struct eth_mstorm_per_queue_stat mstats ; struct eth_ustorm_per_queue_stat ustats ; struct eth_pstorm_per_queue_stat pstats ; struct ecore_ptt * p_ptt = IS_PF ( p_dev ) ? ecore_ptt_acquire ( p_hwfn ) : OSAL_NULL ; u32 addr = 0 , len = 0 ; if ( IS_PF ( p_dev ) && ! p_ptt ) { DP_ERR ( p_hwfn , " \n " ) ; continue ; } OSAL_MEMSET ( & mstats , 0 , sizeof ( mstats ) ) ; __ecore_get_vport_mstats_addrlen ( p_hwfn , & addr , & len , 0 ) ; ecore_memcpy_to ( p_hwfn , p_ptt , addr , & mstats , len ) ; OSAL_MEMSET ( & ustats , 0 , sizeof ( ustats ) ) ; __ecore_get_vport_ustats_addrlen ( p_hwfn , & addr , & len , 0 ) ; ecore_memcpy_to ( p_hwfn , p_ptt , addr , & ustats , len ) ; OSAL_MEMSET ( & pstats , 0 , sizeof ( pstats ) ) ; __ecore_get_vport_pstats_addrlen ( p_hwfn , & addr , & len , 0 ) ; ecore_memcpy_to ( p_hwfn , p_ptt , addr , & pstats , len ) ; if ( IS_PF ( p_dev ) ) ecore_ptt_release ( p_hwfn , p_ptt ) ; } if ( ! p_dev -> reset_stats ) DP_INFO ( p_dev , " \n " ) ; else { _ecore_get_vport_stats ( p_dev , p_dev -> reset_stats ) ; p_dev -> reset_stats -> common . link_change_count = 0 ; } }
zeroes V-PORT specific portion of stats (Port stats remains untouched)
zeroes V - PORT specific portion of stats ( Port stats remains untouched )
/* PORT statistics are not necessarily reset, so we need to
	 * read and create a baseline for future statistics.
	 * Link change stat is maintained by MFW, return its value as is.
	 */