[dpdk-dev] [PATCH v5 3/4] vhost: using EVENTFD_COPY2

2015-10-28 Thread Pavel Boldin
Huawei, Thomas, Please find an updated patchset in the appropriate mail thread. With best regards, Pavel On Mon, Oct 26, 2015 at 3:45 AM, Xie, Huawei wrote: > On 10/21/2015 8:16 PM, Pavel Boldin wrote: > > Xie, > > > > Please find my comments intermixed below. > >

[dpdk-dev] [PATCH v6 3/3] vhost: using EVENTFD_COPY2

2015-10-28 Thread Pavel Boldin
Signed-off-by: Pavel Boldin --- lib/librte_vhost/vhost_cuse/eventfd_copy.c | 54 ++-- lib/librte_vhost/vhost_cuse/eventfd_copy.h | 6 lib/librte_vhost/vhost_cuse/vhost-net-cdev.c | 3 ++ 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/lib

[dpdk-dev] [PATCH v6 2/3] vhost: add EVENTFD_COPY2 ioctl

2015-10-28 Thread Pavel Boldin
Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 61 lib/librte_vhost/eventfd_link/eventfd_link.h | 28 ++--- 2 files changed, 84 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib

[dpdk-dev] [PATCH v6 1/3] vhost: eventfd_link: refactoring EVENTFD_COPY handler

2015-10-28 Thread Pavel Boldin
* Move ioctl `EVENTFD_COPY' code to a separate function * Remove extra #includes * Introduce function fget_from_files * Fix ioctl return values Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 181 +++ 1 file changed, 100 insertions(+

[dpdk-dev] [PATCH v6 0/3] vhost: eventfd_link refactoring

2015-10-28 Thread Pavel Boldin
next one introduces a new more clean implementation of the EVENTFD_COPY2 ioctl that allocates a new fd for the `struct file' being stolen. The last patch uses this new mechanism in the DPDK userspace. Pavel Boldin (3): vhost: eventfd_link: refactoring EVENTFD_COPY handler vhost

[dpdk-dev] [PATCH v5 3/4] vhost: using EVENTFD_COPY2

2015-10-21 Thread Pavel Boldin
plementation? > I'm not really sure if we should do it -- imagine upgrading from one version of DPDK to another. Given the current implementation there is a backward compatibility. > > Again, please run checkpatch.pl against your patch. > Oops. Thanks for pointing out. > On

[dpdk-dev] [PATCH v5 1/4] vhost: eventfd_link: refactoring EVENTFD_COPY handler

2015-09-30 Thread Pavel Boldin
Hi Thomas, On Tue, Sep 29, 2015 at 10:42 PM, Thomas Monjalon wrote: > Hi Pavel, > > 2015-09-23 23:25, Pavel Boldin: > > Ping. > > Are you requesting a review? > Yes. > I think you should set Huawei Xie in the recipient list. > Huawei Xie CCed > > Othe

[dpdk-dev] [PATCH] librte_vhost: eventfd_link: Update the makefile to build against an arbitrary kernel

2015-09-25 Thread Pavel Boldin
Thomas, Can I please have your attention there as well: http://dpdk.org/dev/patchwork/project/dpdk/list/?submitter=194 Pavel On Thu, Sep 24, 2015 at 11:05 PM, Thomas Monjalon wrote: > 2015-09-23 16:03, Aaron Conole: > > The vHost eventlink driver is a kernel module that requires a kernel > > s

[dpdk-dev] [PATCH v5 1/4] vhost: eventfd_link: refactoring EVENTFD_COPY handler

2015-09-23 Thread Pavel Boldin
Ping. On Fri, Aug 28, 2015 at 9:51 PM, Pavel Boldin wrote: > * Move ioctl `EVENTFD_COPY' code to a separate function > * Remove extra #includes > * Introduce function fget_from_files > * Fix ioctl return values > > Signed-off-by: Pavel Boldin > --- >

[dpdk-dev] [PATCH v5 4/4] DO NOT MERGE: Tests for new eventfd_link module

2015-08-28 Thread Pavel Boldin
To use: 1. Compile and load the new eventfd_link module (as root): # (cd lib/librte_vhost/eventfd_link; make; insmod ./eventfd_link.ko) 2. Compile the test program: $ make -C test_eventfd_copy 3. Run it as root: # sudo ./test_eventfd_copy/test_eventfd_copy --check Stealing FD OK --- test_event

[dpdk-dev] [PATCH v5 3/4] vhost: using EVENTFD_COPY2

2015-08-28 Thread Pavel Boldin
Signed-off-by: Pavel Boldin --- lib/librte_vhost/vhost_cuse/eventfd_copy.c | 54 ++-- lib/librte_vhost/vhost_cuse/eventfd_copy.h | 6 lib/librte_vhost/vhost_cuse/vhost-net-cdev.c | 3 ++ 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/lib

[dpdk-dev] [PATCH v5 2/4] vhost: add EVENTFD_COPY2 ioctl

2015-08-28 Thread Pavel Boldin
Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 61 lib/librte_vhost/eventfd_link/eventfd_link.h | 28 ++--- 2 files changed, 84 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib

[dpdk-dev] [PATCH v5 1/4] vhost: eventfd_link: refactoring EVENTFD_COPY handler

2015-08-28 Thread Pavel Boldin
* Move ioctl `EVENTFD_COPY' code to a separate function * Remove extra #includes * Introduce function fget_from_files * Fix ioctl return values Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 188 +++ 1 file changed, 103 insertions(+

[dpdk-dev] [PATCH v5 4/5] vhost: eventfd_link: replace copy-pasted sys_close

2015-07-19 Thread Pavel Boldin
Xie, I think it is OK to merge first three patches at the moment. I'm going to implement a new scheme in a different ioctl soon. Pavel

[dpdk-dev] [PATCH v5 4/5] vhost: eventfd_link: replace copy-pasted sys_close

2015-07-11 Thread Pavel Boldin
Xie, All, Please find my comments intermixed below. On Fri, Jul 10, 2015 at 6:42 PM, Xie, Huawei wrote: > Don't know why previous mail get messed. > > On 7/10/2015 10:50 PM, Pavel Boldin wrote: > Xie, > > Regarding the patches: > 1. The replaced code in fourth pat

[dpdk-dev] [PATCH v5 4/5] vhost: eventfd_link: replace copy-pasted sys_close

2015-07-10 Thread Pavel Boldin
, Huawei wrote: > On 6/17/2015 11:24 PM, Thomas Monjalon wrote: > > 2015-05-07 06:54, Xie, Huawei: > >> On 4/16/2015 7:48 PM, Pavel Boldin wrote: > >>> + /* Closing the source_fd */ > >>> + ret = sys_close(eventfd_copy.source_fd); > >> Pavel: >

[dpdk-dev] [PATCH v4 1/5] vhost: eventfd_link: moving ioctl to a function

2015-05-18 Thread Pavel Boldin
On Mon, May 18, 2015 at 9:06 AM, Xie, Huawei wrote: > On 5/7/2015 9:17 PM, Pavel Boldin wrote: > > > On Thu, May 7, 2015 at 10:57 AM, Xie, Huawei huawei.xie at intel.com>> wrote: > On 4/3/2015 1:02 AM, Pavel Boldin wrote: > > Move ioctl `EVENTFD_COPY' handler cod

[dpdk-dev] [PATCH v4 1/5] vhost: eventfd_link: moving ioctl to a function

2015-05-07 Thread Pavel Boldin
On Thu, May 7, 2015 at 10:57 AM, Xie, Huawei wrote: > On 4/3/2015 1:02 AM, Pavel Boldin wrote: > > Move ioctl `EVENTFD_COPY' handler code to an inline function. > Pavel: > There is no necessity to inline this function. > Xie, there is even no necessity to split this in a

[dpdk-dev] [PATCH v5 5/5] vhost: eventfd_link: removing extra #includes

2015-04-16 Thread Pavel Boldin
Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventfd_link/eventfd_link.c index 9bc52a3..0ee7357 100644 --- a/lib

[dpdk-dev] [PATCH v5 4/5] vhost: eventfd_link: replace copy-pasted sys_close

2015-04-16 Thread Pavel Boldin
Replace copy-pasted `fget_from_files' -> `filp_close' with a `sys_close' call. Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 49 +++- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/lib/librte_

[dpdk-dev] [PATCH v5 3/5] vhost: eventfd_link: fix ioctl return values

2015-04-16 Thread Pavel Boldin
Fix ioctl return values: * `-EFAULT' when unable to fetch user supplied arguments, * `-ESRCH' when no target process is found, * `-ESTALE' when unable to get `struct files', * `-EBADF' when unable to get `struct file' for fd. Signed-off-by: Pavel Boldin ---

[dpdk-dev] [PATCH v5 2/5] vhost: eventfd_link: add function fget_from_files

2015-04-16 Thread Pavel Boldin
Move copy-pasted code of `fget' for different `struct files' to the added `fget_from_files' function. Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 36 +++- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/l

[dpdk-dev] [PATCH v5 1/5] vhost: eventfd_link: moving ioctl to a function

2015-04-16 Thread Pavel Boldin
Move ioctl `EVENTFD_COPY' handler code to an inline function. Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 171 ++- 1 file changed, 89 insertions(+), 82 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c

[dpdk-dev] [PATCH v5 0/5] Refactor module `eventfd_link'

2015-04-16 Thread Pavel Boldin
This patchset contains refactoring steps for the `eventfd_link' module of the DPDK's `librte_vhost' part. The commit messages are updated to include `Signed-off-by'. Pavel Boldin (5): vhost: eventfd_link: moving ioctl to a function vhost: eventfd_link: add function fge

[dpdk-dev] [PATCH v4 5/5] vhost: eventfd_link: removing extra #includes

2015-04-02 Thread Pavel Boldin
--- lib/librte_vhost/eventfd_link/eventfd_link.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventfd_link/eventfd_link.c index 9bc52a3..0ee7357 100644 --- a/lib/librte_vhost/eventfd_link/eventfd_link.c

[dpdk-dev] [PATCH v4 4/5] vhost: eventfd_link: replace copy-pasted sys_close

2015-04-02 Thread Pavel Boldin
Replace copy-pasted `fget_from_files' -> `filp_close' with a `sys_close' call. --- lib/librte_vhost/eventfd_link/eventfd_link.c | 49 +++- 1 file changed, 12 insertions(+), 37 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventf

[dpdk-dev] [PATCH v4 3/5] vhost: eventfd_link: fix ioctl return values

2015-04-02 Thread Pavel Boldin
Fix ioctl return values: * `-EFAULT' when unable to fetch user supplied arguments, * `-ESRCH' when no target process is found, * `-ESTALE' when unable to get `struct files', * `-EBADF' when unable to get `struct file' for fd. --- lib/librte_vhost/eventfd_link/eventfd_link.c | 46 ++

[dpdk-dev] [PATCH v4 2/5] vhost: eventfd_link: add function fget_from_files

2015-04-02 Thread Pavel Boldin
Move copy-pasted code of `fget' for different `struct files' to the added `fget_from_files' function. --- lib/librte_vhost/eventfd_link/eventfd_link.c | 36 +++- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/

[dpdk-dev] [PATCH v4 1/5] vhost: eventfd_link: moving ioctl to a function

2015-04-02 Thread Pavel Boldin
Move ioctl `EVENTFD_COPY' handler code to an inline function. --- lib/librte_vhost/eventfd_link/eventfd_link.c | 171 ++- 1 file changed, 89 insertions(+), 82 deletions(-) diff --git a/lib/librte_vhost/eventfd_link/eventfd_link.c b/lib/librte_vhost/eventfd_link/eventfd_li

[dpdk-dev] [PATCH v4 0/5] Refactor module `eventfd_link'

2015-04-02 Thread Pavel Boldin
This patchset contains refactoring steps for the `eventfd_link' module of the DPDK's `librte_vhost' part. Pavel Boldin (5): vhost: eventfd_link: moving ioctl to a function vhost: eventfd_link: add function fget_from_files vhost: eventfd_link: fix ioctl return values vhos

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-27 Thread Pavel Boldin
On Fri, Mar 27, 2015 at 1:10 PM, Thomas Monjalon wrote: > > > Due to increased `struct file's reference counter subsequent call > > > to `filp_close' does not free the `struct file'. Prepend `fput' call > > > to decrease the reference c

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-26 Thread Pavel Boldin
On Thu, Mar 26, 2015 at 9:56 AM, Xie, Huawei wrote: > On 3/23/2015 8:54 PM, Pavel Boldin wrote: > > Due to increased `struct file's reference counter subsequent call > > to `filp_close' does not free the `struct file'. Prepend `fput' call > > to decrease

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-24 Thread Pavel Boldin
On Tue, Mar 24, 2015 at 6:20 PM, Xie, Huawei wrote: > On 3/24/2015 7:10 PM, Pavel Boldin wrote: > > > On Tue, Mar 24, 2015 at 8:28 AM, Xie, Huawei huawei.xie at intel.com>> wrote: > On 3/23/2015 8:54 PM, Pavel Boldin wrote: > > Due to increased `struct file's r

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-24 Thread Pavel Boldin
On Tue, Mar 24, 2015 at 8:28 AM, Xie, Huawei wrote: > On 3/23/2015 8:54 PM, Pavel Boldin wrote: > > Due to increased `struct file's reference counter subsequent call > > to `filp_close' does not free the `struct file'. Prepend `fput' call > > to decrease

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-23 Thread Pavel Boldin
On Mon, Mar 23, 2015 at 5:36 PM, Xie, Huawei wrote: > On 3/23/2015 11:27 PM, Pavel Boldin wrote: > > > On Mon, Mar 23, 2015 at 5:16 PM, Xie, Huawei huawei.xie at intel.com>> wrote: > On 3/23/2015 10:52 PM, Pavel Boldin wrote: > > > On Mon, Mar 23, 2015 at 4:41

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-23 Thread Pavel Boldin
On Mon, Mar 23, 2015 at 5:16 PM, Xie, Huawei wrote: > On 3/23/2015 10:52 PM, Pavel Boldin wrote: > > > On Mon, Mar 23, 2015 at 4:41 PM, Xie, Huawei huawei.xie at intel.com>> wrote: > On 3/23/2015 10:37 PM, Pavel Boldin wrote: > > > On Mon, Mar 23, 2015 at 4:21

[dpdk-dev] [PATCH v3] vhost: Refactor module `eventfd_link'

2015-03-23 Thread Pavel Boldin
nce the `task_target'. Signed-off-by: Pavel Boldin --- Changes since last submission: * Using `sys_close' to close fd. * Removing unnecessary #include's. lib/librte_vhost/eventfd_link/eventfd_link.c | 193 ++- 1 file changed, 98 insertions(+), 95 deletion

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-23 Thread Pavel Boldin
On Mon, Mar 23, 2015 at 4:41 PM, Xie, Huawei wrote: > On 3/23/2015 10:37 PM, Pavel Boldin wrote: > > > On Mon, Mar 23, 2015 at 4:21 PM, Xie, Huawei huawei.xie at intel.com>> wrote: > On 3/23/2015 8:54 PM, Pavel Boldin wrote: > > Due to increased `struct file's r

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-23 Thread Pavel Boldin
On Mon, Mar 23, 2015 at 4:21 PM, Xie, Huawei wrote: > On 3/23/2015 8:54 PM, Pavel Boldin wrote: > > Due to increased `struct file's reference counter subsequent call > > to `filp_close' does not free the `struct file'. Prepend `fput' call > > to decrease

[dpdk-dev] [PATCH] vhost: Fix `struct file' leakage in `eventfd_link'

2015-03-23 Thread Pavel Boldin
Due to increased `struct file's reference counter subsequent call to `filp_close' does not free the `struct file'. Prepend `fput' call to decrease the reference counter. Signed-off-by: Pavel Boldin --- lib/librte_vhost/eventfd_link/eventfd_link.c | 1 + 1 file changed,

[dpdk-dev] [PATCH v2] Fix `eventfd_link' module leakages and races

2015-03-23 Thread Pavel Boldin
s as a separate submission and continue working on the refactoring patches. Is this plan OK for you? Pavel On Mon, Mar 23, 2015 at 1:15 PM, Thomas Monjalon wrote: > Hi Pavel, > > You forgot the Signed-off-by line. > > Huawei, Changchun, any comment on this patch? > > 20

[dpdk-dev] [PATCH] Fix `eventfd_link' module leakages and races

2015-03-20 Thread Pavel Boldin
Changchun, Please review the updated patch. Pavel On Tue, Mar 17, 2015 at 3:29 AM, Ouyang, Changchun < changchun.ouyang at intel.com> wrote: > > > > -Original Message- > > From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Pavel Boldin > > Sent: Tu

[dpdk-dev] [PATCH v2] Fix `eventfd_link' module leakages and races

2015-03-18 Thread Pavel Boldin
The `eventfd_link' module provides an API to "steal" fd from another process had been written with a bug that leaks `struct file' because of the extra reference counter increment and missing `fput' call. The other bug is using another process' `task_struct' without incrementing a reference counter

[dpdk-dev] [PATCH] Fix `eventfd_link' module leakages and races

2015-03-16 Thread Pavel Boldin
From: Pavel Boldin The `eventfd_link' module provides an API to "steal" fd from another process had been written with a bug that leaks `struct file' because of the extra reference counter increment and missing `fput' call. The other bug is using another proce