2008-07-07 13:45:43     How to align the sk_buff 'data' field on an odd word address?

Document created by Aaronwu Employee on Aug 7, 2013
Version 1Show Document
  • View in full screen mode

2008-07-07 13:45:43     How to align the sk_buff 'data' field on an odd word address?

Jean-Francois Argentino (FRANCE)

Message: 58452   

 

Hello,

 

I'm using linux on a blackfin BF537E rev 0.2 DSP from analog devices.

Due to a hardware bug, ethernet Tx can't use the DMA to get data from memory if the "data" field of the sk_buff structure isn't aligned on an odd word address.

 

So, is there a trick to allocate the datagram I give to the "sendto" function on an odd word address?

 

But I'm not sure it will be sufficient since I'm not able to connect the "bfin_mac_hard_start_xmit" function and the "sock_sendmsg" which is, I hope, the kernel entry point...

 

If some network driver guru can point to me where's the sk_buff "data" field is connected to my user-side datagram address, I'm working in MULTICAST.

 

Thanks for any help.

TranslateQuoteReplyEditDelete

 

 

2008-07-07 14:07:12     Re: How to align the sk_buff 'data' field on an odd word address?

Robin Getz (UNITED STATES)

Message: 58455   

 

Jean-Francois:

 

You mean you have a collection of random bytes in userspace (which is at an odd address) that you want to pass out a socket? and the Ethernet driver currently crashes?

 

Or can you explain what you are doing in a little more detail?

 

Thanks

 

 

QuoteReplyEditDelete

 

 

2008-07-07 22:04:31     Re: How to align the sk_buff 'data' field on an odd word address?

Bryan Wu (CHINA)

Message: 58461   

 

Hi Jean,

 

bfin_mac.c driver handles odd/even word address. If sk_buff 'data' field aligned to even word address, driver will do memcpy.

 

In the trunk kernel driver, we add TXDWA support to revision > 2 bf537 silicon and bf52x silicon.

 

So you do not need to worry about it.

 

-Bryan

QuoteReplyEditDelete

 

 

2008-07-08 03:52:36     Re: How to align the sk_buff 'data' field on an odd word address?

Jean-Francois Argentino (FRANCE)

Message: 58466   

 

Sorry for the "copy and paste" of my post from a general linux forum, it was late... So I explain my problem in a more "blackfin" manner:

 

I need to do multicasting with my bfin at a rate of 32 Mbits/s. I have made a first application test to see which throughput I can achieve and I see that I reach 50 Mbits/s, which is not too bad, but the CPU load is around 90%, which is awful.

 

After taking a look to the bfin_mac driver (I work with the SVN trunk distribution), I see the anomaly 05000285, and if I well understand it, DMA can't be used to copy tx data when the "sk_buff's data" field isn't in an odd address, and I hope that's why my CPU load is as high.

 

Then I try to understand the way took by the pointer I give to the "sendto" function until the "bfin_mac_hard_start_xmit" function, but it's really the jungle, and my grep and ctags machetes aren't sufficient for this one!

 

So my questions are:

 

-Is the 90% CPU load, in your point of view, due to the anomaly 05000285 and misaligned data?

 

-What is this "sk_buff->data" field? Is it only the datagram payload (the pointer a give to the "sendto" function), a copy of it, is it the whole packet which travel on the wire (with the IP and UDP headers, and the payload)?

 

-Is there any trick to be sure that this address is odd aligned?

 

Thanks for taking the time to reading my post.

 

To Bryan: I think line 647 and 660 of bfin_mac.c you have to test "data_align" and not "data"...

Attachments

    Outcomes