From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47069A00C4; Tue, 25 Jan 2022 11:44:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B8AD4426D9; Tue, 25 Jan 2022 11:44:52 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 623F4426D8 for ; Tue, 25 Jan 2022 11:44:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643107490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SKsO1Y/u2WFP49y7JQJkxa6JYF8OacuSwwdbmKmnm30=; b=a4e1Jy/hvLruyy0Pngpzi6uAzJu2dJO6VMsyXzdEzw0NpOViY1VHeJBOi8OS3UKKPBkyW9 8U8+vkFIBVm4st5krQ56/gSVHISDhPjz8q9m1F1fUbdWB4t5DodF79hzAiCyQoQ8EPokcV OW+KSKsvl7XzTlLY3ik+G5j5yjlmA+c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-10-9deaI-EIMA-Ys8uu_F4Lhw-1; Tue, 25 Jan 2022 05:44:47 -0500 X-MC-Unique: 9deaI-EIMA-Ys8uu_F4Lhw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9C1AA1018726; Tue, 25 Jan 2022 10:44:46 +0000 (UTC) Received: from [10.39.208.46] (unknown [10.39.208.46]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B7A7F4F85E; Tue, 25 Jan 2022 10:44:45 +0000 (UTC) Message-ID: Date: Tue, 25 Jan 2022 11:44:43 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 To: David Marchand Cc: dev , "Xia, Chenbo" References: <20211223083659.245766-1-maxime.coquelin@redhat.com> <20211223083659.245766-4-maxime.coquelin@redhat.com> From: Maxime Coquelin Subject: Re: [PATCH 3/7] vhost: improve socket layer logs In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On 1/4/22 15:47, David Marchand wrote: > On Thu, Dec 23, 2021 at 9:37 AM Maxime Coquelin > 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 >> --- >> 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. > >