From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id CA9427EAB for ; Wed, 8 Oct 2014 20:48:35 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 08 Oct 2014 11:46:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,679,1406617200"; d="scan'208";a="602429637" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by fmsmga001.fm.intel.com with ESMTP; 08 Oct 2014 11:55:50 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id s98ItmYt020024; Thu, 9 Oct 2014 02:55:48 +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 s98ItkAs004399; Thu, 9 Oct 2014 02:55:48 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id s98Itkfc004395; Thu, 9 Oct 2014 02:55:46 +0800 From: Huawei Xie To: dev@dpdk.org Date: Thu, 9 Oct 2014 02:54:38 +0800 Message-Id: <1412794499-4332-5-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> References: <1412794499-4332-1-git-send-email-huawei.xie@intel.com> Subject: [dpdk-dev] [PATCH v6 04/25] lib/librte_vhost: remove mac learning, VMDQ, mac/vlan and other switching related logic 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: Wed, 08 Oct 2014 18:48:39 -0000 The following logics will be moved to vhost example. 1. mac learning, which is used to learn the mac address from the first transmitted packet of guest and bind the vhost device to a queue in a pool of VMDQ. 2. VMDQ mac/vlan filter: Each pool the vhost device is bind to is assigned a mac/vlan filter. 3. num_devices is used to specify the maximum vhost devices the nic supports. Signed-off-by: Huawei Xie --- lib/librte_vhost/rte_virtio_net.h | 6 ------ lib/librte_vhost/vhost_rxtx.c | 18 ------------------ lib/librte_vhost/virtio-net.c | 15 --------------- 3 files changed, 39 deletions(-) diff --git a/lib/librte_vhost/rte_virtio_net.h b/lib/librte_vhost/rte_virtio_net.h index 1a2f0dc..4d43f2c 100644 --- a/lib/librte_vhost/rte_virtio_net.h +++ b/lib/librte_vhost/rte_virtio_net.h @@ -83,15 +83,9 @@ struct virtio_net { struct vhost_virtqueue *virtqueue[VIRTIO_QNUM]; /* Contains all virtqueue information. */ struct virtio_memory *mem; /* QEMU memory and memory region information. */ - struct ether_addr mac_address; /* Device MAC address (Obtained on first TX packet). */ uint64_t features; /* Negotiated feature set. */ uint64_t device_fh; /* device identifier. */ - uint32_t vmdq_rx_q; /* RX VMDQ queue number. */ uint32_t flags; /* Device flags. Only used to check if device is running on data core. */ - uint32_t vlan_tag; /* Vlan tag for device. Currently set to device_id (0-63). */ - uint16_t coreid; /* Data core that the device is added to. */ - volatile uint8_t ready; /* A device is set as ready if the MAC address has been set. */ - volatile uint8_t remove; /* Device is marked for removal from the data core. */ } __rte_cache_aligned; /* diff --git a/lib/librte_vhost/vhost_rxtx.c b/lib/librte_vhost/vhost_rxtx.c index 8b5abb9..d553e71 100644 --- a/lib/librte_vhost/vhost_rxtx.c +++ b/lib/librte_vhost/vhost_rxtx.c @@ -735,24 +735,6 @@ virtio_dev_merge_tx(struct virtio_net *dev, struct rte_mempool *mbuf_pool) m->nb_segs = seg_num; - /* - * If this is the first received packet we need to learn - * the MAC and setup VMDQ - */ - if (dev->ready == DEVICE_MAC_LEARNING) { - if (dev->remove || (link_vmdq(dev, m) == -1)) { - /* - * Discard frame if device is scheduled for - * removal or a duplicate MAC address is found. - */ - entry_success = free_entries; - vq->last_used_idx += entry_success; - rte_pktmbuf_free(m); - break; - } - } - - virtio_tx_route(dev, m, mbuf_pool, (uint16_t)dev->device_fh); vq->last_used_idx++; entry_success++; rte_pktmbuf_free(m); diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index 5e659c7..4089584 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -55,9 +55,6 @@ const char eventfd_cdev[] = "/dev/eventfd-link"; -extern uint32_t num_devices; -static uint32_t num_cur_devices = 0; - /* device ops to add/remove device to data core. */ static struct virtio_net_device_ops const * notify_ops; /* Root address of the linked list in the configuration core. */ @@ -434,12 +431,6 @@ new_device(struct vhost_device_ctx ctx) struct virtio_net_config_ll *new_ll_dev; struct vhost_virtqueue *virtqueue_rx, *virtqueue_tx; - /*check the number of devices in the system*/ - if (num_cur_devices == num_devices) { - RTE_LOG(ERR, VHOST_CONFIG, "() Max num devices (%u) exceeded\n", num_devices); - return -1; - } - /* Setup device and virtqueues. */ new_ll_dev = malloc(sizeof(struct virtio_net_config_ll)); if (new_ll_dev == NULL) { @@ -473,9 +464,6 @@ new_device(struct vhost_device_ctx ctx) /* Add entry to device configuration linked list. */ add_config_ll_entry(new_ll_dev); - /*increment the number of devices in the system*/ - num_cur_devices++; - return new_ll_dev->dev.device_fh; } @@ -506,9 +494,6 @@ destroy_device(struct vhost_device_ctx ctx) ll_dev_cur = ll_dev_cur->next; } } - - /*decrement the number of devices in the system*/ - num_cur_devices--; } /* -- 1.8.1.4