Yurong Sun
|
getting mbuf physical address
|
Yurong Sun
01/17/2012 11:13 AM
post90959
|
getting mbuf physical address
Hi,
I have a problem regarding getting mbuf physical address. In transmission, for example, when got a network packet, I
added some additional packet descriptor info into the M_LEADINGSPACE, between m->pkt_dat and m->m_data. I then need to
get the physical address starting from the packet descriptor in order for DMA operation. My assumption is that the mbuf
as a whole is in a contiguous buffer, or at least the buffer between m->pkt_data to the end of m->m_data is. Am I
correct?
Based on my assumption, I used mem_offset64 to get the physical address of the starting point, i.e., m->pkt_data +
alignment offset. It seems not getting the correct one. I noticed that there is mbuf_phys, but that seems, from the code
, only get the m->m_data physical address, not the one that I need.
I have a workaround to copy the mbuf into a contiguous buffer. But I fear for the performance impact.
Any suggestions?
Thanks,
Yurong
|
|
|