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 d189d704a29f490583057ccb5c762432a4e4b7a7 (commit) from 122b74c0074329f1758b2ed5d241e0e9a790087b (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 d189d704a29f490583057ccb5c762432a4e4b7a7 Author: Maxim Uvarov maxim.uvarov@linaro.org Date: Fri May 4 12:33:26 2018 +0300
linux-gen: pktio: ipc free ring memory on error
ipc pktio can fail on open if second process is not yet ready to connect. But on this error free of ring memory is missing which leads to taking all available shm descriptors. https://bugs.linaro.org/show_bug.cgi?id=3788
Signed-off-by: Maxim Uvarov maxim.uvarov@linaro.org Reviewed-by: Bill Fischofer bill.fischofer@linaro.org
diff --git a/platform/linux-generic/pktio/ipc.c b/platform/linux-generic/pktio/ipc.c index 08e3e4bc..d1e30ab8 100644 --- a/platform/linux-generic/pktio/ipc.c +++ b/platform/linux-generic/pktio/ipc.c @@ -347,6 +347,8 @@ static int ipc_pktio_open(odp_pktio_t id ODP_UNUSED, pktio_entry->s.ipc.rx.cache = _ring_create("ipc_rx_cache", PKTIO_IPC_ENTRIES, _RING_NO_LIST); + if (!pktio_entry->s.ipc.rx.cache) + return -1;
/* Shared info about remote pktio */ if (sscanf(dev, "ipc:%d:%s", &pid, tail) == 2) { @@ -355,12 +357,15 @@ static int ipc_pktio_open(odp_pktio_t id ODP_UNUSED, snprintf(name, sizeof(name), "ipc:%s_info", tail); IPC_ODP_DBG("lookup for name %s for pid %d\n", name, pid); shm = odp_shm_import(name, pid, name); - if (ODP_SHM_INVALID == shm) + if (ODP_SHM_INVALID == shm) { + _ring_destroy("ipc_rx_cache"); return -1; + } pinfo = odp_shm_addr(shm);
if (!pinfo->master.init_done) { odp_shm_free(shm); + _ring_destroy("ipc_rx_cache"); return -1; } pktio_entry->s.ipc.pinfo = pinfo; @@ -374,6 +379,7 @@ static int ipc_pktio_open(odp_pktio_t id ODP_UNUSED, ODP_CACHE_LINE_SIZE, _ODP_ISHM_EXPORT | _ODP_ISHM_LOCK); if (ODP_SHM_INVALID == shm) { + _ring_destroy("ipc_rx_cache"); ODP_ERR("can not create shm %s\n", name); return -1; }
-----------------------------------------------------------------------
Summary of changes: platform/linux-generic/pktio/ipc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
hooks/post-receive