luigirizzo / netmap

Automatically exported from code.google.com/p/netmap
BSD 2-Clause "Simplified" License
1.86k stars 537 forks source link

ixgbe RX dropped counter #256

Open gbayard opened 8 years ago

gbayard commented 8 years ago

I using netmap and ixgbe 4.1.13. I am spinning my consumer on iotcl calls for RX. Generally this works well and I can consume very large packet volumes. Occasionally, I see the dropped packet count reported by the kernel via ifconfig or other tools increase (I suspect my spinner spent to long between ioctl calls or my thread was preempted, but I haven't confirmed either). It's not necessarily correlated with peak packet load and I am trying to debug. I don't see any code in netmap or the ixgbe driver which increments this counter. I can confirm that packets were lost by examining the recording so the dropped counter is accurate.

Any suggestion on what code might be reporting these dropped packets and is there anyway for my user space consumer to know packets were dropped upstream?

vmaffione commented 7 years ago

netmap txsync/rxsync do not currently keep statistics, so unfortunately there is no way for the application to get them. You can easily modify txsync/rxsync to count them. You shouldn't get any ifconfig counter incremented when the NIC is in netmap mode, because the driver routines are bypassed.

emillynge commented 5 years ago

I have an application where it is fairly important to known whether packets are being dropped at the NIC and how many.

You can easily modify txsync/rxsync to count them.

So, looking at igb_netmap_rxsync(struct netmap_kring *kring, int flags) it is not immediately apparent how I would go about doing this.

Actually I have a hard time even understanding what the code will do if there is no room left on the netmap ring.

Furthermore, I do not know where to find whatever counter I would want to increment, or whether I would have to create that variable myself.

I'm not opposed creating a pull request to do this work for quite a few of the adapters, but I would need you to point me in the right direction.