This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "".
The branch, master has been updated via 82419a31e6d1846e0676edfa7fb511a23098f5a9 (commit) via c0aeacf23dddfb7feae47fef6e4d10d6bdb9c812 (commit) from dd0498bb104c7319e2ec56b61e4d585167ea6c53 (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit 82419a31e6d1846e0676edfa7fb511a23098f5a9 Author: Matias Elo matias.elo@nokia.com Date: Wed Oct 18 14:00:23 2017 +0300
linux-gen: dpdk: bump target dpdk version to 17.08
Changes: - Function rte_set_log_level() is now deprecated. Replace it with rte_log_set_global_level(). - New dependency added to libnuma. - Pcap-based virtual devices are renamed to net_pcap. - DPDK pktio devices cannot be restarted after calling rte_eth_dev_close(). Move rte_eth_dev_close() calls to global terminate from odp_pktio_close().
Signed-off-by: Matias Elo matias.elo@nokia.com Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/.travis.yml b/.travis.yml index d8da542c..2d397171 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,6 +41,7 @@ addons: - clang-3.8 - automake autoconf libtool libssl-dev graphviz mscgen - libpcap-dev + - libnuma-dev # coverity_scan: # project: # name: "$TRAVIS_REPO_SLUG" @@ -150,7 +151,7 @@ install: - gem install asciidoctor
# DPDK pktio. Note that cache must be purged if dpdk version changes. - - DPDK_VERS="17.02" + - DPDK_VERS="17.08" - | CACHED_DPDK_VERS=`fgrep Version dpdk/pkg/dpdk.spec | cut -d " " -f 2` if [ "${CACHED_DPDK_VERS}" != "${DPDK_VERS}" ]; then diff --git a/DEPENDENCIES b/DEPENDENCIES index e309b339..68c7b8be 100644 --- a/DEPENDENCIES +++ b/DEPENDENCIES @@ -160,13 +160,17 @@ Prerequisites for building the OpenDataPlane (ODP) API
Use DPDK for ODP packet I/O.
+ DPDK pktio adds a depency to NUMA library. + # Debian/Ubuntu + $ sudo apt-get install libnuma-dev + Note: only packet I/O is accelerated with DPDK. Use https://git.linaro.org/lng/odp-dpdk.git for fully accelerated odp dpdk platform.
3.4.1 Building DPDK and ODP with DPDK pktio support
- DPDK packet I/O has been tested to work with DPDK v17.02. + DPDK packet I/O has been tested to work with DPDK v17.08.
Follow steps in ./scripts/build-pktio-dpdk
diff --git a/platform/linux-generic/m4/odp_dpdk.m4 b/platform/linux-generic/m4/odp_dpdk.m4 index 9d90bbab..1e8fa2de 100644 --- a/platform/linux-generic/m4/odp_dpdk.m4 +++ b/platform/linux-generic/m4/odp_dpdk.m4 @@ -52,7 +52,7 @@ then AC_DEFINE_UNQUOTED([ODP_DPDK_ZERO_COPY], [$zero_copy], [Define to 1 to enable DPDK zero copy support])
- DPDK_LIBS="-L$DPDK_PATH/lib -ldpdk -lpthread -ldl -lpcap -lm" + DPDK_LIBS="-L$DPDK_PATH/lib -ldpdk -lpthread -ldl -lpcap -lm -lnuma" AC_SUBST([DPDK_CPPFLAGS]) AC_SUBST([DPDK_LIBS]) AC_SUBST([DPDK_PMDS]) diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 931cc711..de9295c4 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -924,12 +924,6 @@ static int dpdk_close(pktio_entry_t *pktio_entry) rte_pktmbuf_free(pkt_dpdk->rx_cache[i].s.pkt[idx++]); }
- if (pktio_entry->s.state != PKTIO_STATE_OPENED) - rte_eth_dev_close(pkt_dpdk->port_id); - - if (!ODP_DPDK_ZERO_COPY) - rte_mempool_free(pkt_dpdk->pkt_pool); - return 0; }
@@ -1016,7 +1010,7 @@ static int dpdk_pktio_init(void) } ODP_DBG("rte_eal_init OK\n");
- rte_set_log_level(RTE_LOG_WARNING); + rte_log_set_global_level(RTE_LOG_WARNING);
i = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &original_cpuset); @@ -1059,6 +1053,28 @@ static int dpdk_pktio_init_local(void) return 0; }
+static void dpdk_mempool_free(struct rte_mempool *mp, void *arg ODP_UNUSED) +{ + rte_mempool_free(mp); +} + +static int dpdk_pktio_term(void) +{ + uint8_t port_id; + + if (!dpdk_initialized) + return 0; + + RTE_ETH_FOREACH_DEV(port_id) { + rte_eth_dev_close(port_id); + } + + if (!ODP_DPDK_ZERO_COPY) + rte_mempool_walk(dpdk_mempool_free, NULL); + + return 0; +} + static int dpdk_input_queues_config(pktio_entry_t *pktio_entry, const odp_pktin_queue_param_t *p) { @@ -1244,11 +1260,17 @@ static int dpdk_open(odp_pktio_t id ODP_UNUSED, pkt_pool = pool_create(pool_entry); } else { snprintf(pool_name, sizeof(pool_name), "pktpool_%s", netdev); - pkt_pool = rte_pktmbuf_pool_create(pool_name, - DPDK_NB_MBUF, - DPDK_MEMPOOL_CACHE_SIZE, 0, - DPDK_MBUF_BUF_SIZE, - rte_socket_id()); + /* Check if the pool exists already */ + pkt_pool = rte_mempool_lookup(pool_name); + if (pkt_pool == NULL) { + unsigned cache_size = DPDK_MEMPOOL_CACHE_SIZE; + + pkt_pool = rte_pktmbuf_pool_create(pool_name, + DPDK_NB_MBUF, + cache_size, 0, + DPDK_MBUF_BUF_SIZE, + rte_socket_id()); + } } if (pkt_pool == NULL) { ODP_ERR("Cannot init mbuf packet pool\n"); @@ -1557,7 +1579,7 @@ const pktio_if_ops_t dpdk_pktio_ops = { .name = "dpdk", .init_global = dpdk_pktio_init_global, .init_local = dpdk_pktio_init_local, - .term = NULL, + .term = dpdk_pktio_term, .open = dpdk_open, .close = dpdk_close, .start = dpdk_start, diff --git a/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh b/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh index 14759142..24194cbc 100755 --- a/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh +++ b/platform/linux-generic/test/validation/api/pktio/pktio_run_dpdk.sh @@ -74,7 +74,7 @@ run()
if [ "$ODP_PKTIO_IF0" = "" ]; then setup_pktio_env clean - export ODP_PKTIO_DPDK_PARAMS="--no-pci --vdev eth_pcap0,iface=$IF0 --vdev eth_pcap1,iface=$IF1" + export ODP_PKTIO_DPDK_PARAMS="--no-pci --vdev net_pcap0,iface=$IF0 --vdev net_pcap1,iface=$IF1" export ODP_PKTIO_IF0=0 export ODP_PKTIO_IF1=1 fi diff --git a/scripts/build-pktio-dpdk b/scripts/build-pktio-dpdk index 6c6830ac..97916c1e 100755 --- a/scripts/build-pktio-dpdk +++ b/scripts/build-pktio-dpdk @@ -10,7 +10,13 @@ if [ "$?" != "0" ]; then echo "Error: pcap is not installed. You may need to install libpcap-dev" fi
-git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v17.02 http://dpdk.org/git/dpdk dpdk +echo '#include "numa.h"' | cpp -H -o /dev/null 2>&1 +if [ "$?" != "0" ]; then + echo "Error: NUMA library is not installed. You need to install libnuma-dev" + exit 1 +fi + +git -c advice.detachedHead=false clone -q --depth=1 --single-branch --branch=v17.08 http://dpdk.org/git/dpdk dpdk pushd dpdk git log --oneline --decorate
commit c0aeacf23dddfb7feae47fef6e4d10d6bdb9c812 Author: Matias Elo matias.elo@nokia.com Date: Fri Oct 20 15:44:55 2017 +0300
linux-gen: dpdk: create missing dpdk mempools in zero-copy mode
In zero-copy dpdk pktio mode a matching dpdk mempool is required for each odp packet pool from which packets are sent using dpdk pktio. This is required for all packet pools, even for those which are not passed directly to pktio devices as odp_pktio_open() parameters.
Signed-off-by: Matias Elo matias.elo@nokia.com Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org
diff --git a/platform/linux-generic/pktio/dpdk.c b/platform/linux-generic/pktio/dpdk.c index 2e50a55f..931cc711 100644 --- a/platform/linux-generic/pktio/dpdk.c +++ b/platform/linux-generic/pktio/dpdk.c @@ -296,6 +296,36 @@ static void pool_destroy(void *pool) rte_mempool_free(mp); }
+static struct rte_mempool *pool_create(pool_t *pool) +{ + struct rte_mempool *pkt_pool; + char pool_name[RTE_MEMPOOL_NAMESIZE]; + + odp_ticketlock_lock(&pool->lock); + + if (pool->ext_desc != NULL) { + odp_ticketlock_unlock(&pool->lock); + return (struct rte_mempool *)pool->ext_desc; + } + + snprintf(pool_name, sizeof(pool_name), + "dpdk_pktpool_%" PRIu32 "", pool->pool_idx); + pkt_pool = mbuf_pool_create(pool_name, pool); + + if (pkt_pool == NULL) { + odp_ticketlock_unlock(&pool->lock); + ODP_ERR("Creating external DPDK pool failed\n"); + return NULL; + } + + pool->ext_desc = pkt_pool; + pool->ext_destroy = pool_destroy; + + odp_ticketlock_unlock(&pool->lock); + + return pkt_pool; +} + static struct rte_mempool_ops ops_stack = { .name = "odp_pool", .alloc = pool_alloc, @@ -672,6 +702,11 @@ static inline int pkt_to_mbuf_zero(pktio_entry_t *pktio_entry, } else { pool_t *pool_entry = pkt_hdr->buf_hdr.pool_ptr;
+ if (odp_unlikely(pool_entry->ext_desc == NULL)) { + if (pool_create(pool_entry) == NULL) + ODP_ABORT("Creating DPDK pool failed"); + } + if (pkt_hdr->buf_hdr.segcount != 1 || !pool_entry->mem_from_huge_pages) { /* Fall back to packet copy */ @@ -681,8 +716,8 @@ static inline int pkt_to_mbuf_zero(pktio_entry_t *pktio_entry, (*copy_count)++;
} else { - mbuf_init(pkt_dpdk->pkt_pool, mbuf, - pkt_hdr); + mbuf_init((struct rte_mempool *) + pool_entry->ext_desc, mbuf, pkt_hdr); mbuf_update(mbuf, pkt_hdr, pkt_len); if (pktout_cfg->all_bits) pkt_set_ol_tx(pktout_cfg, pkt_hdr, @@ -1203,16 +1238,10 @@ static int dpdk_open(odp_pktio_t id ODP_UNUSED, else pkt_dpdk->min_rx_burst = 0; if (ODP_DPDK_ZERO_COPY) { - if (pool_entry->ext_desc != NULL) { + if (pool_entry->ext_desc != NULL) pkt_pool = (struct rte_mempool *)pool_entry->ext_desc; - } else { - snprintf(pool_name, sizeof(pool_name), - "pktpool_%" PRIu32 "", pool_entry->pool_idx); - pkt_pool = mbuf_pool_create(pool_name, - pool_entry); - pool_entry->ext_destroy = pool_destroy; - pool_entry->ext_desc = pkt_pool; - } + else + pkt_pool = pool_create(pool_entry); } else { snprintf(pool_name, sizeof(pool_name), "pktpool_%s", netdev); pkt_pool = rte_pktmbuf_pool_create(pool_name,
-----------------------------------------------------------------------
Summary of changes: .travis.yml | 3 +- DEPENDENCIES | 6 +- platform/linux-generic/m4/odp_dpdk.m4 | 2 +- platform/linux-generic/pktio/dpdk.c | 99 ++++++++++++++++------ .../test/validation/api/pktio/pktio_run_dpdk.sh | 2 +- scripts/build-pktio-dpdk | 8 +- 6 files changed, 91 insertions(+), 29 deletions(-)
hooks/post-receive