From 3b03c4b2bcbcf5a913a3127d2b45283540c505c3 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 2 Apr 2018 08:19:54 +0200 Subject: ipcpd: Enable locking threads to a CPU core This adds a function that locks a thread to a random core. This greatly improves performance on multi-cpu systems. There is no portable way to do this, this only implements it for GNU/Linux. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/eth/eth.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ipcpd/eth') diff --git a/src/ipcpd/eth/eth.c b/src/ipcpd/eth/eth.c index b43caae1..d1ee088d 100644 --- a/src/ipcpd/eth/eth.c +++ b/src/ipcpd/eth/eth.c @@ -777,6 +777,8 @@ static void * eth_ipcp_sdu_reader(void * o) (void) o; + ipcp_lock_to_core(); + memset(br_addr, 0xff, MAC_SIZE * sizeof(uint8_t)); while (true) { @@ -893,6 +895,8 @@ static void * eth_ipcp_sdu_writer(void * o) (void) o; + ipcp_lock_to_core(); + while (true) { fevent(eth_data.np1_flows, eth_data.fq, NULL); -- cgit v1.2.3