Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-29 Thread Pintu Kumar
On Thu, Sep 28, 2017 at 11:46 PM, Pintu Kumar  wrote:
> On Thu, Sep 28, 2017 at 11:41 PM, Pintu Kumar  wrote:
>> On Wed, Sep 27, 2017 at 7:54 PM, Pintu Kumar  wrote:
>>> On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
 On 09/26/2017 11:08 AM, Pintu Agarwal wrote:
>
> This is a test utility to verify ION buffer sharing in user space
> between 2 independent processes.
> It uses unix domain socket as IPC to transfer an FD to another process
> and install it.
>
> This utility demonstrates how ION buffer sharing can be implemented
> between
> two user space processes, using various heap ids.
>
> This utility is verified on Ubuntu 32-bit machine using 2 independent
> process such as: ionapp_export (server) and ionapp_import (client).
> First the server needs to be run to export FD to the client.
> This utility works only if /dev/ion interface is present.
>
> Here is a sample demo example:
>
> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
> heap_type: 2, heap_size: 10
> Fill buffer content:
> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
> Sharing fd: 6, Client fd: 5
> : buffer release successfully
>
> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
> Received buffer fd: 4
> Read buffer content:
> 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
> : buffer release successfully
>
> Signed-off-by: Pintu Agarwal


 This is a good start on a test app for Ion but it needs to be
 updated to use the new ABI.
>>>
>>> Thanks Laura for your feedback.
>>> Can you point out what changes are required?
>>>
>> Ok I got it what you mean.
>> In the latest mainline kernel I observed that there are several
>> changes to uapi/ion.h header file.
>> Like this one:
>> staging: android: ion: Break the ABI in the name of forward progress
>>
>> I can quickly make those changes.
>> In fact I actually started with linux-next tree itself.
>> But there is one problem that I am facing using linux-next or latest
>> mainline kernel.
>> Right now, I am running Ubuntu on Oracle virtual box 5.1 (I don't have
>> the real Ubuntu PC as of now).
>> This virtual box supports only 4.10 LTS kernel version.
>> If I try to build and flash for higher kernel version, the system does
>> not boot and goes to kernel panic during boot (even without my
>> changes).
>> So, I ended up using the same LTS kernel version.
>>
>> Now I need to figure out how to use the linux-next tree.
>> If you have any suggestions please let me know.
>>
> Ok, one option is, I can pull all those recent patches and apply on my
> LTS branch then verify it and submit on latest release.
> But, is there any other option to verify linux-next tree?
>

Hello Laura,
Right now I am facing problem in using linux-next tree.
Once I resolve that problem, I will resubmit this patch on the
linux-next itself.

Thank you!

>>
>> Thanks,
>> Pintu
>>

 Thanks,
 Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-29 Thread Pintu Kumar
On Thu, Sep 28, 2017 at 11:46 PM, Pintu Kumar  wrote:
> On Thu, Sep 28, 2017 at 11:41 PM, Pintu Kumar  wrote:
>> On Wed, Sep 27, 2017 at 7:54 PM, Pintu Kumar  wrote:
>>> On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
 On 09/26/2017 11:08 AM, Pintu Agarwal wrote:
>
> This is a test utility to verify ION buffer sharing in user space
> between 2 independent processes.
> It uses unix domain socket as IPC to transfer an FD to another process
> and install it.
>
> This utility demonstrates how ION buffer sharing can be implemented
> between
> two user space processes, using various heap ids.
>
> This utility is verified on Ubuntu 32-bit machine using 2 independent
> process such as: ionapp_export (server) and ionapp_import (client).
> First the server needs to be run to export FD to the client.
> This utility works only if /dev/ion interface is present.
>
> Here is a sample demo example:
>
> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
> heap_type: 2, heap_size: 10
> Fill buffer content:
> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
> Sharing fd: 6, Client fd: 5
> : buffer release successfully
>
> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
> Received buffer fd: 4
> Read buffer content:
> 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
> : buffer release successfully
>
> Signed-off-by: Pintu Agarwal


 This is a good start on a test app for Ion but it needs to be
 updated to use the new ABI.
>>>
>>> Thanks Laura for your feedback.
>>> Can you point out what changes are required?
>>>
>> Ok I got it what you mean.
>> In the latest mainline kernel I observed that there are several
>> changes to uapi/ion.h header file.
>> Like this one:
>> staging: android: ion: Break the ABI in the name of forward progress
>>
>> I can quickly make those changes.
>> In fact I actually started with linux-next tree itself.
>> But there is one problem that I am facing using linux-next or latest
>> mainline kernel.
>> Right now, I am running Ubuntu on Oracle virtual box 5.1 (I don't have
>> the real Ubuntu PC as of now).
>> This virtual box supports only 4.10 LTS kernel version.
>> If I try to build and flash for higher kernel version, the system does
>> not boot and goes to kernel panic during boot (even without my
>> changes).
>> So, I ended up using the same LTS kernel version.
>>
>> Now I need to figure out how to use the linux-next tree.
>> If you have any suggestions please let me know.
>>
> Ok, one option is, I can pull all those recent patches and apply on my
> LTS branch then verify it and submit on latest release.
> But, is there any other option to verify linux-next tree?
>

Hello Laura,
Right now I am facing problem in using linux-next tree.
Once I resolve that problem, I will resubmit this patch on the
linux-next itself.

Thank you!

>>
>> Thanks,
>> Pintu
>>

 Thanks,
 Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-28 Thread Pintu Kumar
On Thu, Sep 28, 2017 at 11:41 PM, Pintu Kumar  wrote:
> On Wed, Sep 27, 2017 at 7:54 PM, Pintu Kumar  wrote:
>> On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
>>> On 09/26/2017 11:08 AM, Pintu Agarwal wrote:

 This is a test utility to verify ION buffer sharing in user space
 between 2 independent processes.
 It uses unix domain socket as IPC to transfer an FD to another process
 and install it.

 This utility demonstrates how ION buffer sharing can be implemented
 between
 two user space processes, using various heap ids.

 This utility is verified on Ubuntu 32-bit machine using 2 independent
 process such as: ionapp_export (server) and ionapp_import (client).
 First the server needs to be run to export FD to the client.
 This utility works only if /dev/ion interface is present.

 Here is a sample demo example:

 linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
 heap_type: 2, heap_size: 10
 Fill buffer content:
 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
 Sharing fd: 6, Client fd: 5
 : buffer release successfully

 linux-stable/tools/android/ion$ sudo ./ionapp_import.out
 Received buffer fd: 4
 Read buffer content:
 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
 : buffer release successfully

 Signed-off-by: Pintu Agarwal
>>>
>>>
>>> This is a good start on a test app for Ion but it needs to be
>>> updated to use the new ABI.
>>
>> Thanks Laura for your feedback.
>> Can you point out what changes are required?
>>
> Ok I got it what you mean.
> In the latest mainline kernel I observed that there are several
> changes to uapi/ion.h header file.
> Like this one:
> staging: android: ion: Break the ABI in the name of forward progress
>
> I can quickly make those changes.
> In fact I actually started with linux-next tree itself.
> But there is one problem that I am facing using linux-next or latest
> mainline kernel.
> Right now, I am running Ubuntu on Oracle virtual box 5.1 (I don't have
> the real Ubuntu PC as of now).
> This virtual box supports only 4.10 LTS kernel version.
> If I try to build and flash for higher kernel version, the system does
> not boot and goes to kernel panic during boot (even without my
> changes).
> So, I ended up using the same LTS kernel version.
>
> Now I need to figure out how to use the linux-next tree.
> If you have any suggestions please let me know.
>
Ok, one option is, I can pull all those recent patches and apply on my
LTS branch then verify it and submit on latest release.
But, is there any other option to verify linux-next tree?

>
> Thanks,
> Pintu
>
>>>
>>> Thanks,
>>> Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-28 Thread Pintu Kumar
On Thu, Sep 28, 2017 at 11:41 PM, Pintu Kumar  wrote:
> On Wed, Sep 27, 2017 at 7:54 PM, Pintu Kumar  wrote:
>> On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
>>> On 09/26/2017 11:08 AM, Pintu Agarwal wrote:

 This is a test utility to verify ION buffer sharing in user space
 between 2 independent processes.
 It uses unix domain socket as IPC to transfer an FD to another process
 and install it.

 This utility demonstrates how ION buffer sharing can be implemented
 between
 two user space processes, using various heap ids.

 This utility is verified on Ubuntu 32-bit machine using 2 independent
 process such as: ionapp_export (server) and ionapp_import (client).
 First the server needs to be run to export FD to the client.
 This utility works only if /dev/ion interface is present.

 Here is a sample demo example:

 linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
 heap_type: 2, heap_size: 10
 Fill buffer content:
 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
 Sharing fd: 6, Client fd: 5
 : buffer release successfully

 linux-stable/tools/android/ion$ sudo ./ionapp_import.out
 Received buffer fd: 4
 Read buffer content:
 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
 : buffer release successfully

 Signed-off-by: Pintu Agarwal
>>>
>>>
>>> This is a good start on a test app for Ion but it needs to be
>>> updated to use the new ABI.
>>
>> Thanks Laura for your feedback.
>> Can you point out what changes are required?
>>
> Ok I got it what you mean.
> In the latest mainline kernel I observed that there are several
> changes to uapi/ion.h header file.
> Like this one:
> staging: android: ion: Break the ABI in the name of forward progress
>
> I can quickly make those changes.
> In fact I actually started with linux-next tree itself.
> But there is one problem that I am facing using linux-next or latest
> mainline kernel.
> Right now, I am running Ubuntu on Oracle virtual box 5.1 (I don't have
> the real Ubuntu PC as of now).
> This virtual box supports only 4.10 LTS kernel version.
> If I try to build and flash for higher kernel version, the system does
> not boot and goes to kernel panic during boot (even without my
> changes).
> So, I ended up using the same LTS kernel version.
>
> Now I need to figure out how to use the linux-next tree.
> If you have any suggestions please let me know.
>
Ok, one option is, I can pull all those recent patches and apply on my
LTS branch then verify it and submit on latest release.
But, is there any other option to verify linux-next tree?

>
> Thanks,
> Pintu
>
>>>
>>> Thanks,
>>> Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-28 Thread Pintu Kumar
On Wed, Sep 27, 2017 at 7:54 PM, Pintu Kumar  wrote:
> On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
>> On 09/26/2017 11:08 AM, Pintu Agarwal wrote:
>>>
>>> This is a test utility to verify ION buffer sharing in user space
>>> between 2 independent processes.
>>> It uses unix domain socket as IPC to transfer an FD to another process
>>> and install it.
>>>
>>> This utility demonstrates how ION buffer sharing can be implemented
>>> between
>>> two user space processes, using various heap ids.
>>>
>>> This utility is verified on Ubuntu 32-bit machine using 2 independent
>>> process such as: ionapp_export (server) and ionapp_import (client).
>>> First the server needs to be run to export FD to the client.
>>> This utility works only if /dev/ion interface is present.
>>>
>>> Here is a sample demo example:
>>>
>>> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
>>> heap_type: 2, heap_size: 10
>>> Fill buffer content:
>>> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
>>> Sharing fd: 6, Client fd: 5
>>> : buffer release successfully
>>>
>>> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
>>> Received buffer fd: 4
>>> Read buffer content:
>>> 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
>>> : buffer release successfully
>>>
>>> Signed-off-by: Pintu Agarwal
>>
>>
>> This is a good start on a test app for Ion but it needs to be
>> updated to use the new ABI.
>
> Thanks Laura for your feedback.
> Can you point out what changes are required?
>
Ok I got it what you mean.
In the latest mainline kernel I observed that there are several
changes to uapi/ion.h header file.
Like this one:
staging: android: ion: Break the ABI in the name of forward progress

I can quickly make those changes.
In fact I actually started with linux-next tree itself.
But there is one problem that I am facing using linux-next or latest
mainline kernel.
Right now, I am running Ubuntu on Oracle virtual box 5.1 (I don't have
the real Ubuntu PC as of now).
This virtual box supports only 4.10 LTS kernel version.
If I try to build and flash for higher kernel version, the system does
not boot and goes to kernel panic during boot (even without my
changes).
So, I ended up using the same LTS kernel version.

Now I need to figure out how to use the linux-next tree.
If you have any suggestions please let me know.


Thanks,
Pintu

>>
>> Thanks,
>> Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-28 Thread Pintu Kumar
On Wed, Sep 27, 2017 at 7:54 PM, Pintu Kumar  wrote:
> On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
>> On 09/26/2017 11:08 AM, Pintu Agarwal wrote:
>>>
>>> This is a test utility to verify ION buffer sharing in user space
>>> between 2 independent processes.
>>> It uses unix domain socket as IPC to transfer an FD to another process
>>> and install it.
>>>
>>> This utility demonstrates how ION buffer sharing can be implemented
>>> between
>>> two user space processes, using various heap ids.
>>>
>>> This utility is verified on Ubuntu 32-bit machine using 2 independent
>>> process such as: ionapp_export (server) and ionapp_import (client).
>>> First the server needs to be run to export FD to the client.
>>> This utility works only if /dev/ion interface is present.
>>>
>>> Here is a sample demo example:
>>>
>>> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
>>> heap_type: 2, heap_size: 10
>>> Fill buffer content:
>>> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
>>> Sharing fd: 6, Client fd: 5
>>> : buffer release successfully
>>>
>>> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
>>> Received buffer fd: 4
>>> Read buffer content:
>>> 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
>>> : buffer release successfully
>>>
>>> Signed-off-by: Pintu Agarwal
>>
>>
>> This is a good start on a test app for Ion but it needs to be
>> updated to use the new ABI.
>
> Thanks Laura for your feedback.
> Can you point out what changes are required?
>
Ok I got it what you mean.
In the latest mainline kernel I observed that there are several
changes to uapi/ion.h header file.
Like this one:
staging: android: ion: Break the ABI in the name of forward progress

I can quickly make those changes.
In fact I actually started with linux-next tree itself.
But there is one problem that I am facing using linux-next or latest
mainline kernel.
Right now, I am running Ubuntu on Oracle virtual box 5.1 (I don't have
the real Ubuntu PC as of now).
This virtual box supports only 4.10 LTS kernel version.
If I try to build and flash for higher kernel version, the system does
not boot and goes to kernel panic during boot (even without my
changes).
So, I ended up using the same LTS kernel version.

Now I need to figure out how to use the linux-next tree.
If you have any suggestions please let me know.


Thanks,
Pintu

>>
>> Thanks,
>> Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-27 Thread Pintu Kumar
On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
> On 09/26/2017 11:08 AM, Pintu Agarwal wrote:
>>
>> This is a test utility to verify ION buffer sharing in user space
>> between 2 independent processes.
>> It uses unix domain socket as IPC to transfer an FD to another process
>> and install it.
>>
>> This utility demonstrates how ION buffer sharing can be implemented
>> between
>> two user space processes, using various heap ids.
>>
>> This utility is verified on Ubuntu 32-bit machine using 2 independent
>> process such as: ionapp_export (server) and ionapp_import (client).
>> First the server needs to be run to export FD to the client.
>> This utility works only if /dev/ion interface is present.
>>
>> Here is a sample demo example:
>>
>> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
>> heap_type: 2, heap_size: 10
>> Fill buffer content:
>> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
>> Sharing fd: 6, Client fd: 5
>> : buffer release successfully
>>
>> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
>> Received buffer fd: 4
>> Read buffer content:
>> 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
>> : buffer release successfully
>>
>> Signed-off-by: Pintu Agarwal
>
>
> This is a good start on a test app for Ion but it needs to be
> updated to use the new ABI.

Thanks Laura for your feedback.
Can you point out what changes are required?

>
> Thanks,
> Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-27 Thread Pintu Kumar
On Wed, Sep 27, 2017 at 12:52 AM, Laura Abbott  wrote:
> On 09/26/2017 11:08 AM, Pintu Agarwal wrote:
>>
>> This is a test utility to verify ION buffer sharing in user space
>> between 2 independent processes.
>> It uses unix domain socket as IPC to transfer an FD to another process
>> and install it.
>>
>> This utility demonstrates how ION buffer sharing can be implemented
>> between
>> two user space processes, using various heap ids.
>>
>> This utility is verified on Ubuntu 32-bit machine using 2 independent
>> process such as: ionapp_export (server) and ionapp_import (client).
>> First the server needs to be run to export FD to the client.
>> This utility works only if /dev/ion interface is present.
>>
>> Here is a sample demo example:
>>
>> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
>> heap_type: 2, heap_size: 10
>> Fill buffer content:
>> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
>> Sharing fd: 6, Client fd: 5
>> : buffer release successfully
>>
>> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
>> Received buffer fd: 4
>> Read buffer content:
>> 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
>> : buffer release successfully
>>
>> Signed-off-by: Pintu Agarwal
>
>
> This is a good start on a test app for Ion but it needs to be
> updated to use the new ABI.

Thanks Laura for your feedback.
Can you point out what changes are required?

>
> Thanks,
> Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-26 Thread Laura Abbott

On 09/26/2017 11:08 AM, Pintu Agarwal wrote:

This is a test utility to verify ION buffer sharing in user space
between 2 independent processes.
It uses unix domain socket as IPC to transfer an FD to another process
and install it.

This utility demonstrates how ION buffer sharing can be implemented between
two user space processes, using various heap ids.

This utility is verified on Ubuntu 32-bit machine using 2 independent
process such as: ionapp_export (server) and ionapp_import (client).
First the server needs to be run to export FD to the client.
This utility works only if /dev/ion interface is present.

Here is a sample demo example:

linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
heap_type: 2, heap_size: 10
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
Sharing fd: 6, Client fd: 5
: buffer release successfully

linux-stable/tools/android/ion$ sudo ./ionapp_import.out
Received buffer fd: 4
Read buffer content:
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
: buffer release successfully

Signed-off-by: Pintu Agarwal


This is a good start on a test app for Ion but it needs to be
updated to use the new ABI.

Thanks,
Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-26 Thread Laura Abbott

On 09/26/2017 11:08 AM, Pintu Agarwal wrote:

This is a test utility to verify ION buffer sharing in user space
between 2 independent processes.
It uses unix domain socket as IPC to transfer an FD to another process
and install it.

This utility demonstrates how ION buffer sharing can be implemented between
two user space processes, using various heap ids.

This utility is verified on Ubuntu 32-bit machine using 2 independent
process such as: ionapp_export (server) and ionapp_import (client).
First the server needs to be run to export FD to the client.
This utility works only if /dev/ion interface is present.

Here is a sample demo example:

linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
heap_type: 2, heap_size: 10
Fill buffer content:
0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
Sharing fd: 6, Client fd: 5
: buffer release successfully

linux-stable/tools/android/ion$ sudo ./ionapp_import.out
Received buffer fd: 4
Read buffer content:
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
: buffer release successfully

Signed-off-by: Pintu Agarwal


This is a good start on a test app for Ion but it needs to be
updated to use the new ABI.

Thanks,
Laura


Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-26 Thread Pintu Kumar
Hi All,

Please review this patch and provide your feedback.
Since 2012, I have used these utility to verify ION buffer sharing
between 2 different process using various heaps.
But I never thought (or got a chance) of contributing it to mainline.
Now I made it working for PC (x86) and thought it might be helpful for somebody.

It might be helpful for those who are new to ION and trying to
understand how ION buffer sharing works.
It will help the developer to quickly verify the use cases (offline)
before implementing it in kernel.

Please consider this as first version. Although it does not
demonstrate the real use cases, but it helps to understand the
concept.
Further improvements and suggestions are most welcome.

Once this is done, I can create a similar use case between driver to
driver buffer sharing.


Thanks,
Pintu


On Tue, Sep 26, 2017 at 11:38 PM, Pintu Agarwal  wrote:
> This is a test utility to verify ION buffer sharing in user space
> between 2 independent processes.
> It uses unix domain socket as IPC to transfer an FD to another process
> and install it.
>
> This utility demonstrates how ION buffer sharing can be implemented between
> two user space processes, using various heap ids.
>
> This utility is verified on Ubuntu 32-bit machine using 2 independent
> process such as: ionapp_export (server) and ionapp_import (client).
> First the server needs to be run to export FD to the client.
> This utility works only if /dev/ion interface is present.
>
> Here is a sample demo example:
>
> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
> heap_type: 2, heap_size: 10
> Fill buffer content:
> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
> Sharing fd: 6, Client fd: 5
> : buffer release successfully
>
> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
> Received buffer fd: 4
> Read buffer content:
> 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
> : buffer release successfully
>
> Signed-off-by: Pintu Agarwal 
> ---
>  tools/android/ion/Makefile|  17 +++
>  tools/android/ion/ionapp_export.c | 152 
>  tools/android/ion/ionapp_import.c |  87 
>  tools/android/ion/ionutils.c  | 282 
> ++
>  tools/android/ion/ionutils.h  |  55 
>  tools/android/ion/ipcsocket.c | 224 ++
>  tools/android/ion/ipcsocket.h |  27 
>  7 files changed, 844 insertions(+)
>  create mode 100644 tools/android/ion/Makefile
>  create mode 100644 tools/android/ion/ionapp_export.c
>  create mode 100644 tools/android/ion/ionapp_import.c
>  create mode 100644 tools/android/ion/ionutils.c
>  create mode 100644 tools/android/ion/ionutils.h
>  create mode 100644 tools/android/ion/ipcsocket.c
>  create mode 100644 tools/android/ion/ipcsocket.h
>
> diff --git a/tools/android/ion/Makefile b/tools/android/ion/Makefile
> new file mode 100644
> index 000..57d2e98
> --- /dev/null
> +++ b/tools/android/ion/Makefile
> @@ -0,0 +1,17 @@
> +
> +CC := $(CROSS_COMPILE)gcc
> +
> +INCLUDEDIR := -I../../../drivers/staging/android/uapi/
> +
> +CCFLAGS := $(INCLUDEDIR) -Wall -O2 -g
> +
> +all: ionapp_export ionapp_import
> +
> +ionapp_import : ionapp_import.c
> +   $(CC) -o ionapp_import.out ionapp_import.c ipcsocket.c ionutils.c 
> $(CCFLAGS)
> +
> +ionapp_export : ionapp_export.c
> +   $(CC) -o ionapp_export.out ionapp_export.c ipcsocket.c ionutils.c 
> $(CCFLAGS)
> +
> +clean:
> +   rm -rf *.o *~ *.out
> diff --git a/tools/android/ion/ionapp_export.c 
> b/tools/android/ion/ionapp_export.c
> new file mode 100644
> index 000..29e3419
> --- /dev/null
> +++ b/tools/android/ion/ionapp_export.c
> @@ -0,0 +1,152 @@
> +/*
> + * ionapp_export.c
> + *
> + * It is a user space utility to create and export android
> + * ion memory buffer fd to another process using unix domain socket as IPC.
> + * This acts like a server for ionapp_import(client).
> + * So, this server has to be started first before the client.
> + *
> + * Copyright (C) 2017 Pintu Kumar 
> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "ionutils.h"
> +#include "ipcsocket.h"
> +
> +
> +void print_usage(int argc, char *argv[])
> 

Re: [PATCH 1/1] [tools]: android/ion: userspace test utility for ion buffer sharing

2017-09-26 Thread Pintu Kumar
Hi All,

Please review this patch and provide your feedback.
Since 2012, I have used these utility to verify ION buffer sharing
between 2 different process using various heaps.
But I never thought (or got a chance) of contributing it to mainline.
Now I made it working for PC (x86) and thought it might be helpful for somebody.

It might be helpful for those who are new to ION and trying to
understand how ION buffer sharing works.
It will help the developer to quickly verify the use cases (offline)
before implementing it in kernel.

Please consider this as first version. Although it does not
demonstrate the real use cases, but it helps to understand the
concept.
Further improvements and suggestions are most welcome.

Once this is done, I can create a similar use case between driver to
driver buffer sharing.


Thanks,
Pintu


On Tue, Sep 26, 2017 at 11:38 PM, Pintu Agarwal  wrote:
> This is a test utility to verify ION buffer sharing in user space
> between 2 independent processes.
> It uses unix domain socket as IPC to transfer an FD to another process
> and install it.
>
> This utility demonstrates how ION buffer sharing can be implemented between
> two user space processes, using various heap ids.
>
> This utility is verified on Ubuntu 32-bit machine using 2 independent
> process such as: ionapp_export (server) and ionapp_import (client).
> First the server needs to be run to export FD to the client.
> This utility works only if /dev/ion interface is present.
>
> Here is a sample demo example:
>
> linux-stable/tools/android/ion$ sudo ./ionapp_export.out -i 1 -s 10
> heap_type: 2, heap_size: 10
> Fill buffer content:
> 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd 0xfd
> Sharing fd: 6, Client fd: 5
> : buffer release successfully
>
> linux-stable/tools/android/ion$ sudo ./ionapp_import.out
> Received buffer fd: 4
> Read buffer content:
> 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
> : buffer release successfully
>
> Signed-off-by: Pintu Agarwal 
> ---
>  tools/android/ion/Makefile|  17 +++
>  tools/android/ion/ionapp_export.c | 152 
>  tools/android/ion/ionapp_import.c |  87 
>  tools/android/ion/ionutils.c  | 282 
> ++
>  tools/android/ion/ionutils.h  |  55 
>  tools/android/ion/ipcsocket.c | 224 ++
>  tools/android/ion/ipcsocket.h |  27 
>  7 files changed, 844 insertions(+)
>  create mode 100644 tools/android/ion/Makefile
>  create mode 100644 tools/android/ion/ionapp_export.c
>  create mode 100644 tools/android/ion/ionapp_import.c
>  create mode 100644 tools/android/ion/ionutils.c
>  create mode 100644 tools/android/ion/ionutils.h
>  create mode 100644 tools/android/ion/ipcsocket.c
>  create mode 100644 tools/android/ion/ipcsocket.h
>
> diff --git a/tools/android/ion/Makefile b/tools/android/ion/Makefile
> new file mode 100644
> index 000..57d2e98
> --- /dev/null
> +++ b/tools/android/ion/Makefile
> @@ -0,0 +1,17 @@
> +
> +CC := $(CROSS_COMPILE)gcc
> +
> +INCLUDEDIR := -I../../../drivers/staging/android/uapi/
> +
> +CCFLAGS := $(INCLUDEDIR) -Wall -O2 -g
> +
> +all: ionapp_export ionapp_import
> +
> +ionapp_import : ionapp_import.c
> +   $(CC) -o ionapp_import.out ionapp_import.c ipcsocket.c ionutils.c 
> $(CCFLAGS)
> +
> +ionapp_export : ionapp_export.c
> +   $(CC) -o ionapp_export.out ionapp_export.c ipcsocket.c ionutils.c 
> $(CCFLAGS)
> +
> +clean:
> +   rm -rf *.o *~ *.out
> diff --git a/tools/android/ion/ionapp_export.c 
> b/tools/android/ion/ionapp_export.c
> new file mode 100644
> index 000..29e3419
> --- /dev/null
> +++ b/tools/android/ion/ionapp_export.c
> @@ -0,0 +1,152 @@
> +/*
> + * ionapp_export.c
> + *
> + * It is a user space utility to create and export android
> + * ion memory buffer fd to another process using unix domain socket as IPC.
> + * This acts like a server for ionapp_import(client).
> + * So, this server has to be started first before the client.
> + *
> + * Copyright (C) 2017 Pintu Kumar 
> + *
> + * This software is licensed under the terms of the GNU General Public
> + * License version 2, as published by the Free Software Foundation, and
> + * may be copied, distributed, and modified under those terms.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include 
> +#include "ionutils.h"
> +#include "ipcsocket.h"
> +
> +
> +void print_usage(int argc, char *argv[])
> +{
> +   printf("** HEAP ID ***\n");
> +