From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by dpdk.org (Postfix) with ESMTP id DCF20FFA for ; Mon, 30 Apr 2018 16:07:28 +0200 (CEST) Received: by mail-wm0-f68.google.com with SMTP id a67so5813757wmf.3 for ; Mon, 30 Apr 2018 07:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=bJsAED2I2SG3M8wUPkwIdiogKZUzjm79fuijPwcKk00=; b=aeUBw7zAzfLGXfFGZJYHFEDfF45pd+1DaBk5dy0DLwr+uzwjRgmtIH0d+ri6ll15+1 Okd0xgN5r6noDlpP285Q0xfhEOu9MCut/POqX4X1snuPOO9a6AtVyk86DSb1RM2c1pxf xn6HrU35vegMaOT0HYOLsoXDbba9JggRQ4zzC9hjVQ3AWB4nFyl5eRQfi2B5z6Ts1/md meu+o2CEhonSzo+mjJDPy6wK+yRX/IPdw/UCTKpoqCyaLVBP0X6ejY2llcOzDoX4KC9t iZXg3z+ppArajQeKzMcljWWIvb4lar5ZoJR09kZAunnCxxkckcIVqP5WjoJa8q3wcOgd 5boA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=bJsAED2I2SG3M8wUPkwIdiogKZUzjm79fuijPwcKk00=; b=uAopBH1hoEd9aA5N/8ev5w3qSg3NveF/sdk2nJuwz5OzBndONyQJW+JpB4LTz6T5P2 MS27RU7a8yN4dOuUalSwWAJFhk2ie79p7SjRnbEovlTY0IalV4AzpL9xJCnXf5msQNDE bVkrcqiKQ2pQ5q0PbXDiOZDCnjxsKzr24kErK8G/PSXwMt/3ibbWRFoI1LeH5Iij8rja c8FX9f7d4iU6Yu3Si3dS064whtyflHp20bokamA814GouzJqV+FEK2snmodhdP8ztD/n KJX+gegP6Ca2LAUbD1YJZjwIQM6yIKDzzzyuQl1AwvRMtww0bAHhDvjELfpbb3PyEZG8 18LA== X-Gm-Message-State: ALQs6tBx9xtFbJ2XjDctRO1AnMb0YI7ZGIibloOZbB5TCOW9YvBlbtgl abqbwTxf50qaTHBm79gY2NE= X-Google-Smtp-Source: AB8JxZpkOWfDSY0faXG1aO7OSOEjfvtbuLn3WLBEFw+1ITcXd3mJcyWhmBU+h2N5TrMLOuRbWZ6EsQ== X-Received: by 10.28.161.135 with SMTP id k129mr7055248wme.25.1525097248567; Mon, 30 Apr 2018 07:07:28 -0700 (PDT) Received: from localhost ([2a00:23c5:be9a:5200:ce4c:82c0:d567:ecbb]) by smtp.gmail.com with ESMTPSA id 19sm8348687wmv.18.2018.04.30.07.07.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Apr 2018 07:07:27 -0700 (PDT) From: luca.boccassi@gmail.com To: Tomasz Kulasek Cc: Ben Walker , Jianfeng Tan , Maxime Coquelin , dpdk stable Date: Mon, 30 Apr 2018 15:03:18 +0100 Message-Id: <20180430140606.4615-40-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180430140606.4615-1-luca.boccassi@gmail.com> References: <20180430140606.4615-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'vhost: fix log macro name conflict' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Apr 2018 14:07:29 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/02/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From f2c077f7e338ed101522c25d976da2933b4cee8f Mon Sep 17 00:00:00 2001 From: Tomasz Kulasek Date: Fri, 9 Feb 2018 18:24:00 +0100 Subject: [PATCH] vhost: fix log macro name conflict [ upstream commit 06fc1159772de295ae2cb8d11f98ea6313288cc9 ] LOG_DEBUG is a symbol defined by POSIX, so if sys/log.h is included the symbols conflict. This patch changes LOG_DEBUG to VHOST_LOG_DEBUG. Fixes: 1c01d52392d5 ("vhost: add debug print") Signed-off-by: Ben Walker Signed-off-by: Tomasz Kulasek Reviewed-by: Jianfeng Tan Reviewed-by: Maxime Coquelin --- lib/librte_vhost/vhost.h | 9 +++++---- lib/librte_vhost/vhost_user.c | 10 +++++----- lib/librte_vhost/virtio_net.c | 16 ++++++++-------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h index c4749a206..bab0b456e 100644 --- a/lib/librte_vhost/vhost.h +++ b/lib/librte_vhost/vhost.h @@ -297,7 +297,8 @@ vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq, #ifdef RTE_LIBRTE_VHOST_DEBUG #define VHOST_MAX_PRINT_BUFF 6072 #define LOG_LEVEL RTE_LOG_DEBUG -#define LOG_DEBUG(log_type, fmt, args...) RTE_LOG(DEBUG, log_type, fmt, ##args) +#define VHOST_LOG_DEBUG(log_type, fmt, args...) \ + RTE_LOG(DEBUG, log_type, fmt, ##args) #define PRINT_PACKET(device, addr, size, header) do { \ char *pkt_addr = (char *)(addr); \ unsigned int index; \ @@ -313,11 +314,11 @@ vhost_log_used_vring(struct virtio_net *dev, struct vhost_virtqueue *vq, } \ snprintf(packet + strnlen(packet, VHOST_MAX_PRINT_BUFF), VHOST_MAX_PRINT_BUFF - strnlen(packet, VHOST_MAX_PRINT_BUFF), "\n"); \ \ - LOG_DEBUG(VHOST_DATA, "%s", packet); \ + VHOST_LOG_DEBUG(VHOST_DATA, "%s", packet); \ } while (0) #else #define LOG_LEVEL RTE_LOG_INFO -#define LOG_DEBUG(log_type, fmt, args...) do {} while (0) +#define VHOST_LOG_DEBUG(log_type, fmt, args...) do {} while (0) #define PRINT_PACKET(device, addr, size, header) do {} while (0) #endif @@ -411,7 +412,7 @@ vhost_vring_call(struct virtio_net *dev, struct vhost_virtqueue *vq) uint16_t old = vq->signalled_used; uint16_t new = vq->last_used_idx; - LOG_DEBUG(VHOST_DATA, "%s: used_event_idx=%d, old=%d, new=%d\n", + VHOST_LOG_DEBUG(VHOST_DATA, "%s: used_event_idx=%d, old=%d, new=%d\n", __func__, vhost_used_event(vq), old, new); diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index d2ca7b4e7..6fc810ec3 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -181,7 +181,7 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features) } else { dev->vhost_hlen = sizeof(struct virtio_net_hdr); } - LOG_DEBUG(VHOST_CONFIG, + VHOST_LOG_DEBUG(VHOST_CONFIG, "(%d) mergeable RX buffers %s, virtio 1 %s\n", dev->vid, (dev->features & (1 << VIRTIO_NET_F_MRG_RXBUF)) ? "on" : "off", @@ -474,13 +474,13 @@ translate_ring_addresses(struct virtio_net *dev, int vq_index) vq->log_guest_addr = addr->log_guest_addr; - LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address desc: %p\n", + VHOST_LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address desc: %p\n", dev->vid, vq->desc); - LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address avail: %p\n", + VHOST_LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address avail: %p\n", dev->vid, vq->avail); - LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address used: %p\n", + VHOST_LOG_DEBUG(VHOST_CONFIG, "(%d) mapped address used: %p\n", dev->vid, vq->used); - LOG_DEBUG(VHOST_CONFIG, "(%d) log_guest_addr: %" PRIx64 "\n", + VHOST_LOG_DEBUG(VHOST_CONFIG, "(%d) log_guest_addr: %" PRIx64 "\n", dev->vid, vq->log_guest_addr); return dev; diff --git a/lib/librte_vhost/virtio_net.c b/lib/librte_vhost/virtio_net.c index 89b5b5f86..5fdd4172b 100644 --- a/lib/librte_vhost/virtio_net.c +++ b/lib/librte_vhost/virtio_net.c @@ -399,7 +399,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, uint16_t used_idx; uint32_t i, sz; - LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) { RTE_LOG(ERR, VHOST_DATA, "(%d) %s: invalid virtqueue idx %d.\n", dev->vid, __func__, queue_id); @@ -431,7 +431,7 @@ virtio_dev_rx(struct virtio_net *dev, uint16_t queue_id, if (count == 0) goto out; - LOG_DEBUG(VHOST_DATA, "(%d) start_idx %d | end_idx %d\n", + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) start_idx %d | end_idx %d\n", dev->vid, start_idx, start_idx + count); vq->batch_copy_nb_elems = 0; @@ -675,7 +675,7 @@ copy_mbuf_to_desc_mergeable(struct virtio_net *dev, struct vhost_virtqueue *vq, hdr_phys_addr = desc_gaddr; rte_prefetch0((void *)(uintptr_t)hdr_addr); - LOG_DEBUG(VHOST_DATA, "(%d) RX: num merge buffers %d\n", + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) RX: num merge buffers %d\n", dev->vid, num_buffers); desc_avail = buf_vec[vec_idx].buf_len - dev->vhost_hlen; @@ -826,7 +826,7 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id, struct buf_vector buf_vec[BUF_VECTOR_MAX]; uint16_t avail_head; - LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); if (unlikely(!is_valid_virt_queue_idx(queue_id, 0, dev->nr_vring))) { RTE_LOG(ERR, VHOST_DATA, "(%d) %s: invalid virtqueue idx %d.\n", dev->vid, __func__, queue_id); @@ -863,14 +863,14 @@ virtio_dev_merge_rx(struct virtio_net *dev, uint16_t queue_id, if (unlikely(reserve_avail_buf_mergeable(dev, vq, pkt_len, buf_vec, &num_buffers, avail_head) < 0)) { - LOG_DEBUG(VHOST_DATA, + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) failed to get enough desc from vring\n", dev->vid); vq->shadow_used_idx -= num_buffers; break; } - LOG_DEBUG(VHOST_DATA, "(%d) current index %d | end index %d\n", + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) current index %d | end index %d\n", dev->vid, vq->last_avail_idx, vq->last_avail_idx + num_buffers); @@ -1506,7 +1506,7 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id, if (free_entries == 0) goto out; - LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) %s\n", dev->vid, __func__); /* Prefetch available and used ring */ avail_idx = vq->last_avail_idx & (vq->size - 1); @@ -1516,7 +1516,7 @@ rte_vhost_dequeue_burst(int vid, uint16_t queue_id, count = RTE_MIN(count, MAX_PKT_BURST); count = RTE_MIN(count, free_entries); - LOG_DEBUG(VHOST_DATA, "(%d) about to dequeue %u buffers\n", + VHOST_LOG_DEBUG(VHOST_DATA, "(%d) about to dequeue %u buffers\n", dev->vid, count); /* Retrieve all of the head indexes first to avoid caching issues. */ -- 2.14.2