func (pid Port) StatsReset() error {
	return errget(C.rte_eth_stats_reset(C.ushort(pid)))
}
StatsReset resets stats counters.
package ethdev
import "C"
import (
	"unsafe"
	"github.com/yerden/go-dpdk/common"
)
type cXstat C.struct_rte_eth_xstat
type Stats C.struct_rte_eth_stats
type Xstat struct {
	Index uint64
	Value uint64
}
type XstatName C.struct_rte_eth_xstat_name
func (x *XstatName) String() string {
	return C.GoString(&x.name[0])
}
type GoStats struct {
	Ipackets uint64 `metric:"ipackets" type:"counter"`
	Opackets uint64 `metric:"opackets" type:"counter"`
	Ibytes   uint64 `metric:"ibytes" type:"counter"`
	Obytes   uint64 `metric:"obytes" type:"counter"`
	Imissed  uint64 `metric:"imissed" type:"counter"`
	Ierrors  uint64 `metric:"ierrors" type:"counter"`
	Oerrors  uint64 `metric:"oerrors" type:"counter"`
	RxNoMbuf uint64 `metric:"rxnombuf" type:"counter"`
}
func (s *Stats) Cast() *GoStats {
	return (*GoStats)(unsafe.Pointer(s))
}
type statsAsU64 [unsafe.Sizeof(Stats{}) / 8]uint64
func (s *Stats) Diff(old, delta *Stats) {
	cur := (*statsAsU64)(unsafe.Pointer(s))
	src := (*statsAsU64)(unsafe.Pointer(old))
	d := (*statsAsU64)(unsafe.Pointer(delta))
	for i := range cur {
		if cur[i] > src[i] && src[i] != 0 {
			d[i] = cur[i] - src[i]
		}
	}
}
func (pid Port) StatsGet(stats *Stats) error {
	return errget(C.rte_eth_stats_get(C.ushort(pid), (*C.struct_rte_eth_stats)(stats)))
}
func (pid Port) XstatNames() ([]XstatName, error) {
	n := C.rte_eth_xstats_get_names(C.ushort(pid), nil, 0)
	if n <= 0 {
		return nil, errget(n)
	}
	names := make([]XstatName, n)
	C.rte_eth_xstats_get_names(C.ushort(pid), (*C.struct_rte_eth_xstat_name)(&names[0]), C.uint(n))
	return names, nil
}
func (pid Port) XstatsGet(out []Xstat) (int, error) {
	var p *C.struct_rte_eth_xstat
	if len(out) != 0 {
		p = (*C.struct_rte_eth_xstat)(unsafe.Pointer(&out[0]))
	}
	n := C.rte_eth_xstats_get(C.ushort(pid), p, C.uint(len(out)))
	return common.IntOrErr(n)
}
func (pid Port) XstatsReset() error {
	return errget(C.rte_eth_xstats_reset(C.ushort(pid)))
}