summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f9464ab)
raw | patch | inline | side by side (parent: f9464ab)
author | Angela Stegmaier <angelabaker@ti.com> | |
Mon, 17 Jun 2013 04:55:01 +0000 (21:55 -0700) | ||
committer | Chris Ring <cring@ti.com> | |
Mon, 17 Jun 2013 04:55:01 +0000 (21:55 -0700) |
Update the test so that each core registers a different
endpoint name. In this way multiple images can be loaded
at the same time and this test can be run for each core
without having to unload and reaload another image.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
endpoint name. In this way multiple images can be loaded
at the same time and this test can be run for each core
without having to unload and reaload another image.
Signed-off-by: Angela Stegmaier <angelabaker@ti.com>
index 6952a14883113f638125b5af5244fcf3577c550c..ace838de17db88d5677966369c965f8b5a2a8520 100644 (file)
/* create remote server insance */
MmRpc_Params_init(&args);
- status = MmRpc_create("rpc_example", &args, &Mx_rpcIpu);
+ status = MmRpc_create("rpc_example_1", &args, &Mx_rpcIpu);
if (status < 0) {
printf("mmrpc_test: Error: MmRpc_create failed\n");
index 0a210c25ed67d2fcedf6a425ccec53be3325bbf1..753e88bbcd57a06d86d30c6a72f9196eb6f4a6cf 100644 (file)
void register_MxServer(void)
{
Int status = MmServiceMgr_S_SUCCESS;
+ Char mMServerName[20];
System_printf("register_MxServer: -->\n");
rpc_Params.fxns.length = rpc_fxnTab.length;
rpc_Params.fxns.elem = rpc_fxnTab.elem;
+ /* Construct an MMServiceMgr name adorned with core name: */
+ System_sprintf(mMServerName, "%s_%d", SERVICE_NAME,
+ MultiProc_self());
+
/* register an example service */
- status = MmServiceMgr_register(SERVICE_NAME, &rpc_Params, &rpc_fxnSigTab,
+ status = MmServiceMgr_register(mMServerName, &rpc_Params, &rpc_fxnSigTab,
RPC_SKEL_SrvDelNotification);
if (status < 0) {
diff --git a/qnx/src/ipc3x_dev/ti/syslink/samples/hlos/rpmsg-rpc-stress/usr/tests_rpc_stress.c b/qnx/src/ipc3x_dev/ti/syslink/samples/hlos/rpmsg-rpc-stress/usr/tests_rpc_stress.c
index 6783f7b82b688667a3435b2e253bdbf8a1c91317..7b0e5108193114619cc07aec2a8f6f8a0d233ec9 100644 (file)
int packet_len;
char packet_buf[512] = {0};
test_exec_args args[num_comps];
+ char serviceMgrName[20];
+ char serviceMgrPath[20];
+
+ snprintf (serviceMgrName, _POSIX_PATH_MAX, "rpc_example_%d", core_id);
+ snprintf (serviceMgrPath, _POSIX_PATH_MAX, "/dev/%s", serviceMgrName);
fds = malloc (sizeof(int) * num_comps);
if (!fds) {
return -1;
}
for (i = 0; i < num_comps; i++) {
- /* Connect to the rpc_example ServiceMgr on the specified core: */
- if (core_id == 0) {
- fds[i] = open("/dev/rpmsg-omx0", O_RDWR);
- if (fds[i] < 0) {
- perror("Can't open OMX device");
- ret = -1;
- break;
- }
- strcpy(connreq.name, "rpmsg-omx0");
- }
- else if (core_id == 1) {
- fds[i] = open("/dev/rpc_example", O_RDWR);
- if (fds[i] < 0) {
- perror("Can't open rpc_example device");
- break;
- }
- strcpy(connreq.name, "rpc_example");
- }
- else if (core_id == 2) {
- fds[i] = open("/dev/rpmsg-omx2", O_RDWR);
- if (fds[i] < 0) {
- perror("Can't open OMX device");
- break;
- }
- strcpy(connreq.name, "rpmsg-omx2");
+ fds[i] = open(serviceMgrPath, O_RDWR);
+ if (fds[i] < 0) {
+ perror("Can't open rpc_example device");
+ break;
}
+ strcpy(connreq.name, serviceMgrName);
+
/* Create an rpc_example server instance, and rebind its address to this
* file descriptor.
*/
struct rppc_create_instance connreq;
struct rppc_function *function;
test_exec_args args[num_threads];
+ char serviceMgrName[20];
+ char serviceMgrPath[20];
- /* Connect to the rpc_example ServiceMgr on the specified core: */
- if (core_id == 0) {
- fd = open("/dev/rpmsg-omx0", O_RDWR);
- if (fd < 0) {
- perror("Can't open OMX device");
- return -1;
- }
- strcpy(connreq.name, "rpmsg-omx0");
+ snprintf (serviceMgrName, _POSIX_PATH_MAX, "rpc_example_%d", core_id);
+ snprintf (serviceMgrPath, _POSIX_PATH_MAX, "/dev/%s", serviceMgrName);
+ /* Connect to the rpc_example ServiceMgr on the specified core: */
+ fd = open(serviceMgrPath, O_RDWR);
+ if (fd < 0) {
+ perror("Can't open rpc_example device");
+ return -1;
}
- else if (core_id == 1) {
- fd = open("/dev/rpc_example", O_RDWR);
- if (fd < 0) {
- perror("Can't open rpc_example device");
- return -1;
- }
- strcpy(connreq.name, "rpc_example");
- }
- else if (core_id == 2) {
- fd = open("/dev/rpmsg-omx2", O_RDWR);
- if (fd < 0) {
- perror("Can't open OMX device");
- return -1;
- }
- strcpy(connreq.name, "rpmsg-omx2");
- }
+ strcpy(connreq.name, serviceMgrName);
+
/* Create an rpc_example server instance, and rebind its address to this
* file descriptor.
*/
int fd[num_comps];
struct rppc_create_instance connreq;
test_exec_args args[num_comps];
+ char serviceMgrName[20];
+ char serviceMgrPath[20];
+
+ snprintf (serviceMgrName, _POSIX_PATH_MAX, "rpc_example_%d", core_id);
+ snprintf (serviceMgrPath, _POSIX_PATH_MAX, "/dev/%s", serviceMgrName);
for (i = 0; i < num_comps; i++) {
/* Connect to the rpc_example ServiceMgr on the specified core: */
- if (core_id == 0) {
- fd[i] = open("/dev/rpmsg-omx0", O_RDWR);
- if (fd[i] < 0) {
- perror("Can't open OMX device");
- ret = -1;
- break;
- }
- strcpy(connreq.name, "rpmsg-omx0");
- }
- else if (core_id == 1) {
- fd[i] = open("/dev/rpc_example", O_RDWR);
- if (fd[i] < 0) {
- perror("Can't open rpc_example device");
- ret = -1;
- break;
- }
- strcpy(connreq.name, "rpc_example");
- }
- else if (core_id == 2) {
- fd[i] = open("/dev/rpmsg-omx2", O_RDWR);
- if (fd[i] < 0) {
- perror("Can't open OMX device");
- ret = -1;
- break;
- }
- strcpy(connreq.name, "rpmsg-omx2");
+ fd[i] = open(serviceMgrPath, O_RDWR);
+ if (fd[i] < 0) {
+ perror("Can't open rpc_example device");
+ ret = -1;
+ break;
}
+ strcpy(connreq.name, serviceMgrName);
+
/* Create an rpc_example server instance, and rebind its address to this
* file descriptor.
*/
switch (test_id) {
case 1:
/* multiple threads each with an RPMSG-RPC ServiceMgr instance */
- if (core_id < 0 || core_id > 2) {
+ if (core_id < 0 || core_id > 4) {
printf("Invalid core id\n");
return 1;
}
break;
case 2:
/* Multiple threads, 1 RPMSG-RPC ServiceMgr instances */
- if (core_id < 0 || core_id > 2) {
+ if (core_id < 0 || core_id > 4) {
printf("Invalid core id\n");
return 1;
}
break;
case 3:
/* 1 thread using multiple RPMSG-RPC ServiceMgr instances */
- if (core_id < 0 || core_id > 2) {
+ if (core_id < 0 || core_id > 4) {
printf("Invalid core id\n");
return 1;
}