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 C8524A0093; Tue, 4 Jan 2022 15:44:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 58BB440042; Tue, 4 Jan 2022 15:44:52 +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 0423F40040 for ; Tue, 4 Jan 2022 15:44:49 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1641307489; 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=uUjzHVjwD3npAs6kKJxdxKwucZZGaGTXDUJ0DPh14Es=; b=iPjW6L5rytna51oXSVuSW1LPFcxVBGcz35wbNmiP9sBIDWFlAHF2TMGObhoDxQqnBFLCKE KC48AGSFkw/DyDaovHz6uH1S0yo9+oGTqEzzFDtU0eWcb2zjxSUxeE7GFojdHxEX98I11d p8vFp1XuMjV9kMbWh/pBcUBxnyFFhXU= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-491-VYAmKtJpO1WRJPDnvZ3ZBw-1; Tue, 04 Jan 2022 09:44:48 -0500 X-MC-Unique: VYAmKtJpO1WRJPDnvZ3ZBw-1 Received: by mail-lf1-f70.google.com with SMTP id 28-20020ac24d5c000000b00425c507cfc0so7927802lfp.20 for ; Tue, 04 Jan 2022 06:44:47 -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=uUjzHVjwD3npAs6kKJxdxKwucZZGaGTXDUJ0DPh14Es=; b=jQNGSIy5rDVw0aml4LGYebJIMgBVnPnBkG0l3zeP6ekfPIbkfnpo/Zd8YFwfyylp7r JFE6wZlwhwGiW5FooQfRJbZZwngI3mfT/WUmO1QYK7utlywlK9XdJ3laDYjh0vLSAUtq ApbrdnZzxNeyYae2tX0ddwHp2nmPIKI1TYKkiXcDgcmZrdMsnMJwoowJM0zIQMit5kip 3NNfBGTWrmByiQ6nQPJ3/+HmFgPBY05Owq+m4RiOwenAVpVN5z9HOEu2ecleyCbn+oVO 5GCG18pOGmuy0wIvfrjd0XuEBrm8/+Qvl8YiBv1vsVvZjbS4HnaGKM72sUDSVHvObS3A 5sOg== X-Gm-Message-State: AOAM5313tl1uD2KRu8KX+NVkcTA7TBGSAbZAP3uPHdx2y6aj0pw+vGBi ktCiXd/ydadtC00EvEbyV+iFFYwdwi7enW/wjSi3bI8vglCQbesyTDV1e6BUUFS6E1UOpGiEJkF CB5RKj/pU5aNa1SoZUh0= X-Received: by 2002:ac2:4e8a:: with SMTP id o10mr42212972lfr.560.1641307486586; Tue, 04 Jan 2022 06:44:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwfBHfK4Edds654e7H7yzqhKn/VNZu5hNfNXa8IN+Xj+V+gRuM0POQQEyAHosEMbQnP5y/b285VGEF4a+3tFVY= X-Received: by 2002:ac2:4e8a:: with SMTP id o10mr42212953lfr.560.1641307486315; Tue, 04 Jan 2022 06:44:46 -0800 (PST) MIME-Version: 1.0 References: <20211223083659.245766-1-maxime.coquelin@redhat.com> <20211223083659.245766-2-maxime.coquelin@redhat.com> In-Reply-To: <20211223083659.245766-2-maxime.coquelin@redhat.com> From: David Marchand Date: Tue, 4 Jan 2022 15:44:35 +0100 Message-ID: Subject: Re: [PATCH 1/7] vhost: improve IOTLB 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 IOTLB mempool name when logging debug > or error messages, and also prepends the socket path. > to all the logs. > > Signed-off-by: Maxime Coquelin > --- > 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. > 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. > + dev->ifname, pool_name); > return -1; > } > The rest lgtm. -- David Marchand