From mboxrd@z Thu Jan 1 00:00:00 1970 From: Maxime Coquelin Subject: Re: [PATCH] vhost: fix remove macro name conflict Date: Wed, 21 Feb 2018 08:55:44 +0100 Message-ID: References: <20180209172408.14976-1-tomaszx.kulasek@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, huawei.xie@intel.com, stable@dpdk.org, Ben Walker To: Tomasz Kulasek , yliu@fridaylinux.org Return-path: In-Reply-To: <20180209172408.14976-1-tomaszx.kulasek@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 02/09/2018 06:24 PM, Tomasz Kulasek wrote: > 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") > Cc: huawei.xie@intel.com > Cc: stable@dpdk.org > > Signed-off-by: Ben Walker > Signed-off-by: Tomasz Kulasek > --- > lib/librte_vhost/vhost.h | 13 +++++++------ > lib/librte_vhost/vhost_user.c | 10 +++++----- > lib/librte_vhost/virtio_net.c | 16 ++++++++-------- > 3 files changed, 20 insertions(+), 19 deletions(-) > > diff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h > index d947bc9e3..319cc6620 100644 > --- a/lib/librte_vhost/vhost.h > +++ b/lib/librte_vhost/vhost.h > @@ -296,8 +296,9 @@ 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_LEVEL RTE_LOG_DEBUG > +#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_LEVEL RTE_LOG_INFO > +#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); Reviewed-by: Maxime Coquelin And applied to dpdk-next-virtio/master with removing > +#define VHOST_LOG_LEVEL RTE_LOG_DEBUG lines, as it conflicted with Jianfeng change that removed LOG_LEVEL. Thanks, Maxime