ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I came across a function wrap_copy on http://lxr.free-electrons.com/source.../net/8139too.c
Can some one help to understand what it is doing.
What I interpret it is that some how the person is tying to copy
payload from DMA to sk buffer.Is this interpretation correct?
What exactly are we trying to achieve via wrap_copy function call?
Last edited by tkmsr; 11-13-2010 at 10:41 PM.
Click here to see the post LQ members have rated as the most helpful post in this thread.
The function is copying from a ring (circular) buffer into the skb buffer. Since the memcpy may go off the end of the ring buffer, the function sometimes has to break up the copy into two parts (wrapping back around to the beginning of the ring buffer for the rest of the data).
Also note - I don't see how that code will ever be called. The only valid _user_ configurable values are 0 and 2. RX_BUF_IDX of 3 is not defined anywhere.
Also note - I don't see how that code will ever be called.
True. It looks like this used to be handled by a configurable define called CONFIG_8139_RXBUF_IDX, which could take the values 0 to 3. I'm guessing that buffer sizes of 16k and 64k are no longer supported, and the comment in the file says that "Warning: 64K ring has hardware issues and may lock up."
It makes some sense to leave the code there in case the 64k buffer option is ever reinstated.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.