DMA + network adapter Problem

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

 



I'm doing a strange thing and attempting to insert a new buffer
into the receive ring of a network adapter. I believe that my problem
comes in the form of incorrectly setting up DMA. I have looked at the
documentation on DMA transfers and have found nothing wrong with what
I'm doing. 

What happens? Once the network adapter gets around to dropping a packet
into my buffer, the DMA transfer acts like it works, except that buffer
has not been altered in any way. I actually check the buffer in the
device driver interrupt code (as soon as the transfer is supposed to be
complete). 

My setup:

kernel 2.4.17
e1000-5.2.16 ethernet driver
JUMBO packets


Code Snippet:

// insert my buffer for a receive

// get the descriptor
rx_desc = E1000_RX_DESC(*rx_ring,i);
buffer_info = &rx_ring->buffer_info[i];

// unmap current mapping
pci_unmap_single(pdev,buffer_info->dma,buffer_info->length,PCI_DMA_FROMDEVICE);

// my new buffer
skb->data = kmalloc(16476,GFP_ATOMIC);

// reset the skb pointers
skb->head = skb->data;
skb->tail = skb->data;
skb->end = skb->data + 16416; // leave room for shinfo struct

// remap for DMA transfer
buffer_info->dma =
pci_map_single(pdev,skb->data,16384,PCI_DMA_FROMDEVICE);

// setup the descriptor
rx_desc->buffer_addr = cpu_to_le64(buffer_info->dma);



Is this a DMA issue that I'm not understanding?

Is this a sk_buff issue?

Any thoughts and help would be most appreciated.

Thanks.

-joel

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
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