From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 065138E7B for ; Fri, 16 Sep 2016 18:29:42 +0200 (CEST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP; 16 Sep 2016 09:29:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,345,1470726000"; d="scan'208";a="169526029" Received: from sivswdev02.ir.intel.com (HELO localhost.localdomain) ([10.237.217.46]) by fmsmga004.fm.intel.com with ESMTP; 16 Sep 2016 09:29:42 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Ferruh Yigit Date: Fri, 16 Sep 2016 17:26:49 +0100 Message-Id: <1474043212-15663-17-git-send-email-ferruh.yigit@intel.com> X-Mailer: git-send-email 1.7.0.7 In-Reply-To: <1473954405-7150-1-git-send-email-ferruh.yigit@intel.com> References: <1473954405-7150-1-git-send-email-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v2 16/19] kni: remove compile time debug configuration X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Sep 2016 16:29:43 -0000 Since switched to kernel dynamic debugging it is possible to remove compile time debug log configuration. Signed-off-by: Ferruh Yigit --- config/common_base | 3 --- lib/librte_eal/linuxapp/kni/kni_dev.h | 18 ------------- lib/librte_eal/linuxapp/kni/kni_misc.c | 8 +++--- lib/librte_eal/linuxapp/kni/kni_net.c | 8 +++--- lib/librte_eal/linuxapp/kni/kni_vhost.c | 46 ++++++++++++++++----------------- 5 files changed, 31 insertions(+), 52 deletions(-) diff --git a/config/common_base b/config/common_base index 7830535..4a9e5b0 100644 --- a/config/common_base +++ b/config/common_base @@ -533,12 +533,9 @@ CONFIG_RTE_PIPELINE_STATS_COLLECT=n CONFIG_RTE_LIBRTE_KNI=n CONFIG_RTE_KNI_KMOD=n CONFIG_RTE_KNI_PREEMPT_DEFAULT=y -CONFIG_RTE_KNI_KO_DEBUG=n CONFIG_RTE_KNI_VHOST=n CONFIG_RTE_KNI_VHOST_MAX_CACHE_SIZE=1024 CONFIG_RTE_KNI_VHOST_VNET_HDR_EN=n -CONFIG_RTE_KNI_VHOST_DEBUG_RX=n -CONFIG_RTE_KNI_VHOST_DEBUG_TX=n # # Compile the pdump library diff --git a/lib/librte_eal/linuxapp/kni/kni_dev.h b/lib/librte_eal/linuxapp/kni/kni_dev.h index 7e48203..fa9901d 100644 --- a/lib/librte_eal/linuxapp/kni/kni_dev.h +++ b/lib/librte_eal/linuxapp/kni/kni_dev.h @@ -112,12 +112,6 @@ struct kni_dev { #endif }; -#ifdef RTE_KNI_KO_DEBUG - #define KNI_DBG(args...) pr_debug(args) -#else - #define KNI_DBG(args...) -#endif - #ifdef RTE_KNI_VHOST unsigned int kni_poll(struct file *file, struct socket *sock, poll_table * wait); @@ -149,16 +143,4 @@ void ixgbe_kni_remove(struct pci_dev *pdev); int igb_kni_probe(struct pci_dev *pdev, struct net_device **lad_dev); void igb_kni_remove(struct pci_dev *pdev); -#ifdef RTE_KNI_VHOST_DEBUG_RX - #define KNI_DBG_RX(args...) pr_debug(args) -#else - #define KNI_DBG_RX(args...) -#endif - -#ifdef RTE_KNI_VHOST_DEBUG_TX - #define KNI_DBG_TX(args...) pr_debug(args) -#else - #define KNI_DBG_TX(args...) -#endif - #endif diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c index 235ce1a..17299da 100644 --- a/lib/librte_eal/linuxapp/kni/kni_misc.c +++ b/lib/librte_eal/linuxapp/kni/kni_misc.c @@ -379,7 +379,7 @@ kni_ioctl_create(struct net *net, pr_debug("mbuf_va: 0x%p\n", dev_info.mbuf_va); pr_debug("mbuf_size: %u\n", kni->mbuf_size); - KNI_DBG("PCI: %02x:%02x.%02x %04x:%04x\n", + pr_debug("PCI: %02x:%02x.%02x %04x:%04x\n", dev_info.bus, dev_info.devid, dev_info.function, @@ -407,7 +407,7 @@ kni_ioctl_create(struct net *net, else ret = -1; - KNI_DBG("PCI found: pci=0x%p, lad_dev=0x%p\n", + pr_debug("PCI found: pci=0x%p, lad_dev=0x%p\n", pci, lad_dev); if (ret == 0) { kni->lad_dev = lad_dev; @@ -527,7 +527,7 @@ kni_ioctl(struct inode *inode, int ret = -EINVAL; struct net *net = current->nsproxy->net_ns; - KNI_DBG("IOCTL num=0x%0x param=0x%0lx\n", ioctl_num, ioctl_param); + pr_debug("IOCTL num=0x%0x param=0x%0lx\n", ioctl_num, ioctl_param); /* * Switch according to the ioctl called @@ -543,7 +543,7 @@ kni_ioctl(struct inode *inode, ret = kni_ioctl_release(net, ioctl_num, ioctl_param); break; default: - KNI_DBG("IOCTL default\n"); + pr_debug("IOCTL default\n"); break; } diff --git a/lib/librte_eal/linuxapp/kni/kni_net.c b/lib/librte_eal/linuxapp/kni/kni_net.c index a732cbd..12dd89f 100644 --- a/lib/librte_eal/linuxapp/kni/kni_net.c +++ b/lib/librte_eal/linuxapp/kni/kni_net.c @@ -547,7 +547,7 @@ kni_net_tx_timeout(struct net_device *dev) { struct kni_dev *kni = netdev_priv(dev); - KNI_DBG("Transmit timeout at %ld, latency %ld\n", jiffies, + pr_debug("Transmit timeout at %ld, latency %ld\n", jiffies, jiffies - dev->trans_start); kni->stats.tx_errors++; @@ -560,7 +560,7 @@ kni_net_tx_timeout(struct net_device *dev) static int kni_net_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) { - KNI_DBG("kni_net_ioctl %d\n", + pr_debug("kni_net_ioctl %d\n", ((struct kni_dev *)netdev_priv(dev))->group_id); return 0; @@ -578,7 +578,7 @@ kni_net_change_mtu(struct net_device *dev, int new_mtu) struct rte_kni_request req; struct kni_dev *kni = netdev_priv(dev); - KNI_DBG("kni_net_change_mtu new mtu %d to be set\n", new_mtu); + pr_debug("kni_net_change_mtu new mtu %d to be set\n", new_mtu); memset(&req, 0, sizeof(req)); req.req_id = RTE_KNI_REQ_CHANGE_MTU; @@ -704,7 +704,7 @@ kni_net_init(struct net_device *dev) { struct kni_dev *kni = netdev_priv(dev); - KNI_DBG("kni_net_init\n"); + pr_debug("kni_net_init\n"); init_waitqueue_head(&kni->wq); mutex_init(&kni->sync_lock); diff --git a/lib/librte_eal/linuxapp/kni/kni_vhost.c b/lib/librte_eal/linuxapp/kni/kni_vhost.c index f4f6f10..947341e 100644 --- a/lib/librte_eal/linuxapp/kni/kni_vhost.c +++ b/lib/librte_eal/linuxapp/kni/kni_vhost.c @@ -75,7 +75,7 @@ kni_vhost_net_tx(struct kni_dev *kni, struct msghdr *m, struct rte_kni_mbuf *pkt_va = NULL; int ret; - KNI_DBG_TX("tx offset=%d, len=%d, iovlen=%d\n", + pr_debug("tx offset=%d, len=%d, iovlen=%d\n", #ifdef HAVE_IOV_ITER_MSGHDR offset, len, (int)m->msg_iter.iov->iov_len); #else @@ -177,7 +177,7 @@ kni_vhost_net_rx(struct kni_dev *kni, struct msghdr *m, if (unlikely(pkt_len > len)) goto drop; - KNI_DBG_RX("rx offset=%d, len=%d, pkt_len=%d, iovlen=%d\n", + pr_debug("rx offset=%d, len=%d, pkt_len=%d, iovlen=%d\n", #ifdef HAVE_IOV_ITER_MSGHDR offset, len, pkt_len, (int)m->msg_iter.iov->iov_len); #else @@ -202,7 +202,7 @@ kni_vhost_net_rx(struct kni_dev *kni, struct msghdr *m, /* Failing should not happen */ pr_err("Fail to enqueue entries into free_q\n"); - KNI_DBG_RX("receive done %d\n", pkt_len); + pr_debug("receive done %d\n", pkt_len); return pkt_len; @@ -226,10 +226,10 @@ kni_sock_poll(struct file *file, struct socket *sock, poll_table *wait) kni = q->kni; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - KNI_DBG("start kni_poll on group %d, wq 0x%16llx\n", + pr_debug("start kni_poll on group %d, wq 0x%16llx\n", kni->group_id, (uint64_t)sock->wq); #else - KNI_DBG("start kni_poll on group %d, wait at 0x%16llx\n", + pr_debug("start kni_poll on group %d, wait at 0x%16llx\n", kni->group_id, (uint64_t)&sock->wait); #endif @@ -332,7 +332,7 @@ kni_chk_vhost_rx(struct kni_dev *kni) ((nb_mbuf < RX_BURST_SZ) && (nb_mbuf != 0))) { wake_up_interruptible_poll(sk_sleep(&q->sk), POLLIN | POLLRDNORM | POLLRDBAND); - KNI_DBG_RX("RX CHK KICK nb_mbuf %d, nb_skb %d, nb_in %d\n", + pr_debug("RX CHK KICK nb_mbuf %d, nb_skb %d, nb_in %d\n", nb_mbuf, nb_skb, nb_in); } @@ -363,7 +363,7 @@ kni_sock_sndmsg(struct socket *sock, if (unlikely(q == NULL || q->kni == NULL)) return 0; - KNI_DBG_TX("kni_sndmsg len %ld, flags 0x%08x, nb_iov %d\n", + pr_debug("kni_sndmsg len %ld, flags 0x%08x, nb_iov %d\n", #ifdef HAVE_IOV_ITER_MSGHDR len, q->flags, (int)m->msg_iter.iov->iov_len); #else @@ -431,7 +431,7 @@ kni_sock_rcvmsg(struct socket *sock, #endif /* HAVE_IOV_ITER_MSGHDR */ return -EFAULT; #endif /* RTE_KNI_VHOST_VNET_HDR_EN */ - KNI_DBG_RX("kni_rcvmsg expect_len %ld, flags 0x%08x, pkt_len %d\n", + pr_debug("kni_rcvmsg expect_len %ld, flags 0x%08x, pkt_len %d\n", (unsigned long)len, q->flags, pkt_len); return pkt_len + vnet_hdr_len; @@ -453,11 +453,11 @@ kni_sock_ioctl(struct socket *sock, unsigned int cmd, int s; int ret; - KNI_DBG("tap ioctl cmd 0x%08x\n", cmd); + pr_debug("tap ioctl cmd 0x%08x\n", cmd); switch (cmd) { case TUNSETIFF: - KNI_DBG("TUNSETIFF\n"); + pr_debug("TUNSETIFF\n"); /* ignore the name, just look at flags */ if (get_user(u, &ifr->ifr_flags)) return -EFAULT; @@ -471,7 +471,7 @@ kni_sock_ioctl(struct socket *sock, unsigned int cmd, return ret; case TUNGETIFF: - KNI_DBG("TUNGETIFF\n"); + pr_debug("TUNGETIFF\n"); rcu_read_lock_bh(); kni = rcu_dereference_bh(q->kni); if (kni) @@ -489,7 +489,7 @@ kni_sock_ioctl(struct socket *sock, unsigned int cmd, return ret; case TUNGETFEATURES: - KNI_DBG("TUNGETFEATURES\n"); + pr_debug("TUNGETFEATURES\n"); u = IFF_TAP | IFF_NO_PI; #ifdef RTE_KNI_VHOST_VNET_HDR_EN u |= IFF_VNET_HDR; @@ -499,7 +499,7 @@ kni_sock_ioctl(struct socket *sock, unsigned int cmd, return 0; case TUNSETSNDBUF: - KNI_DBG("TUNSETSNDBUF\n"); + pr_debug("TUNSETSNDBUF\n"); if (get_user(u, up)) return -EFAULT; @@ -510,7 +510,7 @@ kni_sock_ioctl(struct socket *sock, unsigned int cmd, s = q->vnet_hdr_sz; if (put_user(s, sp)) return -EFAULT; - KNI_DBG("TUNGETVNETHDRSZ %d\n", s); + pr_debug("TUNGETVNETHDRSZ %d\n", s); return 0; case TUNSETVNETHDRSZ: @@ -519,12 +519,12 @@ kni_sock_ioctl(struct socket *sock, unsigned int cmd, if (s < (int)sizeof(struct virtio_net_hdr)) return -EINVAL; - KNI_DBG("TUNSETVNETHDRSZ %d\n", s); + pr_debug("TUNSETVNETHDRSZ %d\n", s); q->vnet_hdr_sz = s; return 0; case TUNSETOFFLOAD: - KNI_DBG("TUNSETOFFLOAD %lx\n", arg); + pr_debug("TUNSETOFFLOAD %lx\n", arg); #ifdef RTE_KNI_VHOST_VNET_HDR_EN /* not support any offload yet */ if (!(q->flags & IFF_VNET_HDR)) @@ -536,7 +536,7 @@ kni_sock_ioctl(struct socket *sock, unsigned int cmd, #endif default: - KNI_DBG("NOT SUPPORT\n"); + pr_debug("NOT SUPPORT\n"); return -EINVAL; } } @@ -584,7 +584,7 @@ kni_sock_release(struct socket *sock) sock_put(&q->sk); - KNI_DBG("dummy sock release done\n"); + pr_debug("dummy sock release done\n"); return 0; } @@ -593,7 +593,7 @@ int kni_sock_getname(struct socket *sock, struct sockaddr *addr, int *sockaddr_len, int peer) { - KNI_DBG("dummy sock getname\n"); + pr_debug("dummy sock getname\n"); ((struct sockaddr_ll *)addr)->sll_family = AF_PACKET; return 0; } @@ -731,11 +731,11 @@ kni_vhost_backend_init(struct kni_dev *kni) kni->vq_status = BE_START; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35) - KNI_DBG("backend init sockfd=%d, sock->wq=0x%16llx,sk->sk_wq=0x%16llx", + pr_debug("backend init sockfd=%d, sock->wq=0x%16llx,sk->sk_wq=0x%16llx", q->sockfd, (uint64_t)q->sock->wq, (uint64_t)q->sk.sk_wq); #else - KNI_DBG("backend init sockfd=%d, sock->wait at 0x%16llx,sk->sk_sleep=0x%16llx", + pr_debug("backend init sockfd=%d, sock->wait at 0x%16llx,sk->sk_sleep=0x%16llx", q->sockfd, (uint64_t)&q->sock->wait, (uint64_t)q->sk.sk_sleep); #endif @@ -828,7 +828,7 @@ kni_vhost_backend_release(struct kni_dev *kni) /* dettach from kni */ q->kni = NULL; - KNI_DBG("release backend done\n"); + pr_debug("release backend done\n"); return 0; } @@ -843,7 +843,7 @@ kni_vhost_init(struct kni_dev *kni) kni->vq_status = BE_STOP; - KNI_DBG("kni_vhost_init done\n"); + pr_debug("kni_vhost_init done\n"); return 0; } -- 2.7.4