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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
---
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
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
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
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
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
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
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
:
- 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
39 matches
Mail list logo