**This is an old revision of the document!** ----
===== Week 6 [ Mon 28 Jun 2010 - Sun 3 Jul 2010 ] ===== ==== Day 1 [ Mon 28 Jun 2010 ] ==== Git commit: [[http://git.etherboot.org/?p=people/andreif/gpxe.git;a=commit;h=caf738b675be03f6b190518cba0e6ac5cadbc5ee|caf738b675be03f6b190518cba0e6ac5cadbc5ee]] Started working on the .open implementation today, and the first couple of lines of code were related to the NIC's power mode. Now I don't think you can interact with a NIC when it's off :) so I suspect there is some low-power mode involved that the NIC starts in. Next up I learned about [[http://en.wikipedia.org/wiki/Ethernet_flow_control|pause frames]] which are a means of flow control in Ethernet. What happens is that a receiver overwhelmed by the amount of traffic that is sent to it, starts sending out pause frames that cause the sender to limit the amount of traffic sent. This might sound good but apparently it interferes with TCP's flow control mechanisms and this leads to [[http://www.smallnetbuilder.com/index2.php?option=com_content&task=view&id=30212&pop=1&page=0&Itemid=54|poor performance]]. Some of the nForce NICs have support for PAUSE frames. Finally, the descriptor rings had to be set up. These differ a little from the pcnet32 descriptor. For starters, there are no separate descriptor formats for rx and tx. Both of them have the same layout:<code> u32 buf u32 flaglen </code> There is also an extended descriptor format that newer NICs use. The result is that all of the descriptors (rx+tx) are stored in one large circular buffer. Besides these, the driver stores an array of ''struct nv_skb_map'' which has the following layout:<code> struct sk_buff *skb dma_addr_t dma; unsigned int dma_len:31; unsigned int dma_single:1; struct ring_desc_ex *first_tx_desc; struct nv_skb_map *next_tx_ctx; </code> The equivalent of the ''sk_buff'' structure is gPXE's ''iobuf'' so I renamed it ''struct nv_iob_map''. Now, the question is: what does it do? The linked list format suggests some sort of packet fragmentation but I'm not sure yet, once I reach _transmit I'll probably figure it out though.