[Click] PollDevice Element

Beyers Cronje bcronje at gmail.com
Tue Jun 7 21:31:49 EDT 2005


Hi Qinghua,

Click comes with polling drivers based on eepro100 and tulip as well. 
Adding polling support involves in short the following:

1) Changing the interrupt handler of the driver to check if click
polling has been enabled, if so do nothing.

2) Click adds some callback functions and polling variable to the
net_device struct, ie using the e1000 driver:
netdev->polling = 0;       // Check if click polling is enabled or not

netdev->rx_poll = e1000_rx_poll;   
// Click calls rx_poll whenever PollDevice is scheduled. rx_poll
returns a list of sk_buff's that has been sitting in the NICs receive
buffer. rx_poll should NULL the sk_buff's send to Click.

netdev->rx_refill = e1000_rx_refill;
// If rx_poll returned any sk_buff's PollDevice then calls rx_refill
and passes a new list of sk_buff's to the driver. rx_refill should use
this list to update the drivers receive buffer and receive
descriptors.

netdev->tx_clean = e1000_tx_clean;
// Whenever ToDevice is scheduled it calls tx_clean to clean already
send sk_buffs from the NICs transmit queue. tx_clean should return
this list.

netdev->tx_queue = e1000_tx_pqueue; 
//ToDevice then calls tx_queue and passes an sk_buff to the driver for
transmission.

netdev->tx_eob = e1000_tx_eob;
/tx_eob should set the TX Descriptor Tail

netdev->tx_start = e1000_tx_start;
//tc_start calls tx_eob - Anyone more info on this ?

netdev->poll_off = e1000_poll_off;
//disabling click polling and enabling the NICs irq

netdev->poll_on = e1000_poll_on;
//disabling the NICs irq and enabling click polling


You should be able to use most of the existing driver code as a base
and apply some changes as mentioned above to fill the callback
functions. Ie using the e1000 driver:

e1000_rx_poll is very similar to e1000_clean_rx_irq
e1000_rx_refill     ->      e1000_alloc_rx_buffers
e1000_tx_pqueue       ->     e1000_xmit_frame
e1000_tx_clean     ->     e1000_clean_tx_irq

Hope this helps. Best advice I can give is to look at the e1000
polling driver to get some feel of what should be done.

Beyers

On 6/7/05, Qinghua(Kevin) Ye <qye at trlabs.ca> wrote:
> Hi
> 
> Does there anyone has been working on PollDevice Element on other NICs besides e1000?
> 
> We have broadcom NetXtreme BCM5700 NIC, and trying to improve the performance with polling (Seems on 2.6, my Opteron SMP system -- Linux 2.6.11 can only route 35% of the incoming 64B packets. ). Is that difficult to add the polling support?
> 
> Regards,
> Qinghua(Kevin) Ye
> _______________________________________________
> click mailing list
> click at amsterdam.lcs.mit.edu
> https://amsterdam.lcs.mit.edu/mailman/listinfo/click
>



More information about the click mailing list