All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pintu Kumar <pintu.ping@gmail.com>
To: Laura Abbott <labbott@redhat.com>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Pintu Kumar <pintu_agarwal@yahoo.com>
Subject: Re: [PATCHv2 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing
Date: Mon, 9 Oct 2017 19:47:19 +0530	[thread overview]
Message-ID: <CAOuPNLhSvNznOEGbGjXJBypZuSPKMeOJhrqhjdPyr+BZkPmB2A@mail.gmail.com> (raw)
In-Reply-To: <CAOuPNLj+m5HAVgs6OWVEuhNFBJv=WbYNdJ1u0SsdHa52ejFrCg@mail.gmail.com>

On Fri, Oct 6, 2017 at 7:58 PM, Pintu Kumar <pintu.ping@gmail.com> wrote:
>>> +
>>> +     heap_type = ion_info->heap_type;
>>> +     heap_size = ion_info->heap_size;
>>> +     flag_type = ion_info->flag_type;
>>> +     alloc_data.len = heap_size;
>>> +     alloc_data.heap_id_mask = heap_type;
>>
>> The heap type and heap ID are not the same thing. You need
>> to determine the heap id from using the new query ioctl.
>>
>
> Hello Laura,
> Can you point out some example on how to retrieve heap_id from query ioctl.
> Sorry, I am not able to figure out, how can I get a specific heap_id
> if I know the heap_type.
> Do, I need to query all the heaps? Then how do I map to heap_data for each heap?
> Here is what I am doing.
>
> struct ion_heap_query query;
> struct ion_heap_data heap_data[5];
>
>         query.cnt = 5;
>         /* Query ION heap_id_mask from ION heap */
>         ret = ioctl(ionfd, ION_IOC_HEAP_QUERY, &query);
>         if (ret < 0) {
>                 fprintf(stderr, "<%s>: Failed: ION_IOC_HEAP_QUERY: %s\n",
>                         __func__, strerror(errno));
>                 goto err_heap;
>         }
>
> After this how to map each heap_data[..]  to query.heaps?
> Do you have any examples?

Dear Laura,
I figured out myself.
Now I am able to query heap_id from the new QUERY ioctl.
Also I have added a script to test all the heaps from single terminal.
Things are working fine.
I will post the new patch set soon.
However I have few questions to be clarified.
1) I have moved the test setup under: tools/testing/selftests/android/ion/
    So that it can be included easily in selftests framework later.
    Hope this is fine.

2) I observed that ION_HEAP_TYPE_DMA heap type is returned as
"reserved" heap name.
    However allocation goes through CMA area. Hope this is expected behavior.

3) For me CHUNK & CARVEDOUT heap is not working, on my Ubuntu PC.
    So I could not check it.
    I know these heaps needs to be declared first, may be in device
tree or somewhere else.
    Do you know how to verify this on Ubuntu x86 PC?

4) Please see the snapshots of output from the test results.

linux/tools/testing/selftests/android/ion$ sudo ./ion_test.sh
heap_type: 0, heap_size: 10
--------------------------------------
heap type: 0
  heap id: 1
heap name: ion_system_heap
--------------------------------------
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
Sharing fd: 6, Client fd: 5
<ion_close_buffer_fd>: buffer release successfully....
Received buffer fd: 4
Read buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0x0 0x0 0x0 0x0 0x0
0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd
<ion_close_buffer_fd>: buffer release successfully....
ion_test.sh: heap_type: 0 - [PASS]

heap_type: 1, heap_size: 10
--------------------------------------
heap type: 1
  heap id: 0
heap name: ion_system_contig_heap
--------------------------------------
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
Sharing fd: 6, Client fd: 5
<ion_close_buffer_fd>: buffer release successfully....
Received buffer fd: 4
Read buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0x0 0x0 0x0 0x0 0x0
0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd
<ion_close_buffer_fd>: buffer release successfully....
ion_test.sh: heap_type: 1 - [PASS]

heap_type: 2, heap_size: 10
<ion_export_buffer_fd>: ERROR: heap type does not exists
FAILED: ion_get_buffer_fd
<ion_close_buffer_fd>: buffer release successfully....
Received buffer fd: 0
ERROR: improper buf fd
ion_test.sh: heap_type: 2 - [FAIL]

heap_type: 3, heap_size: 10
<ion_export_buffer_fd>: ERROR: heap type does not exists
FAILED: ion_get_buffer_fd
<ion_close_buffer_fd>: buffer release successfully....
Received buffer fd: 0
ERROR: improper buf fd
ion_test.sh: heap_type: 3 - [FAIL]

heap_type: 4, heap_size: 10
--------------------------------------
heap type: 4
  heap id: 2
heap name: reserved
--------------------------------------
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
Sharing fd: 6, Client fd: 5
<ion_close_buffer_fd>: buffer release successfully....
Received buffer fd: 4
Read buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
0xfd 0xfd 0xfd 0xfd
<ion_close_buffer_fd>: buffer release successfully....
ion_test.sh: heap_type: 4 - [PASS]

done....




Thanks,
Pintu

  reply	other threads:[~2017-10-09 14:17 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26 18:08 [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing Pintu Agarwal
2017-09-26 18:50 ` Pintu Kumar
2017-09-26 19:22 ` Laura Abbott
2017-09-27 14:24   ` Pintu Kumar
2017-09-28 18:11     ` Pintu Kumar
2017-09-28 18:16       ` Pintu Kumar
2017-09-30  4:04         ` Pintu Kumar
2017-10-03 16:48 ` [PATCHv2 " Pintu Agarwal
2017-10-04  0:12   ` Laura Abbott
2017-10-04 11:29     ` Pintu Kumar
2017-10-04 22:07       ` Laura Abbott
2017-10-06 14:28     ` Pintu Kumar
2017-10-09 14:17       ` Pintu Kumar [this message]
2017-10-09 21:19         ` Laura Abbott
2017-10-04  7:20   ` Greg KH
2017-10-04 10:54     ` Pintu Kumar
2017-10-14 11:36   ` [PATCHv3 1/1] [tools/selftests]: " Pintu Agarwal
2017-10-17 14:18     ` Shuah Khan
2017-10-17 20:21     ` Laura Abbott
2017-10-17 20:58       ` Shuah Khan
2017-10-18 10:38         ` Pintu Kumar
2017-10-20 14:40           ` Shuah Khan
2017-10-20 15:18             ` Pintu Kumar
2017-10-20 19:21               ` Shuah Khan
2017-10-23 13:41                 ` Pintu Kumar
2017-10-23 23:26     ` [PATCHv4 " Pintu Agarwal
2017-10-27  5:34       ` Pintu Kumar
2017-10-27  8:45         ` Greg Kroah-Hartman
2017-10-27 10:00           ` Pintu Kumar
2017-10-29 14:21       ` [lkp-robot] [android/ion] 5fb70554d6: kernel_selftests.android.make_fail kernel test robot
2017-10-29 14:21         ` kernel test robot
2017-10-30  7:12         ` Pintu Kumar
2017-10-30 21:02           ` Laura Abbott
2017-10-30 21:02             ` Laura Abbott
2017-10-31 10:21             ` Pintu Kumar
2017-10-31 21:58               ` Laura Abbott
2017-10-31 21:58                 ` Laura Abbott
2017-11-01 10:12                 ` Pintu Kumar
2017-11-01 10:30                   ` Greg Kroah-Hartman
2017-11-01 10:30                     ` Greg Kroah-Hartman
2017-11-01 15:04                   ` Shuah Khan
2017-11-01 15:04                     ` Shuah Khan
2017-11-01 16:26                     ` Pintu Kumar
2017-11-01 16:57                       ` Shuah Khan
2017-11-01 16:57                         ` Shuah Khan
2017-11-01 17:14                         ` Pintu Kumar
2017-11-01 22:38                           ` Shuah Khan
2017-11-01 22:38                             ` Shuah Khan
2017-11-02  8:53                             ` Greg Kroah-Hartman
2017-11-02  8:53                               ` Greg Kroah-Hartman
2017-11-02 14:50                               ` Shuah Khan
2017-11-02 14:50                                 ` Shuah Khan
2017-10-30 22:56       ` [PATCHv4 1/1] [tools/selftests]: android/ion: userspace test utility for ion buffer sharing Laura Abbott
2017-10-31  9:49         ` Pintu Kumar
2017-11-01 17:00       ` [PATCHv5 " Pintu Agarwal
2017-11-02 15:07         ` Shuah Khan
2017-11-02 16:15           ` Pintu Kumar
2017-11-02 16:19             ` Shuah Khan
2017-11-02 17:53               ` Shuah Khan
2017-11-02 23:54                 ` Laura Abbott
2017-11-03  0:32                   ` Shuah Khan
2017-11-03  4:36                     ` Pintu Kumar

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=CAOuPNLhSvNznOEGbGjXJBypZuSPKMeOJhrqhjdPyr+BZkPmB2A@mail.gmail.com \
    --to=pintu.ping@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=labbott@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pintu_agarwal@yahoo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.