Loading include/spdk/env.h +3 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ extern "C" { #include <stdint.h> #include <stdio.h> #define SPDK_ENV_SOCKET_ID_ANY (-1) struct spdk_pci_device; /** Loading Loading @@ -78,7 +80,7 @@ void spdk_free(void *buf); * socket_id and flags. * Return a pointer to the allocated memory address. If the allocation * cannot be done, return NULL. * Note: to pick any socket id, just set socket_id to -1. * Note: to pick any socket id, just set socket_id to SPDK_ENV_SOCKET_ID_ANY. */ void *spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags); Loading lib/env_dpdk/env.c +7 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,13 @@ spdk_free(void *buf) void * spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags) { const struct rte_memzone *mz = rte_memzone_reserve(name, len, socket_id, flags); const struct rte_memzone *mz; if (socket_id == SPDK_ENV_SOCKET_ID_ANY) { socket_id = SOCKET_ID_ANY; } mz = rte_memzone_reserve(name, len, socket_id, flags); if (mz != NULL) { memset(mz->addr, 0, len); Loading Loading
include/spdk/env.h +3 −1 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ extern "C" { #include <stdint.h> #include <stdio.h> #define SPDK_ENV_SOCKET_ID_ANY (-1) struct spdk_pci_device; /** Loading Loading @@ -78,7 +80,7 @@ void spdk_free(void *buf); * socket_id and flags. * Return a pointer to the allocated memory address. If the allocation * cannot be done, return NULL. * Note: to pick any socket id, just set socket_id to -1. * Note: to pick any socket id, just set socket_id to SPDK_ENV_SOCKET_ID_ANY. */ void *spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags); Loading
lib/env_dpdk/env.c +7 −1 Original line number Diff line number Diff line Loading @@ -82,7 +82,13 @@ spdk_free(void *buf) void * spdk_memzone_reserve(const char *name, size_t len, int socket_id, unsigned flags) { const struct rte_memzone *mz = rte_memzone_reserve(name, len, socket_id, flags); const struct rte_memzone *mz; if (socket_id == SPDK_ENV_SOCKET_ID_ANY) { socket_id = SOCKET_ID_ANY; } mz = rte_memzone_reserve(name, len, socket_id, flags); if (mz != NULL) { memset(mz->addr, 0, len); Loading