Hi all,

Nice to meet you. :D
I am studying e1000 driver (linux-2.6.30.4) and need some help to understand
the code.

What I am curious about is whether the frame arrived at NIC is copied to
main memory or resides at NIC memory until the frame is processed.
In common sense, it is likely that the frame is copied to PC's main memory
but I could not find and copy function in the code.
8139too.c driver has a function to copy a frame from NIC to main memory
(skb_copy_to_linear_data) but e1000 doesn't.
But instead, once e1000 allocates skb (netdev_alloc_skb), e1000 passes
skb->data to pci_map_single function.

  buffer_info->dma = pci_map_single(pdev,
        skb->data,
        adapter->rx_buffer_len,
        PCI_DMA_FROMDEVICE);


Not sure how this function works. I can think of two ways.

1. Map skb->data to NIC's memory. Like DMA, when we read skb->data, we
actually read the memory in NIC.
2. NIC pushes a received frame to kernel allocated memory (skb->data).


Would you please tell me which is right behavior?

2 sounds more reasonable when we look at e1000_clean_rx_irq function but I
am quite sure.
static bool e1000_clean_rx_irq(struct e1000_adapter *adapter,
          struct e1000_rx_ring *rx_ring,
          int *work_done, int work_to_do)
{
  ...
  skb = buffer_info->skb;
  buffer_info->skb = NULL;
  ...
}

One more question is..
I heard that e1000 driver supports zero copy.
Do we say above logic as "zero copy"?

Look forward your reply.
Thank you for reading,

Shaun.
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
E1000-devel mailing list
E1000-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel® Ethernet, visit 
http://communities.intel.com/community/wired

Reply via email to