From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 3543C68FB for ; Mon, 20 Oct 2014 06:31:04 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 19 Oct 2014 21:39:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,749,1406617200"; d="scan'208";a="617018781" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga002.fm.intel.com with ESMTP; 19 Oct 2014 21:39:12 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id s9K4dAsP004263; Mon, 20 Oct 2014 12:39:10 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id s9K4d8J6028225; Mon, 20 Oct 2014 12:39:10 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id s9K4d8RF028221; Mon, 20 Oct 2014 12:39:08 +0800 From: Huawei Xie To: dev@dpdk.org Date: Mon, 20 Oct 2014 12:38:23 +0800 Message-Id: <1413779906-28113-12-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1413779906-28113-1-git-send-email-huawei.xie@intel.com> References: <1413779906-28113-1-git-send-email-huawei.xie@intel.com> Subject: [dpdk-dev] [PATCH 11/14] minor fixes 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: Mon, 20 Oct 2014 04:31:04 -0000 minimal adjustment Signed-off-by: Huawei Xie --- examples/vhost/main.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/examples/vhost/main.c b/examples/vhost/main.c index 15cb493..b2b92e9 100644 --- a/examples/vhost/main.c +++ b/examples/vhost/main.c @@ -49,10 +49,9 @@ #include #include #include +#include #include "main.h" -#include "virtio-net.h" -#include "vhost-net-cdev.h" #define MAX_QUEUES 128 @@ -100,7 +99,6 @@ #define TX_WTHRESH 0 /* Default values of TX write-back threshold reg. */ #define MAX_PKT_BURST 32 /* Max burst size for RX/TX */ -#define MAX_MRG_PKT_BURST 16 /* Max burst for merge buffers. Set to 1 due to performance issue. */ #define BURST_TX_DRAIN_US 100 /* TX drain every ~100us */ #define BURST_RX_WAIT_US 15 /* Defines how long we wait between retries on RX */ @@ -168,7 +166,7 @@ static uint32_t num_switching_cores = 0; /* number of devices/queues to support*/ static uint32_t num_queues = 0; -uint32_t num_devices = 0; +static uint32_t num_devices; /* * Enable zero copy, pkts buffer will directly dma to hw descriptor, @@ -985,7 +983,7 @@ unlink_vmdq(struct vhost_dev *vdev) * Check if the packet destination MAC address is for a local device. If so then put * the packet on that devices RX queue. If not then return. */ -static inline unsigned __attribute__((always_inline)) +static inline int __attribute__((always_inline)) virtio_tx_local(struct vhost_dev *vdev, struct rte_mbuf *m) { struct virtio_net_data_ll *dev_ll; @@ -2703,8 +2701,7 @@ new_device (struct virtio_net *dev) } } /* Add device to lcore ll */ - ll_dev->dev->coreid = core_add; - ll_dev = get_data_ll_free_entry(&lcore_info[ll_dev->dev->coreid].lcore_ll->ll_root_free); + ll_dev = get_data_ll_free_entry(&lcore_info[core_add].lcore_ll->ll_root_free); if (ll_dev == NULL) { RTE_LOG(INFO, VHOST_DATA, "(%"PRIu64") Failed to add device to data core\n", dev->device_fh); vdev->ready = DEVICE_SAFE_REMOVE; @@ -2717,7 +2714,7 @@ new_device (struct virtio_net *dev) ll_dev->vdev = vdev; vdev->coreid = core_add; - add_data_ll_entry(&lcore_info[ll_dev->dev->coreid].lcore_ll->ll_root_used, ll_dev); + add_data_ll_entry(&lcore_info[vdev->coreid].lcore_ll->ll_root_used, ll_dev); /* Initialize device stats */ memset(&dev_statistics[dev->device_fh], 0, sizeof(struct device_statistics)); -- 1.8.1.4