From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id 3B2541B7A9 for ; Tue, 15 May 2018 15:48:46 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id w194-v6so1170253wmf.2 for ; Tue, 15 May 2018 06:48:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1zJYb32IEcGWIHr4M6ikFDcuHmn90Ios+r6febk40iE=; b=PKNErLVS0wpWjGxFt2UkvVDsYHU/RWAxRqX/dwIn433jaaNBn3v4Hg201wOsKrc1Y/ kmMyCFXgLhcSugdFomQA+FFyQWt1z70Jz6kTVRmfas+UzMUtANpN7sy0PalMtXwA7va/ bxZm0dbDe5i/GzfyFAnhAudhJWQAW2lB+6bJCGYb2IOeiMW+AzqxMA6yuBH3JkA/BpHh tu4jL7na3YMqPPozv0BY5Sxo9iVzkx3UM5ZKqoAAowA1H1j48S2gJbvpYElgmurXga1a R3BVwZYgv8h7NOLuROfGMFfefvAnFrTJU7SCPQ097J3yUQOAGqWEoXqp4sTaIgPihrWS yFyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1zJYb32IEcGWIHr4M6ikFDcuHmn90Ios+r6febk40iE=; b=Ou54mOsJqaTjUzPW73gAAMKwIQ7zIcFoYgLdngjjV0Jl6Zlz9f5UC7mqwGrcYmBIGO 6Y1hCI5UHepv0Hw9y9LtyvMzV/zIlemXZGsYPpV1FHhSQaom6fWXBc27ClXWvYPzV2lt xh7wHffbxALeu2bzAbFitLiLBXCnliV7CCxBdCxYyDJZZx+UPRtQCVIKTh52q7UrF4SZ 4mhWMs1+9Aym1YHxdH8mQNwJQNp1sWISYLTpaJ/55X9A5fXFOIjmZeBk5PwkekgXG/AB 9UXxdYGfrZcvueq/Qxvgp2DjWsK7T+Gr26pIm3V+W9gASZMQ2pFwIhLsFtqfwXr8RXRm JZwA== X-Gm-Message-State: ALKqPwfHx9AnOIN53hM7J8i1CMGrzlIaEvT59X80PoJEVAy+XllR4lS1 dpt52m0612IRUJUaTIpBfAxg0syQDTs= X-Google-Smtp-Source: AB8JxZpkjuJ8N3fKXeyq2YRPFspQDWkVyFNcos/4t3duWFaklawwRLP3yH6AS4GA73Ho4DwijTr/Ew== X-Received: by 2002:a1c:5451:: with SMTP id p17-v6mr8031096wmi.26.1526392125800; Tue, 15 May 2018 06:48:45 -0700 (PDT) Received: from localhost (slip139-92-244-193.lon.uk.prserv.net. [139.92.244.193]) by smtp.gmail.com with ESMTPSA id u89-v6sm680147wma.4.2018.05.15.06.48.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 15 May 2018 06:48:44 -0700 (PDT) From: luca.boccassi@gmail.com To: David Hunt Cc: Pablo de Lara , dpdk stable Date: Tue, 15 May 2018 14:46:49 +0100 Message-Id: <20180515134731.9337-38-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180515134731.9337-1-luca.boccassi@gmail.com> References: <20180503110612.12146-2-luca.boccassi@gmail.com> <20180515134731.9337-1-luca.boccassi@gmail.com> Subject: [dpdk-stable] patch 'examples/performance-thread: fix return type of threads' has been queued to stable release 18.02.2 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 May 2018 13:48:46 -0000 Hi, FYI, your patch has been queued to stable release 18.02.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 05/16/18. So please shout if anyone has objections. Thanks. Luca Boccassi --- >>From 19a441472af6ce087b8ab63701e76695332ffaa5 Mon Sep 17 00:00:00 2001 From: David Hunt Date: Mon, 14 May 2018 03:53:15 +0100 Subject: [PATCH] examples/performance-thread: fix return type of threads [ upstream commit 803ee2ebd32d019d54011f185819f3b76b113c4f ] The function pthread_create() expects void *(*func) (void *) for function pointer, however, lthread_func_t was defined as void (*func) (void *), so now gcc 8.1 warns that the cast is incorrect, causing a compilation failure. This patch changes the declaration of lthread_func_t from returning a void to returning a void*, and then changes the sample app in the relevant places that are affected by the typedef change. Fixes: 116819b9ed0d ("examples/performance-thread: add lthread subsystem") Signed-off-by: David Hunt Acked-by: Pablo de Lara --- examples/performance-thread/common/lthread.c | 3 ++- examples/performance-thread/common/lthread_api.h | 2 +- examples/performance-thread/l3fwd-thread/main.c | 20 +++++++++++++------- examples/performance-thread/pthread_shim/main.c | 6 ++---- .../performance-thread/pthread_shim/pthread_shim.c | 4 ++-- 5 files changed, 20 insertions(+), 15 deletions(-) diff --git a/examples/performance-thread/common/lthread.c b/examples/performance-thread/common/lthread.c index 7d76c8c46..0b60a42a8 100644 --- a/examples/performance-thread/common/lthread.c +++ b/examples/performance-thread/common/lthread.c @@ -320,13 +320,14 @@ struct lthread *lthread_current(void) /* * Tasklet to cancel a thread */ -static void +static void * _cancel(void *arg) { struct lthread *lt = (struct lthread *) arg; lt->state |= BIT(ST_LT_CANCELLED); lthread_detach(); + return NULL; } diff --git a/examples/performance-thread/common/lthread_api.h b/examples/performance-thread/common/lthread_api.h index ff245a082..a74680bf7 100644 --- a/examples/performance-thread/common/lthread_api.h +++ b/examples/performance-thread/common/lthread_api.h @@ -143,7 +143,7 @@ struct lthread_mutex; struct lthread_condattr; struct lthread_mutexattr; -typedef void (*lthread_func_t) (void *); +typedef void *(*lthread_func_t) (void *); /* * Define the size of stack for an lthread diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index 699b99d00..c5a173ed3 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -1990,17 +1990,18 @@ cpu_load_collector(__rte_unused void *arg) { * * This loop is used to start empty scheduler on lcore. */ -static void +static void * lthread_null(__rte_unused void *args) { int lcore_id = rte_lcore_id(); RTE_LOG(INFO, L3FWD, "Starting scheduler on lcore %d.\n", lcore_id); lthread_exit(NULL); + return NULL; } /* main processing loop */ -static void +static void * lthread_tx_per_ring(void *dummy) { int nb_rx; @@ -2045,6 +2046,7 @@ lthread_tx_per_ring(void *dummy) lthread_cond_wait(ready, 0); } + return NULL; } /* @@ -2053,7 +2055,7 @@ lthread_tx_per_ring(void *dummy) * This lthread is used to spawn one new lthread per ring from producers. * */ -static void +static void * lthread_tx(void *args) { struct lthread *lt; @@ -2098,9 +2100,10 @@ lthread_tx(void *args) } } + return NULL; } -static void +static void * lthread_rx(void *dummy) { int ret; @@ -2124,7 +2127,7 @@ lthread_rx(void *dummy) if (rx_conf->n_rx_queue == 0) { RTE_LOG(INFO, L3FWD, "lcore %u has nothing to do\n", rte_lcore_id()); - return; + return NULL; } RTE_LOG(INFO, L3FWD, "Entering main Rx loop on lcore %u\n", rte_lcore_id()); @@ -2196,6 +2199,7 @@ lthread_rx(void *dummy) lthread_yield(); } } + return NULL; } /* @@ -2204,8 +2208,9 @@ lthread_rx(void *dummy) * This lthread loop spawns all rx and tx lthreads on master lcore */ -static void -lthread_spawner(__rte_unused void *arg) { +static void * +lthread_spawner(__rte_unused void *arg) +{ struct lthread *lt[MAX_THREAD]; int i; int n_thread = 0; @@ -2246,6 +2251,7 @@ lthread_spawner(__rte_unused void *arg) { for (i = 0; i < n_thread; i++) lthread_join(lt[i], NULL); + return NULL; } /* diff --git a/examples/performance-thread/pthread_shim/main.c b/examples/performance-thread/pthread_shim/main.c index 964ea252d..7d0d58116 100644 --- a/examples/performance-thread/pthread_shim/main.c +++ b/examples/performance-thread/pthread_shim/main.c @@ -119,8 +119,7 @@ void *helloworld_pthread(void *arg) */ __thread pthread_t tid[HELLOW_WORLD_MAX_LTHREADS]; -static void initial_lthread(void *args); -static void initial_lthread(void *args __attribute__((unused))) +static void *initial_lthread(void *args __attribute__((unused))) { int lcore = (int) rte_lcore_id(); /* @@ -195,6 +194,7 @@ static void initial_lthread(void *args __attribute__((unused))) /* shutdown the lthread scheduler */ lthread_scheduler_shutdown(rte_lcore_id()); lthread_detach(); + return NULL; } @@ -205,8 +205,6 @@ static void initial_lthread(void *args __attribute__((unused))) * in the core mask */ static int -lthread_scheduler(void *args); -static int lthread_scheduler(void *args __attribute__((unused))) { /* create initial thread */ diff --git a/examples/performance-thread/pthread_shim/pthread_shim.c b/examples/performance-thread/pthread_shim/pthread_shim.c index c31de4e9d..53f12437f 100644 --- a/examples/performance-thread/pthread_shim/pthread_shim.c +++ b/examples/performance-thread/pthread_shim/pthread_shim.c @@ -365,7 +365,7 @@ int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) int pthread_create(pthread_t *__restrict tid, const pthread_attr_t *__restrict attr, - void *(func) (void *), + lthread_func_t func, void *__restrict arg) { if (override) { @@ -390,7 +390,7 @@ pthread_create(pthread_t *__restrict tid, } } return lthread_create((struct lthread **)tid, lcore, - (void (*)(void *))func, arg); + func, arg); } return _sys_pthread_funcs.f_pthread_create(tid, attr, func, arg); } -- 2.14.2