diff options
-rw-r--r-- | dpdk/Makefile | 3 | ||||
-rw-r--r-- | dpdk/dpdk-16.07_patches/0001-i40e-Add-packet_type-metadata-in-the-i40e-vPMD.patch (renamed from dpdk/dpdk-16.07-rc3_patches/0001-i40e-Add-packet_type-metadata-in-the-i40e-vPMD.patch) | 0 | ||||
-rw-r--r-- | dpdk/dpdk-16.07_patches/0002-i40e-Enable-bad-checksum-flags-in-i40e-vPMD.patch (renamed from dpdk/dpdk-16.07-rc3_patches/0002-i40e-Enable-bad-checksum-flags-in-i40e-vPMD.patch) | 0 | ||||
-rw-r--r-- | vlib/vlib/dpdk_buffer.c | 78 | ||||
-rw-r--r-- | vpp/vpp-api/api.c | 4 |
5 files changed, 76 insertions, 9 deletions
diff --git a/dpdk/Makefile b/dpdk/Makefile index 576b1ee6..d73ddb62 100644 --- a/dpdk/Makefile +++ b/dpdk/Makefile @@ -24,11 +24,10 @@ DPDK_DEBUG ?= n B := $(DPDK_BUILD_DIR) I := $(DPDK_INSTALL_DIR) -DPDK_VERSION ?= 16.04 +DPDK_VERSION ?= 16.07 DPDK_BASE_URL ?= http://fast.dpdk.org/rel DPDK_TARBALL := dpdk-$(DPDK_VERSION).tar.xz DPDK_TAR_URL := $(DPDK_BASE_URL)/$(DPDK_TARBALL) -DPDK_2.2.0_TARBALL_MD5_CKSUM := bfa10283b49d56264c82519d130458cc DPDK_16.04_TARBALL_MD5_CKSUM := d1f82e7d7589b3b2f623c155442b8306 DPDK_16.07_TARBALL_MD5_CKSUM := 690a2bb570103e58d12f9806e8bf21be DPDK_SOURCE := $(B)/dpdk-$(DPDK_VERSION) diff --git a/dpdk/dpdk-16.07-rc3_patches/0001-i40e-Add-packet_type-metadata-in-the-i40e-vPMD.patch b/dpdk/dpdk-16.07_patches/0001-i40e-Add-packet_type-metadata-in-the-i40e-vPMD.patch index 74d9416e..74d9416e 100644 --- a/dpdk/dpdk-16.07-rc3_patches/0001-i40e-Add-packet_type-metadata-in-the-i40e-vPMD.patch +++ b/dpdk/dpdk-16.07_patches/0001-i40e-Add-packet_type-metadata-in-the-i40e-vPMD.patch diff --git a/dpdk/dpdk-16.07-rc3_patches/0002-i40e-Enable-bad-checksum-flags-in-i40e-vPMD.patch b/dpdk/dpdk-16.07_patches/0002-i40e-Enable-bad-checksum-flags-in-i40e-vPMD.patch index 58256f19..58256f19 100644 --- a/dpdk/dpdk-16.07-rc3_patches/0002-i40e-Enable-bad-checksum-flags-in-i40e-vPMD.patch +++ b/dpdk/dpdk-16.07_patches/0002-i40e-Enable-bad-checksum-flags-in-i40e-vPMD.patch diff --git a/vlib/vlib/dpdk_buffer.c b/vlib/vlib/dpdk_buffer.c index 84bca0f5..337fca9a 100644 --- a/vlib/vlib/dpdk_buffer.c +++ b/vlib/vlib/dpdk_buffer.c @@ -964,7 +964,9 @@ vlib_buffer_pool_create (vlib_main_t * vm, unsigned num_mbufs, vlib_buffer_main_t *bm = vm->buffer_main; vlib_physmem_main_t *vpm = &vm->physmem_main; struct rte_mempool *rmp; +#if RTE_VERSION < RTE_VERSION_NUM(16, 7, 0, 0) uword new_start, new_size; +#endif int i; if (!rte_pktmbuf_pool_create) @@ -985,16 +987,78 @@ vlib_buffer_pool_create (vlib_main_t * vm, unsigned num_mbufs, VLIB_BUFFER_PRE_DATA_SIZE + VLIB_BUFFER_DATA_SIZE, /* dataroom size */ socket_id); /* cpu socket */ - vec_free (pool_name); - if (rmp) { - new_start = pointer_to_uword (rmp); #if RTE_VERSION >= RTE_VERSION_NUM(16, 7, 0, 0) - new_size = (uintptr_t)STAILQ_FIRST(&rmp->mem_list)->addr + STAILQ_FIRST(&rmp->mem_list)->len - new_start; + { + uword this_pool_end; + uword this_pool_start; + uword this_pool_size; + uword save_vpm_start, save_vpm_end, save_vpm_size; + struct rte_mempool_memhdr *memhdr; + + this_pool_start = ~0ULL; + this_pool_end = 0LL; + + STAILQ_FOREACH (memhdr, &rmp->mem_list, next) + { + if (((uword)(memhdr->addr + memhdr->len)) > this_pool_end) + this_pool_end = (uword)(memhdr->addr + memhdr->len); + if (((uword)memhdr->addr) < this_pool_start) + this_pool_start = (uword)(memhdr->addr); + } + ASSERT (this_pool_start < ~0ULL && this_pool_end > 0); + this_pool_size = this_pool_end - this_pool_start; + + if (CLIB_DEBUG > 1) + { + clib_warning ("%s: pool start %llx pool end %llx pool size %lld", + pool_name, this_pool_start, this_pool_end, + this_pool_size); + clib_warning + ("before: virtual.start %llx virtual.end %llx virtual.size %lld", + vpm->virtual.start, vpm->virtual.end, vpm->virtual.size); + } + + save_vpm_start = vpm->virtual.start; + save_vpm_end = vpm->virtual.end; + save_vpm_size = vpm->virtual.size; + + if ((this_pool_start < vpm->virtual.start) || vpm->virtual.start == 0) + vpm->virtual.start = this_pool_start; + if (this_pool_end > vpm->virtual.end) + vpm->virtual.end = this_pool_end; + + vpm->virtual.size = vpm->virtual.end - vpm->virtual.start; + + if (CLIB_DEBUG > 1) + { + clib_warning + ("after: virtual.start %llx virtual.end %llx virtual.size %lld", + vpm->virtual.start, vpm->virtual.end, vpm->virtual.size); + } + + /* check if fits into buffer index range */ + if ((u64) vpm->virtual.size > + ((u64) 1 << (32 + CLIB_LOG2_CACHE_LINE_BYTES))) + { + clib_warning ("physmem: virtual size out of range!"); + vpm->virtual.start = save_vpm_start; + vpm->virtual.end = save_vpm_end; + vpm->virtual.size = save_vpm_size; + rmp = 0; + } + } + if (rmp) + { + bm->pktmbuf_pools[socket_id] = rmp; + vec_free(pool_name); + return 0; + } + } #else + new_start = pointer_to_uword (rmp); new_size = rmp->elt_va_end - new_start; -#endif if (vpm->virtual.size > 0) { @@ -1021,8 +1085,12 @@ vlib_buffer_pool_create (vlib_main_t * vm, unsigned num_mbufs, vpm->virtual.start = new_start; vpm->virtual.size = new_size; vpm->virtual.end = new_start + new_size; + vec_free(pool_name); return 0; } +#endif + + vec_free (pool_name); /* no usable pool for this socket, try to use pool from another one */ for (i = 0; i < vec_len (bm->pktmbuf_pools); i++) diff --git a/vpp/vpp-api/api.c b/vpp/vpp-api/api.c index 2f076c0b..73ecbd72 100644 --- a/vpp/vpp-api/api.c +++ b/vpp/vpp-api/api.c @@ -3814,13 +3814,13 @@ vl_api_create_vhost_user_if_t_handler (vl_api_create_vhost_user_if_t *mp) { int rv = 0; vl_api_create_vhost_user_if_reply_t * rmp; -#if DPDK > 0 && DPDK_VHOST_USER +#if DPDK > 0 u32 sw_if_index = (u32)~0; vnet_main_t * vnm = vnet_get_main(); vlib_main_t * vm = vlib_get_main(); - rv = dpdk_vhost_user_create_if(vnm, vm, (char *)mp->sock_filename, + rv = vhost_user_create_if(vnm, vm, (char *)mp->sock_filename, mp->is_server, &sw_if_index, (u64)~0, mp->renumber, ntohl(mp->custom_dev_instance), (mp->use_custom_mac)?mp->mac_address:NULL); |