DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
To: "Tan, Jianfeng" <jianfeng.tan@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/2] vhost: make sure vhost fdset-thread created successfully
Date: Fri, 23 Mar 2018 09:53:46 +0800	[thread overview]
Message-ID: <CAMDZJNVKcNieNekMHpuoxxP3sGdcznHf7G7ACq18i1Or2RW8NQ@mail.gmail.com> (raw)
In-Reply-To: <ED26CBA2FAD1BF48A8719AEF02201E365149CDA4@SHSMSX103.ccr.corp.intel.com>

On Fri, Mar 23, 2018 at 9:30 AM, Tan, Jianfeng <jianfeng.tan@intel.com> wrote:
> Hi Xiangxia,
>
>> -----Original Message-----
>> From: xiangxia.m.yue@gmail.com [mailto:xiangxia.m.yue@gmail.com]
>> Sent: Thursday, March 22, 2018 8:40 PM
>> To: Tan, Jianfeng
>> Cc: dev@dpdk.org; Tonghao Zhang
>> Subject: [PATCH 1/2] vhost: make sure vhost fdset-thread created
>> successfully
>>
>> From: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>>
>> When first call the 'rte_vhost_driver_start', the
>> fdset_event_dispatch thread should be created successfully.
>> Because the vhost uses it to poll socket events for vhost
>> server or clients. Without it, for example, vhost will not
>> get the connection event.
>>
>> This patch returns err code directly when created not successful.
>>
>> Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>
> Except a nit below,
>
> Reviewed-by: Jianfeng Tan <jianfeng.tan@intel.com>
>
>> ---
>>  lib/librte_vhost/socket.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
>> index 83befdc..8ca01df 100644
>> --- a/lib/librte_vhost/socket.c
>> +++ b/lib/librte_vhost/socket.c
>> @@ -831,9 +831,11 @@ struct vhost_device_ops const *
>>       if (fdset_tid == 0) {
>>               int ret = pthread_create(&fdset_tid, NULL,
>> fdset_event_dispatch,
>>                                    &vhost_user.fdset);
>> -             if (ret != 0)
>> +             if (ret != 0) {
>>                       RTE_LOG(ERR, VHOST_CONFIG,
>>                               "failed to create fdset handling thread");
>> +                     return ret;
>
> According to the declaration below, we shall return 0 or -1.
I will send v2

> /**
>  *
>  * Start the vhost-user driver.
>  *
>  * This function triggers the vhost-user negotiation.
>  *
>  * @param path
>  *  The vhost-user socket file path
>  * @return
>  *  0 on success, -1 on failure
>  */
> int rte_vhost_driver_start(const char *path);
>
>> +             }
>>       }
>>
>>       if (vsocket->is_server)
>> --
>> 1.8.3.1
>

      reply	other threads:[~2018-03-23  1:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-22 12:39 xiangxia.m.yue
2018-03-22 12:39 ` [dpdk-dev] [PATCH 2/2] vhost: add fdset-event thread name xiangxia.m.yue
2018-03-23  1:38   ` Tan, Jianfeng
2018-03-23  1:30 ` [dpdk-dev] [PATCH 1/2] vhost: make sure vhost fdset-thread created successfully Tan, Jianfeng
2018-03-23  1:53   ` Tonghao Zhang [this message]

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=CAMDZJNVKcNieNekMHpuoxxP3sGdcznHf7G7ACq18i1Or2RW8NQ@mail.gmail.com \
    --to=xiangxia.m.yue@gmail.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).