5

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;
    }
  • Did you find the answer? Share if yes. I'm here with the same question. – rlib Aug 25 '16 at 7:11
  • nope, i never found out how :( – Christopher Neylan Oct 12 '16 at 0:16
0
probe kernel.statement("enqueue_to_backlog@net/core/dev.c:3536") {
    printf("probe enqueue_to_backlog on cpu: %d qlen: %d\n", $sd->cpu, $qlen + 1)
}

systemtap probe. Line number(3536) depends on kernel version, look for this line

if (qlen <= netdev_max_backlog && !skb_flow_limit(skb, qlen)) {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.