mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "B.Vinai Kumar" <vinaibangala2001@gmail.com>
To: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-usb <linux-usb@vger.kernel.org>,
	usbip-devel@lists.sourceforge.net,
	Takahiro Hirofuchi <hirofuchi@users.sourceforge.net>
Subject: zero copy in usbip send and recieve path
Date: Mon, 26 Apr 2010 16:27:46 +0530	[thread overview]
Message-ID: <i2kf74c922b1004260357x6548f7ddz6e0a38fafa4f54ce@mail.gmail.com> (raw)

Hi All,

I'am trying to implement zero copy in USBIP while sending / receiving
usbip packets.

I started it with send path. The device which I used is mass storage.
I'am using linux kernel 2.6.15.

After virtualization, once the file copy starts from device to pc each
usbip packet carries payload of 64K.

I'am allocating this 64K buffer through __get_free_pages() (with order
4) and assigning
the buffer pointer to urb. After completion of URB i'am trying to send
this buffer page by page
by using tcp_sendpage instead of calling kernel_sendmsg(), this is to
avoid copy which is
done in the TCP send path.

By doing this way it is able to send the buffer successfully, but I'am
not finding the way to free
this buffer. This copy continues until the entire memory is consumed.

who will free this buffer?

1) If i call free_pages for entire 64K right after tcp_sendpage (i.e
after sending all the pages, 64K). then observed
the Kernel panic. It is obvious that the tcp core is not yet finished its job.

2) TCP core is also not freeing these pages.

This might be because, I allocated 64K buffer at once and trying to
free it page by page.

I need some help to resolve this issue.

Performance wise there is a huge jump in throughput.

Thanks,
Vinai

             reply	other threads:[~2010-04-26 10:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26 10:57 B.Vinai Kumar [this message]
2010-04-26 18:11 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=i2kf74c922b1004260357x6548f7ddz6e0a38fafa4f54ce@mail.gmail.com \
    --to=vinaibangala2001@gmail.com \
    --cc=hirofuchi@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=usbip-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®