Re: [dpdk-dev] [PATCH v6 4/5] vhost: unify message handling function signature

2018-10-05 Thread Nikolay Nikolaev
On Tue, Oct 2, 2018 at 11:59 AM Maxime Coquelin wrote: > > > > On 09/24/2018 10:17 PM, Nikolay Nikolaev wrote: > > Each vhost-user message handling function will return an int result > > which is described in the new enum vh_result: error, OK and reply. > > A

[dpdk-dev] [PATCH v1 0/5] vhost_user.c code cleanup

2018-06-26 Thread Nikolay Nikolaev
vhost: vhost_user.c code cleanup This patchesries introduce a set of code redesigns in vhost_user.c. The goal is to unify and simplify vhost-user message handling. The patches do not intend to introduce any functional changes. --- Nikolay Nikolaev (5): vhost: unify VhostUserMsg usage

[dpdk-dev] [PATCH v1 1/5] vhost: unify VhostUserMsg usage

2018-06-26 Thread Nikolay Nikolaev
Use the typedef version of struct VhostUserMsg. Also unify the related parameter name. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 50 + 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v1 3/5] vhost: handle unsupported message types in functions

2018-06-26 Thread Nikolay Nikolaev
Add new functions to handle the unsupported vhost message types: - vhost_user_set_vring_err - vhost_user_set_log_fd Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v1 2/5] vhost: make message handling functions prepare the reply

2018-06-26 Thread Nikolay Nikolaev
As VhostUserMsg structure is resued to generate the reply, move the relevant fields update into the respective message handling functions. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff

[dpdk-dev] [PATCH v1 4/5] vhost: unify message handling function signature

2018-06-26 Thread Nikolay Nikolaev
Each vhost-user message handlign function will return an int result which is described in the new enum vh_result: error, OK and reply. All functions will now have two arguments, virtio_net double pointer and VhostUserMsg pointer. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c

[dpdk-dev] [PATCH v1 5/5] vhost: message handling implemented as a callback array

2018-06-26 Thread Nikolay Nikolaev
Introduce vhost_message_handlers, which maps the message request type to the message handler. Then replace the switch construct with a map and call. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 144 - 1 file changed, 55 insertions

[dpdk-dev] [PATCH v2 1/5] vhost: unify VhostUserMsg usage

2018-07-19 Thread Nikolay Nikolaev
Use the typedef version of struct VhostUserMsg. Also unify the related parameter name. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 50 + 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v2 0/5] vhost_user.c code cleanup

2018-07-19 Thread Nikolay Nikolaev
behavior - Fall through when the callback returns VH_RESULT_ERR - Fall through if the request is out of range --- Nikolay Nikolaev (5): vhost: unify VhostUserMsg usage vhost: make message handling functions prepare the reply vhost: handle unsupported message types in functions

[dpdk-dev] [PATCH v2 3/5] vhost: handle unsupported message types in functions

2018-07-19 Thread Nikolay Nikolaev
Add new functions to handle the unsupported vhost message types: - vhost_user_set_vring_err - vhost_user_set_log_fd Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v2 4/5] vhost: unify message handling function signature

2018-07-19 Thread Nikolay Nikolaev
Each vhost-user message handling function will return an int result which is described in the new enum vh_result: error, OK and reply. All functions will now have two arguments, virtio_net double pointer and VhostUserMsg pointer. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c

[dpdk-dev] [PATCH v2 2/5] vhost: make message handling functions prepare the reply

2018-07-19 Thread Nikolay Nikolaev
As VhostUserMsg structure is resued to generate the reply, move the relevant fields update into the respective message handling functions. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 26 -- 1 file changed, 16 insertions(+), 10 deletions(-) diff

[dpdk-dev] [PATCH v2 5/5] vhost: message handling implemented as a callback array

2018-07-19 Thread Nikolay Nikolaev
Introduce vhost_message_handlers, which maps the message request type to the message handler. Then replace the switch construct with a map and call. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 143 +++-- 1 file changed, 54 insertions

Re: [dpdk-dev] [PATCH v2 0/5] vhost_user.c code cleanup

2018-09-12 Thread Nikolay Nikolaev
Hello Maxime, I'll rebase and fix Ilya's comments. Thanks for the reviews. regards, Nikolay Nikolaev On Tue, Sep 11, 2018 at 12:38 PM Maxime Coquelin wrote: > Hi Nikolay, > > On 07/19/2018 09:13 PM, Nikolay Nikolaev wrote: > > vhost: vhost_user.c code cleanup

[dpdk-dev] [PATCH v3 2/5] vhost: make message handling functions prepare the reply

2018-09-14 Thread Nikolay Nikolaev
As VhostUserMsg structure is reused to generate the reply, move the relevant fields update into the respective message handling functions. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff

[dpdk-dev] [PATCH v3 0/5] vhost: vhost_user.c code cleanup

2018-09-14 Thread Nikolay Nikolaev
--- Nikolay Nikolaev (5): vhost: unify VhostUserMsg usage vhost: make message handling functions prepare the reply vhost: handle unsupported message types in functions vhost: unify message handling function signature vhost: message handling implemented as a callback array

[dpdk-dev] [PATCH v3 1/5] vhost: unify VhostUserMsg usage

2018-09-14 Thread Nikolay Nikolaev
Use the typedef version of struct VhostUserMsg. Also unify the related parameter name. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 50 + 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v3 4/5] vhost: unify message handling function signature

2018-09-14 Thread Nikolay Nikolaev
Each vhost-user message handling function will return an int result which is described in the new enum vh_result: error, OK and reply. All functions will now have two arguments, virtio_net double pointer and VhostUserMsg pointer. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c

[dpdk-dev] [PATCH v3 3/5] vhost: handle unsupported message types in functions

2018-09-14 Thread Nikolay Nikolaev
Add new functions to handle the unsupported vhost message types: - vhost_user_set_vring_err - vhost_user_set_log_fd Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v3 5/5] vhost: message handling implemented as a callback array

2018-09-14 Thread Nikolay Nikolaev
accordingly to reflect that. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 161 + 1 file changed, 66 insertions(+), 95 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 81c0396de..9004e1ac8

Re: [dpdk-dev] [PATCH v3 5/5] vhost: message handling implemented as a callback array

2018-09-19 Thread Nikolay Nikolaev
On Wed, Sep 19, 2018 at 10:37 AM Maxime Coquelin wrote: > > > > On 09/15/2018 07:20 AM, Nikolay Nikolaev wrote: > > Introduce vhost_message_handlers, which maps the message request > > type to the message handler. Then replace the switch construct > > with a

[dpdk-dev] [PATCH v4 1/5] vhost: unify struct VhostUserMsg usage

2018-09-22 Thread Nikolay Nikolaev
Do not use the typedef version of struct VhostUserMsg. Also unify the related parameter name. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 41 + 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v4 0/5] vhost: vhost_user.c code cleanup

2018-09-22 Thread Nikolay Nikolaev
: - Fix the comments by Tiwei Bie - Keep the old behavior - Fall through when the callback returns VH_RESULT_ERR - Fall through if the request is out of range --- Nikolay Nikolaev (5): vhost: unify struct VhostUserMsg usage vhost: make message handling functions prepare the reply

[dpdk-dev] [PATCH v4 3/5] vhost: handle unsupported message types in functions

2018-09-22 Thread Nikolay Nikolaev
Add new functions to handle the unsupported vhost message types: - vhost_user_set_vring_err - vhost_user_set_log_fd Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v4 2/5] vhost: make message handling functions prepare the reply

2018-09-22 Thread Nikolay Nikolaev
As VhostUserMsg structure is reused to generate the reply, move the relevant fields update into the respective message handling functions. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff

[dpdk-dev] [PATCH v4 4/5] vhost: unify message handling function signature

2018-09-22 Thread Nikolay Nikolaev
Each vhost-user message handling function will return an int result which is described in the new enum vh_result: error, OK and reply. All functions will now have two arguments, virtio_net double pointer and VhostUserMsg pointer. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c

[dpdk-dev] [PATCH v4 5/5] vhost: message handling implemented as a callback array

2018-09-22 Thread Nikolay Nikolaev
accordingly to reflect that. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 149 +++-- 1 file changed, 56 insertions(+), 93 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 051740477..0c2faa6af

[dpdk-dev] [PATCH v5 1/5] vhost: unify struct VhostUserMsg usage

2018-09-24 Thread Nikolay Nikolaev
Do not use the typedef version of struct VhostUserMsg. Also unify the related parameter name. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 41 + 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v5 2/5] vhost: make message handling functions prepare the reply

2018-09-24 Thread Nikolay Nikolaev
As VhostUserMsg structure is reused to generate the reply, move the relevant fields update into the respective message handling functions. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff

[dpdk-dev] [PATCH v5 3/5] vhost: handle unsupported message types in functions

2018-09-24 Thread Nikolay Nikolaev
Add new functions to handle the unsupported vhost message types: - vhost_user_set_vring_err - vhost_user_set_log_fd Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v5 0/5] vhost_user.c code cleanup

2018-09-24 Thread Nikolay Nikolaev
Maximets) - fixed a type on the description of 2/5 patch (Maxime Coquelin) v2 changes: - Fix the comments by Tiwei Bie - Keep the old behavior - Fall through when the callback returns VH_RESULT_ERR - Fall through if the request is out of range --- Nikolay Nikolaev (5): vhost: unify

[dpdk-dev] [PATCH v5 4/5] vhost: unify message handling function signature

2018-09-24 Thread Nikolay Nikolaev
Each vhost-user message handling function will return an int result which is described in the new enum vh_result: error, OK and reply. All functions will now have two arguments, virtio_net double pointer and VhostUserMsg pointer. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c

[dpdk-dev] [PATCH v5 5/5] vhost: message handling implemented as a callback array

2018-09-24 Thread Nikolay Nikolaev
accordingly to reflect that. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 149 +++-- 1 file changed, 56 insertions(+), 93 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index ac89f413d..faad3ba49

[dpdk-dev] [PATCH v6 0/5] vhost: vhost_user.c code cleanup

2018-09-24 Thread Nikolay Nikolaev
VH_RESULT_ERR - Fall through if the request is out of range --- Nikolay Nikolaev (5): vhost: unify struct VhostUserMsg usage vhost: make message handling functions prepare the reply vhost: handle unsupported message types in functions vhost: unify message handling function

[dpdk-dev] [PATCH v6 4/5] vhost: unify message handling function signature

2018-09-24 Thread Nikolay Nikolaev
Each vhost-user message handling function will return an int result which is described in the new enum vh_result: error, OK and reply. All functions will now have two arguments, virtio_net double pointer and VhostUserMsg pointer. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c

[dpdk-dev] [PATCH v6 5/5] vhost: message handling implemented as a callback array

2018-09-24 Thread Nikolay Nikolaev
accordingly to reflect that. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 150 - 1 file changed, 57 insertions(+), 93 deletions(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index e1b705fa7..f6ce8e092

[dpdk-dev] [PATCH v6 1/5] vhost: unify struct VhostUserMsg usage

2018-09-24 Thread Nikolay Nikolaev
Do not use the typedef version of struct VhostUserMsg. Also unify the related parameter name. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 41 + 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/librte_vhost

[dpdk-dev] [PATCH v6 2/5] vhost: make message handling functions prepare the reply

2018-09-24 Thread Nikolay Nikolaev
As VhostUserMsg structure is reused to generate the reply, move the relevant fields update into the respective message handling functions. Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff

[dpdk-dev] [PATCH v6 3/5] vhost: handle unsupported message types in functions

2018-09-24 Thread Nikolay Nikolaev
Add new functions to handle the unsupported vhost message types: - vhost_user_set_vring_err - vhost_user_set_log_fd Signed-off-by: Nikolay Nikolaev --- lib/librte_vhost/vhost_user.c | 22 +- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/lib/librte_vhost