DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, "Xia, Chenbo" <chenbo.xia@intel.com>
Subject: Re: [PATCH 3/7] vhost: improve socket layer logs
Date: Tue, 25 Jan 2022 11:44:43 +0100	[thread overview]
Message-ID: <b8f925f6-5d70-a788-6727-a10cf948a9a2@redhat.com> (raw)
In-Reply-To: <CAJFAV8xTz4TpTr=NKEXXz+NxCE3GHXgALKgUowd-FLchOhbAxg@mail.gmail.com>



On 1/4/22 15:47, David Marchand wrote:
> On Thu, Dec 23, 2021 at 9:37 AM Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
>>
>> This patch adds the Vhost socket path whenever possible in
>> order to make debugging possible when multiple Vhost
>> devices are in use.
> 
> This patch could go after patch 5 so that we have a dev->ifname
> available instead of fd.

Right, I'm doing this with also doing the same for send_vhost_message.

> 
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>>   lib/vhost/socket.c | 129 ++++++++++++++++++---------------------------
>>   1 file changed, 51 insertions(+), 78 deletions(-)
>>
>> diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
>> index 82963c1e6d..fd6b3a3ee4 100644
>> --- a/lib/vhost/socket.c
>> +++ b/lib/vhost/socket.c
>> @@ -124,12 +124,12 @@ read_fd_message(int sockfd, char *buf, int buflen, int *fds, int max_fds,
>>          ret = recvmsg(sockfd, &msgh, 0);
>>          if (ret <= 0) {
>>                  if (ret)
>> -                       VHOST_LOG_CONFIG(ERR, "recvmsg failed\n");
>> +                       VHOST_LOG_CONFIG(ERR, "recvmsg failed (fd %d)\n", sockfd);
> 
> strerror(errno) ?

Right, I also add it for sendmsg() et fcntl().

> 
>>                  return ret;
>>          }
>>
>>          if (msgh.msg_flags & (MSG_TRUNC | MSG_CTRUNC)) {
>> -               VHOST_LOG_CONFIG(ERR, "truncated msg\n");
>> +               VHOST_LOG_CONFIG(ERR, "truncated msg (fd %d)\n", sockfd);
>>                  return -1;
>>          }
>>
>> @@ -192,7 +192,7 @@ send_fd_message(int sockfd, char *buf, int buflen, int *fds, int fd_num)
>>          } while (ret < 0 && errno == EINTR);
>>
>>          if (ret < 0) {
>> -               VHOST_LOG_CONFIG(ERR,  "sendmsg error\n");
>> +               VHOST_LOG_CONFIG(ERR,  "sendmsg error (fd %d)\n", sockfd);
> 
> strerror(errno) ?
> 
> There is an extra space before "sendmsg error...


Fixed.

> 
> In this same function, we have a log with no context / fd logged:
>                          VHOST_LOG_CONFIG(ERR, "cmsg == NULL\n");
> I'd add sockfd (and/or dev->ifname if available) in this log.

Done, with adding the socket path.

>>                  return ret;
>>          }
>>
> 
> 
> The rest lgtm.
> 
> 


  reply	other threads:[~2022-01-25 10:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-23  8:36 [PATCH 0/7] vhost: improve logging Maxime Coquelin
2021-12-23  8:36 ` [PATCH 1/7] vhost: improve IOTLB logs Maxime Coquelin
2022-01-04 14:44   ` David Marchand
2022-01-25  9:39     ` Maxime Coquelin
2021-12-23  8:36 ` [PATCH 2/7] vhost: improve vDPA registration failure log Maxime Coquelin
2021-12-23  8:36 ` [PATCH 3/7] vhost: improve socket layer logs Maxime Coquelin
2022-01-04 14:47   ` David Marchand
2022-01-25 10:44     ` Maxime Coquelin [this message]
2022-01-04 15:02   ` David Marchand
2022-01-25 10:50     ` Maxime Coquelin
2021-12-23  8:36 ` [PATCH 4/7] vhost: improve Vhost " Maxime Coquelin
2022-01-04 14:48   ` David Marchand
2022-01-25 10:50     ` Maxime Coquelin
2021-12-23  8:36 ` [PATCH 5/7] vhost: improve Vhost-user " Maxime Coquelin
2021-12-23  8:36 ` [PATCH 6/7] vhost: improve Virtio-net " Maxime Coquelin
2021-12-23  8:36 ` [PATCH 7/7] vhost: remove multi-line logs Maxime Coquelin
2021-12-23 15:59 ` [PATCH 0/7] vhost: improve logging Stephen Hemminger
2022-01-04 15:05 ` David Marchand

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=b8f925f6-5d70-a788-6727-a10cf948a9a2@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    /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).