On Mon, 10 Jun 2019 12:55:07 +0300 İbrahim Ercan <ibrahim.metu@xxxxxxxxx> wrote: > Hi. > I'm trying to do a xdp performance test on redhat based environment. > To do so, I compiled kernel 5.0.13 and iproute 4.6.0 > Then I loaded compiled code to interface with below command. > #ip -force link set dev enp7s0f0 xdp object xdptest.o > > After that packets dropped as expected but I can not see statistics > with ethtool command like below. > #ethtool -S enp7s0f0 | grep xdp > > ethtool version is 4.8 > I did my test with that NIC > Intel Corporation 82599ES 10-Gigabit SFI/SFP+ Network Connection (rev 01) > > I wonder why I can't see statistics. Did I miss something while > compiling kernel or iproute? Should I also compile ethtool too? You did nothing wrong. Consistency for statistics with XDP is a known issue, see [1]. The behavior varies per driver, which obviously is bad from a user perspective. You NIC is based on ixgbe driver, which don't have ethtool stats counters for XDP, instead it actually updates ifconfig counters correctly. While for mlx5 it's opposite (p.s. I use this[2] ethtool stats tool). We want to bring consistency in this area, but there are performance concerns. As any stat counter will bring overhead, and XDP is all about maximum performance. Thus, we want this counter overhead to be opt-in (that is not on as default). Currently you have to add the stats your want to the XDP/BPF program itself. That is the current opt-in mechanism. To help you coded this, we have an example here[3]. [1] https://github.com/xdp-project/xdp-project/blob/master/xdp-project.org#consistency-for-statistics-with-xdp [2] https://github.com/netoptimizer/network-testing/blob/master/bin/ethtool_stats.pl [3] https://github.com/xdp-project/xdp-tutorial/blob/master/common/xdp_stats_kern.h -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer