nvmf: switch to rte_mempool_avail_count()
Replace use of the newly-deprecated rte_mempool_count() with the new name, rte_mempool_avail_count(). Also add a compatibility wrapper so that builds against older DPDK versions still work. Change-Id: If3c44bdef4bbcf7a456a1dfa272348ccc6f35261 Reported-by: Jay Sternberg <jay.e.sternberg@intel.com> Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
20c11032ae
commit
ffa936d94b
@ -35,6 +35,7 @@
|
||||
|
||||
#include <rte_config.h>
|
||||
#include <rte_mempool.h>
|
||||
#include <rte_version.h>
|
||||
|
||||
#include "spdk/log.h"
|
||||
#include "spdk/conf.h"
|
||||
@ -79,11 +80,22 @@ spdk_nvmf_initialize_pools(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Wrapper to provide rte_mempool_avail_count() on older DPDK versions.
|
||||
* Drop this if the minimum DPDK version is raised to at least 16.07.
|
||||
*/
|
||||
#if RTE_VERSION < RTE_VERSION_NUM(16, 7, 0, 1)
|
||||
static unsigned rte_mempool_avail_count(const struct rte_mempool *pool)
|
||||
{
|
||||
return rte_mempool_count(pool);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int spdk_nvmf_check_pool(struct rte_mempool *pool, uint32_t count)
|
||||
{
|
||||
if (rte_mempool_count(pool) != count) {
|
||||
SPDK_ERRLOG("rte_mempool_count(%s) == %d, should be %d\n",
|
||||
pool->name, rte_mempool_count(pool), count);
|
||||
if (rte_mempool_avail_count(pool) != count) {
|
||||
SPDK_ERRLOG("rte_mempool_avail_count(%s) == %d, should be %d\n",
|
||||
pool->name, rte_mempool_avail_count(pool), count);
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user