DMA + network adapter Problem

From: Joel Hollingsworth
Date: Thu Mar 25 2004 - 15:51:50 EST


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

-
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