aboutsummaryrefslogtreecommitdiffstats
path: root/extras/libmemif/test/socket_test.c
diff options
context:
space:
mode:
authorJakub Grajciar <jgrajcia@cisco.com>2019-07-31 14:40:52 +0200
committerDamjan Marion <dmarion@me.com>2019-08-21 14:45:43 +0000
commit17f2a7bbf25f54dbd71aa8f377875828b7b88e35 (patch)
treeab88f5d0759bfe703c818a40ea46d0e52b28783d /extras/libmemif/test/socket_test.c
parentb6103105f99e0c7f210a9596f205a1efd21b626f (diff)
libmemif: introduce 'memif_per_thread_' namespace
APIs in 'memif_per_thread_' namespace are used to split the global database into separate databases, to improve multi-thread use cases. Using 'memif_per_thread_init' client can create separate libmemif databases (libmemif_main_t). Client will reference these databases using memif_per_thread_handle_t. Each database requires unique socket. Created interface will be stored in the same database as the socket passed in connection arguments. Example code: extras/libmemif/examples/icmp_responder_3-1/main.c Type: feature Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com> Change-Id: I261563ecc34761a76e94f20c20015394398ddfd7 Signed-off-by: Jakub Grajciar <jgrajcia@cisco.com>
Diffstat (limited to 'extras/libmemif/test/socket_test.c')
-rw-r--r--extras/libmemif/test/socket_test.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/extras/libmemif/test/socket_test.c b/extras/libmemif/test/socket_test.c
index 589bfd84cb7..2d229383c20 100644
--- a/extras/libmemif/test/socket_test.c
+++ b/extras/libmemif/test/socket_test.c
@@ -296,7 +296,9 @@ START_TEST (test_send_hello)
NULL, NULL)) != MEMIF_ERR_SUCCESS)
ck_abort_msg ("err code: %u, err msg: %s", err, memif_strerror (err));
- if ((err = memif_msg_send_hello (conn.fd)) != MEMIF_ERR_SUCCESS)
+ conn.args.socket = libmemif_main.default_socket;
+
+ if ((err = memif_msg_send_hello (get_libmemif_main (conn.args.socket), conn.fd)) != MEMIF_ERR_SUCCESS)
ck_assert_msg (err == MEMIF_ERR_BAD_FD,
"err code: %u, err msg: %s", err, memif_strerror (err));
}
@@ -387,7 +389,7 @@ START_TEST (test_recv_init)
memif_list_elt_t elt;
elt.key = 69;
elt.data_struct = &conn;
- add_list_elt (&elt, &ms.interface_list, &ms.interface_list_len);
+ add_list_elt (get_libmemif_main (conn.args.socket), &elt, &ms.interface_list, &ms.interface_list_len);
if ((err =
memif_init (control_fd_update, TEST_APP_NAME, NULL,