Hi,
I need one clarification in the following networking code in Linux 2.6.15.1 . The following function is called from netif_rx to enqueue a new packet (sk_buff) to be processed later by ksoftirq on NET_RX_SOFTIRQ. The *dev argument passed on is softnet_data->backlog_dev
netif_rx_schedule(&queue->backlog_dev) where queue is of sofnet_data for the CPU.
static inline void __netif_rx_schedule(struct net_device *dev)
{
unsigned long flags;
{
unsigned long flags;
local_irq_save(flags);
dev_hold(dev);
list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
if (dev->quota < 0)
dev->quota += dev->weight;
else
dev->quota = dev->weight;
__raise_softirq_irqoff(NET_RX_SOFTIRQ);
local_irq_restore(flags);
}
dev_hold(dev);
list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
if (dev->quota < 0)
dev->quota += dev->weight;
else
dev->quota = dev->weight;
__raise_softirq_irqoff(NET_RX_SOFTIRQ);
local_irq_restore(flags);
}
Question:
=======
In the above function I am not able to understand what we are trying to achieve in the list_add_tail. We are adding the poll_list from the backlog_dev to the poll_list of softnet_data.
Which net_devices the backlog_dev->poll_list contain? And which net_devices the softnet_data->poll_list contain ? If somebody can explain the theory behind this it would be of great help.
Thanks,
Pranjal