Commit 76519102 authored by Björn Töpel's avatar Björn Töpel Committed by Alexei Starovoitov

selftests: xsk: Remove thread attribute

There is really no reason to have a non-default thread stack
size. Remove that.
Signed-off-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210329224316.17793-16-maciej.fijalkowski@intel.com
parent 27e1ca25
...@@ -764,8 +764,6 @@ static void thread_common_ops(struct ifobject *ifobject, void *bufs) ...@@ -764,8 +764,6 @@ static void thread_common_ops(struct ifobject *ifobject, void *bufs)
int ctr = 0; int ctr = 0;
int ret; int ret;
pthread_attr_setstacksize(&attr, THREAD_STACK);
ifobject->ns_fd = switch_namespace(ifobject->nsname); ifobject->ns_fd = switch_namespace(ifobject->nsname);
if (test_type == TEST_TYPE_BPF_RES) if (test_type == TEST_TYPE_BPF_RES)
...@@ -909,13 +907,10 @@ static void testapp_validate(void) ...@@ -909,13 +907,10 @@ static void testapp_validate(void)
bool bidi = test_type == TEST_TYPE_BIDI; bool bidi = test_type == TEST_TYPE_BIDI;
bool bpf = test_type == TEST_TYPE_BPF_RES; bool bpf = test_type == TEST_TYPE_BPF_RES;
pthread_attr_init(&attr);
pthread_attr_setstacksize(&attr, THREAD_STACK);
pthread_mutex_lock(&sync_mutex); pthread_mutex_lock(&sync_mutex);
/*Spawn RX thread */ /*Spawn RX thread */
pthread_create(&t0, &attr, ifdict_rx->func_ptr, ifdict_rx); pthread_create(&t0, NULL, ifdict_rx->func_ptr, ifdict_rx);
if (clock_gettime(CLOCK_REALTIME, &max_wait)) if (clock_gettime(CLOCK_REALTIME, &max_wait))
exit_with_error(errno); exit_with_error(errno);
...@@ -927,7 +922,7 @@ static void testapp_validate(void) ...@@ -927,7 +922,7 @@ static void testapp_validate(void)
pthread_mutex_unlock(&sync_mutex); pthread_mutex_unlock(&sync_mutex);
/*Spawn TX thread */ /*Spawn TX thread */
pthread_create(&t1, &attr, ifdict_tx->func_ptr, ifdict_tx); pthread_create(&t1, NULL, ifdict_tx->func_ptr, ifdict_tx);
pthread_join(t1, NULL); pthread_join(t1, NULL);
pthread_join(t0, NULL); pthread_join(t0, NULL);
......
...@@ -37,7 +37,6 @@ ...@@ -37,7 +37,6 @@
#define TMOUT_SEC (3) #define TMOUT_SEC (3)
#define EOT (-1) #define EOT (-1)
#define USLEEP_MAX 200000 #define USLEEP_MAX 200000
#define THREAD_STACK 60000000
#define SOCK_RECONF_CTR 10 #define SOCK_RECONF_CTR 10
#define BATCH_SIZE 64 #define BATCH_SIZE 64
#define POLL_TMOUT 1000 #define POLL_TMOUT 1000
...@@ -152,7 +151,6 @@ static struct ifobject *ifdict_tx; ...@@ -152,7 +151,6 @@ static struct ifobject *ifdict_tx;
pthread_mutex_t sync_mutex; pthread_mutex_t sync_mutex;
pthread_cond_t signal_rx_condition; pthread_cond_t signal_rx_condition;
pthread_t t0, t1; pthread_t t0, t1;
pthread_attr_t attr;
TAILQ_HEAD(head_s, pkt) head = TAILQ_HEAD_INITIALIZER(head); TAILQ_HEAD(head_s, pkt) head = TAILQ_HEAD_INITIALIZER(head);
struct head_s *head_p; struct head_s *head_p;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment