mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: mdaljeet@in.ibm.com
To: Gerd Knorr <kraxel@bytesex.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: mmap
Date: Tue, 15 May 2001 15:38:40 +0530	[thread overview]
Message-ID: <CA256A4D.0037EAF4.00@d73mta05.au.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1077 bytes --]

When I malloc the memory in user space, the memory may be discontinuous for
large chunks of memory say 16k or 32k. Does the 'kiobuf' interface take
care of this or it assumes it to be continuous?

regards,
Daljeet Maini
IBM Global Services Ltd. - Bangalore
Ph. No. - 5267117 Extn 2954


|--------+----------------------->
|        |          Gerd Knorr   |
|        |          <kraxel@bytes|
|        |          ex.org>      |
|        |                       |
|        |          05/15/01     |
|        |          01:03 PM     |
|        |          Please       |
|        |          respond to   |
|        |          Gerd Knorr   |
|        |                       |
|--------+----------------------->
  >--------------------------------------------------------|
  |                                                        |
  |       To:     linux-kernel@vger.kernel.org             |
  |       cc:     (bcc: Daljeet Maini/India/IBM)           |
  |       Subject:     Re: mmap                            |
  >--------------------------------------------------------|





[-- Attachment #2: Type: text/plain, Size: 1125 bytes --]



mdaljeet@in.ibm.com wrote:
>  I am doing the following:
>
>     malloc some memory is user space
>     pass its pointer to some kernel module
>     in the kernel module...do a pci_alloc_consistent so that i get a
memory
>     region for PCI DMA operations

Wrong approach, you can use kiobufs if you want DMA to the malloc()ed
userspace memory:

 * lock down the user memory using map_user_kiobuf() + lock_kiovec()
   (see linux/iobuf.h).
 * translate the iobuf->maplist into a scatterlist [1]
 * feed pci_map_sg() with the scatterlist to get DMA addresses.
   you can pass to the hardware.

And the reverse to free everything when you are done of course.

  Gerd

[1] IMHO it would be more useful if iobufs would use a scatterlist
    instead of an struct page* array.


--
Gerd Knorr <kraxel@bytesex.org>  --  SuSE Labs, Außenstelle Berlin
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


             reply	other threads:[~2001-05-15 10:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-15 10:08 mdaljeet [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-12-02 12:20 mmap Sébastien Paumier
2011-12-02 14:45 ` mmap Eric Dumazet
2001-07-02 14:00 mmap mdaljeet
2001-07-03 17:47 ` mmap Jens Axboe
2001-05-15  6:47 mmap mdaljeet
2001-05-15  7:33 ` mmap Gerd Knorr
2001-05-15  9:42 ` mmap Alan Cox

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=CA256A4D.0037EAF4.00@d73mta05.au.ibm.com \
    --to=mdaljeet@in.ibm.com \
    --cc=kraxel@bytesex.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®