Linux – How to change receive queue length of a network interface in Linux

linuxnetworkingtcp

I have a server running Linux (kernel 2.6.18) which is dropping incoming network packets drastically. I thought it is suffering from this because the length of the receive queue of that interface is too small (1000 by default). I wanted to enlarge this queue by modifying the value of /proc/sys/net/core/netdev_max_backlog (to 3000). But it did not seem to work. I googled it and found someone say this value only applies to non-NAPI devices which I did not think my device is as NAPI had been introduced since kernel 2.4.20. I did not know whether this is true and turned to the kernel doc installed on the that server, but that doc had not been updated since kernel 2.2.

So I wonder whether this is true, if it is, how can I change that queue length for a NAPI device?

Thanks.
Feng

Best Answer

I finally found that the interface was dropping packets because the driver was configured with a too small Rx descriptor size, which, while working with interrupt coalescence, decides how many packets the driver can hold before it sends the kernel an interrupt. If this value (shown with ethtool -g <interface>) is too small, packets will be dropped before an interrupt can be raised. After I enlarged it with ethtool -G <interface> Rx <a some big value>, no droppings have arisen since.

Thank you everyone.