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 1/7] vhost: improve IOTLB logs
Date: Tue, 25 Jan 2022 10:39:18 +0100 [thread overview]
Message-ID: <7592a9c5-e591-8544-8fd4-163d3ff7a3c8@redhat.com> (raw)
In-Reply-To: <CAJFAV8w26rQHN1iKym=qQS4Hh1Kzcc-7ycsdsHGunjMSMoim+A@mail.gmail.com>
Hi David,
On 1/4/22 15:44, David Marchand wrote:
> On Thu, Dec 23, 2021 at 9:37 AM Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
>>
>> This patch adds IOTLB mempool name when logging debug
>> or error messages, and also prepends the socket path.
>> to all the logs.
>>
>> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>> lib/vhost/iotlb.c | 26 +++++++++++++++-----------
>> lib/vhost/iotlb.h | 10 +++++-----
>> lib/vhost/vhost.c | 2 +-
>> lib/vhost/vhost_user.c | 2 +-
>> 4 files changed, 22 insertions(+), 18 deletions(-)
>>
>> diff --git a/lib/vhost/iotlb.c b/lib/vhost/iotlb.c
>> index 82bdb84526..e9e1ede7a4 100644
>> --- a/lib/vhost/iotlb.c
>> +++ b/lib/vhost/iotlb.c
>> @@ -62,7 +62,7 @@ vhost_user_iotlb_pending_miss(struct vhost_virtqueue *vq, uint64_t iova,
>> }
>>
>> void
>> -vhost_user_iotlb_pending_insert(struct vhost_virtqueue *vq,
>> +vhost_user_iotlb_pending_insert(struct virtio_net *dev, struct vhost_virtqueue *vq,
>> uint64_t iova, uint8_t perm)
>> {
>> struct vhost_iotlb_entry *node;
>> @@ -70,14 +70,16 @@ vhost_user_iotlb_pending_insert(struct vhost_virtqueue *vq,
>>
>> ret = rte_mempool_get(vq->iotlb_pool, (void **)&node);
>> if (ret) {
>> - VHOST_LOG_CONFIG(DEBUG, "IOTLB pool empty, clear entries\n");
>> + VHOST_LOG_CONFIG(DEBUG, "(%s) IOTLB pool %s empty, clear entries\n",
>> + dev->ifname, vq->iotlb_pool->name);
>> if (!TAILQ_EMPTY(&vq->iotlb_pending_list))
>> vhost_user_iotlb_pending_remove_all(vq);
>> else
>> vhost_user_iotlb_cache_random_evict(vq);
>> ret = rte_mempool_get(vq->iotlb_pool, (void **)&node);
>> if (ret) {
>> - VHOST_LOG_CONFIG(ERR, "IOTLB pool still empty, failure\n");
>> + VHOST_LOG_CONFIG(ERR, "(%s) IOTLB pool %s still empty, failure\n",
>> + dev->ifname, vq->iotlb_pool->name);
>> return;
>> }
>> }
>> @@ -156,22 +158,25 @@ vhost_user_iotlb_cache_random_evict(struct vhost_virtqueue *vq)
>> }
>>
>> void
>> -vhost_user_iotlb_cache_insert(struct vhost_virtqueue *vq, uint64_t iova,
>> - uint64_t uaddr, uint64_t size, uint8_t perm)
>> +vhost_user_iotlb_cache_insert(struct virtio_net *dev, struct vhost_virtqueue *vq,
>> + uint64_t iova, uint64_t uaddr,
>> + uint64_t size, uint8_t perm)
>> {
>> struct vhost_iotlb_entry *node, *new_node;
>> int ret;
>>
>> ret = rte_mempool_get(vq->iotlb_pool, (void **)&new_node);
>> if (ret) {
>> - VHOST_LOG_CONFIG(DEBUG, "IOTLB pool empty, clear entries\n");
>> + VHOST_LOG_CONFIG(DEBUG, "(%s) IOTLB pool %s empty, clear entries\n",
>> + dev->ifname, vq->iotlb_pool->name);
>
> We have the same logs in two different paths
> (vhost_user_iotlb_pending_insert and vhost_user_iotlb_cache_insert).
> It would probably help when debugging to have separate messages.
>
> This could be added later, since this current patch is about prefixing
> with the socket path.
Makes sense, I'm adding a new patch on top of the series to address
that.
>
>> if (!TAILQ_EMPTY(&vq->iotlb_list))
>> vhost_user_iotlb_cache_random_evict(vq);
>> else
>> vhost_user_iotlb_pending_remove_all(vq);
>> ret = rte_mempool_get(vq->iotlb_pool, (void **)&new_node);
>> if (ret) {
>> - VHOST_LOG_CONFIG(ERR, "IOTLB pool still empty, failure\n");
>> + VHOST_LOG_CONFIG(ERR, "(%s) IOTLB pool %s still empty, failure\n",
>> + dev->ifname, vq->iotlb_pool->name);
>> return;
>> }
>> }
>> @@ -311,7 +316,7 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index)
>>
>> snprintf(pool_name, sizeof(pool_name), "iotlb_%u_%d_%d",
>> getpid(), dev->vid, vq_index);
>> - VHOST_LOG_CONFIG(DEBUG, "IOTLB cache name: %s\n", pool_name);
>> + VHOST_LOG_CONFIG(DEBUG, "(%s) IOTLB cache name: %s\n", dev->ifname, pool_name);
>>
>> /* If already created, free it and recreate */
>> vq->iotlb_pool = rte_mempool_lookup(pool_name);
>> @@ -324,9 +329,8 @@ vhost_user_iotlb_init(struct virtio_net *dev, int vq_index)
>> RTE_MEMPOOL_F_NO_CACHE_ALIGN |
>> RTE_MEMPOOL_F_SP_PUT);
>> if (!vq->iotlb_pool) {
>> - VHOST_LOG_CONFIG(ERR,
>> - "Failed to create IOTLB cache pool (%s)\n",
>> - pool_name);
>> + VHOST_LOG_CONFIG(ERR, "(%s) Failed to create IOTLB cache pool (%s)\n",
>
> I'd make this log consistent with the previous log and remove the ()
> around the pool name.
Done.
>
>> + dev->ifname, pool_name);
>> return -1;
>> }
>>
>
> The rest lgtm.
>
>
>
Thanks,
Maxime
next prev parent reply other threads:[~2022-01-25 9:39 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 [this message]
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
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=7592a9c5-e591-8544-8fd4-163d3ff7a3c8@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).