LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-13-2010, 10:14 PM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
wrap copy in 8139too.c


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.
Old 11-14-2010, 05:00 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
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).
 
2 members found this post helpful.
Old 11-14-2010, 07:01 AM   #3
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Hi, thanks for your reply
 
Old 11-16-2010, 09:58 AM   #4
orgcandman
Member
 
Registered: May 2002
Location: new hampshire
Distribution: Fedora, RHEL
Posts: 600

Rep: Reputation: 110Reputation: 110
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.
 
Old 11-16-2010, 05:53 PM   #5
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Quote:
Originally Posted by orgcandman View Post
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.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"enscript --word-wrap" does not wrap line of text file powah Linux - General 3 05-16-2006 09:12 PM
is 'rtl8139' better than '8139too'? hari_mj23 Linux - Hardware 2 06-14-2005 07:45 PM
Modprobe 8139too zeekx4 Slackware 11 01-12-2005 08:05 AM
8139too problems eltongeoff Linux - Newbie 10 06-27-2003 12:08 PM
8139too.o: no such device.... GabeF Linux - Networking 8 03-19-2002 03:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration