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 ED7C9A0093; Tue, 4 Jan 2022 15:48:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8050540042; Tue, 4 Jan 2022 15:48:08 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 8273C40040 for ; Tue, 4 Jan 2022 15:48:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641307685; 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: in-reply-to:in-reply-to:references:references; bh=t9Fbk68aIMocn/KXU9wRjS3QIbEVCKRM6Rya2oCeOz4=; b=cpSgaHdXRlXnTLvbFbs9sZ4UoHi58s96EIspGxyMxr59LHvEyUGDPQuP3Ht53GI2/VgHl4 5jFLwCZDgKfy4NXF5oSm+//4L+VCfh/LX7qXmM0k7D7DaeQljEnKg6Aemw5ZjF2Um0M1si 1WVLCV5MK7tga5pKKluHYCXuHhKswIA= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-563-gpJjfAS-MgahJlXuZ4EOUA-1; Tue, 04 Jan 2022 09:48:04 -0500 X-MC-Unique: gpJjfAS-MgahJlXuZ4EOUA-1 Received: by mail-lj1-f199.google.com with SMTP id w17-20020a05651c119100b0022dcdb204b9so8354501ljo.5 for ; Tue, 04 Jan 2022 06:48:04 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t9Fbk68aIMocn/KXU9wRjS3QIbEVCKRM6Rya2oCeOz4=; b=0PKDtZB0HXxZ+DIEHIhusdn2Zsgap7zWIblGhj8yx9ZRnkwejwLAQ9W2PItcaw+vMv hdW3X+sJvnlCXvNK2C4JyiqLpY5Jtaw3/AkDfd/3HLikBmeIkYpJ2H50Y/dHnjeQiXn3 oQycoP/HsiZLOIx4GjwnYPLadbLPr75XMmkEyKHvvE2WR3aq8WCyYYQY97YMeA16gAEM yaHP0v6BPDfRYlkLNKOd7q3CzzBuklK4lAqiLy9FjDART5xrjIvona8LUKoi89JF68ae /zhoX0aqVYWZm7LuQIetKPXz6AJrEGhSqL5QEdnF0NgYYTmnJFeFfYL7kwTjTVj/G+9Z 2XAw== X-Gm-Message-State: AOAM53129AYOTsPGxR6r22rDbPzcy26UNfmewqMdDnKdHxucCH8dTF03 rewcbWQ9vJrJEVoA+eF/Mxd1DAsbTlI472vyGi5qDIMogh5RzD3bJOxM0YCqYIvuNhjmHLbOLcQ L2amr+VW97Nqqndraab8= X-Received: by 2002:ac2:4e8a:: with SMTP id o10mr42223044lfr.560.1641307683248; Tue, 04 Jan 2022 06:48:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLKnwNhcZU4lY11I75hDY05AQX1xZQempTClkBEasB6tgI+wdIoZ77XUR9ffpYKU1Jo2G+wxcATEqZEgodoEQ= X-Received: by 2002:ac2:4e8a:: with SMTP id o10mr42223034lfr.560.1641307683053; Tue, 04 Jan 2022 06:48:03 -0800 (PST) MIME-Version: 1.0 References: <20211223083659.245766-1-maxime.coquelin@redhat.com> <20211223083659.245766-4-maxime.coquelin@redhat.com> In-Reply-To: <20211223083659.245766-4-maxime.coquelin@redhat.com> From: David Marchand Date: Tue, 4 Jan 2022 15:47:52 +0100 Message-ID: Subject: Re: [PATCH 3/7] vhost: improve socket layer logs To: Maxime Coquelin Cc: dev , "Xia, Chenbo" Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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 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. > > 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) ? > 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... 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. > return ret; > } > The rest lgtm. -- David Marchand