The sysctl netdev_max_backlog
sets a limit to the maximum number of packets allowed in the kernel's backlog queue.
Is there a way to check the current queue size (i.e., how many packets are currently in the queue at a given time)?
Literally, the value of queue->input_pkt_queue.qlen
from net/core/dev.c:netif_rx()
:
queue = &__get_cpu_var(softnet_data);
__get_cpu_var(netdev_rx_stat).total++;
if (queue->input_pkt_queue.qlen <= netdev_max_backlog) {
if (queue->input_pkt_queue.qlen) {
enqueue:
__skb_queue_tail(&queue->input_pkt_queue, skb);
local_irq_restore(flags);
return NET_RX_SUCCESS;
}
Best Answer
systemtap probe. Line number(3536) depends on kernel version, look for this line