Commit c588baab authored by Jim Harris's avatar Jim Harris
Browse files

reactor: add pid to names for rings and mempools



This is required for using the event framework
in multi-process mode since they must be unique
across the group of processes..

Currently the stub app calls into the env layer
directly, bypassing the event framework, so this
issue would only be seen with multiple secondary
processes using the app framework.  Some future
changes will change the stub app to use the event
framework which necessitates this change immediately.

Signed-off-by: default avatarJim Harris <james.r.harris@intel.com>
Change-Id: I5e1acc95380a20a0204c327906c7ef83a82d7fac

Reviewed-on: https://review.gerrithub.io/366647


Tested-by: default avatarSPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarDaniel Verkamp <daniel.verkamp@intel.com>
parent e2a5855a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -277,8 +277,8 @@ spdk_ring_create(enum spdk_ring_type type, size_t count, int socket_id)
		return NULL;
	}

	snprintf(ring_name, sizeof(ring_name), "spdk_ring_%u",
		 __sync_fetch_and_add(&ring_num, 1));
	snprintf(ring_name, sizeof(ring_name), "ring_%u_%d",
		 __sync_fetch_and_add(&ring_num, 1), getpid());

	return (struct spdk_ring *)rte_ring_create(ring_name, count, socket_id, flags);
}
+1 −1
Original line number Diff line number Diff line
@@ -556,7 +556,7 @@ spdk_reactors_init(unsigned int max_delay_us)

	for (i = 0; i < SPDK_MAX_SOCKET; i++) {
		if ((1ULL << i) & socket_mask) {
			snprintf(mempool_name, sizeof(mempool_name), "spdk_event_mempool_%d", i);
			snprintf(mempool_name, sizeof(mempool_name), "evtpool%d_%d", i, getpid());
			g_spdk_event_mempool[i] = spdk_mempool_create(mempool_name,
						  (262144 / socket_count),
						  sizeof(struct spdk_event), -1, i);