mbox series

[v6,0/1] fbarray: fix duplicated fbarray file in secondary

Message ID 20191101090413.17997-1-yasufum.o@gmail.com (mailing list archive)
Headers
Series fbarray: fix duplicated fbarray file in secondary |

Message

Yasufumi Ogawa Nov. 1, 2019, 9:04 a.m. UTC
  From: Yasufumi Ogawa <yasufum.o@gmail.com>

In secondary_msl_create_walk(), it creates a file for fbarrays with its
PID for reserving unique name among secondary processes. However, it
does not work if several secondaries run as app containers because each
of containerized secondary has PID 1, and failed to reserve unique name
other than first one. To reserve unique name in each of containers, use
hostname in addition to PID.

---
v2:
  * fix typo in commit message
v3:
  * add fclose() after if getting hostname with fscan() is failed
v4:
  * Increase the size of proc_id to 33 and add boundary in calling
    fscan()
v5:
  * revise title to reflect the issue
  * use gethostname() instead of getting from `etc/hostname`
  * use HOST_NAME_MAX for size of string for hostname
v6:
  * change to use hostname and pid to cover both of host and container
    cases
  * change RTE_FBARRAY_NAME_LEN to NAME_MAX to reserve enough size for
    filename
---

Yasufumi Ogawa (1):
  fbarray: fix duplicated fbarray file in secondary

 lib/librte_eal/common/include/rte_fbarray.h |  2 +-
 lib/librte_eal/linux/eal/eal_memalloc.c     | 11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)