Network packet processing related Query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I want to improve my understanding about the logic of the code written
for 'process_backlog ()' .

File Source: net/core/dev.c,  linux-2.6.16

I am considering only Non-NAPI network devices ( > 1) in this discussion.

The 'net_rx_action' function invokes 'dev->poll(dev, &budget)' for each
network device present in 'poll_list'. '
The default handler for Non-NAPI network devices is 'process_backlog ()'.

The signature of the function is:
static int process_backlog (struct net_device *backlog_dev, int *budget)

'backlog_dev' represents the device for which the 'poll' function is
invoked.

In the code body the function acts on CPU specific 'input_pkt_queue'.
This queue holds all the incoming packets from the network devices and
'poll_list' has reference for these network devices.

The function takes out one element (packet) from the 'input_pkt_queue'
and process the packet.

As the 'input_pkt_queue' is shared by all the network devices,
the 'packet' which is popped-out from the list can
be from any network device not required to be from 'backlog_dev' (the device
for which 'process_backlog' has been called).

I have confusion here.
The code doesn't operate only on the packets queued-in by 'backlog_dev' to
'input_pkt_queue'. It pops-out the node from the queue and process it. But it updates the 'quota' which is specific for the device 'backlog_dev' for which the function have got called.

Why it is so? Am I missing out something here?

Thanks for reading my mail patiently.

Regards,
Sachin Rane
--
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux