From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0A84C41E95; Tue, 14 Mar 2023 23:50:48 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 51DB741101; Tue, 14 Mar 2023 23:50:44 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4CD4340E5A for ; Tue, 14 Mar 2023 23:50:41 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 984EA205700A; Tue, 14 Mar 2023 15:50:40 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 984EA205700A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1678834240; bh=QdVmYb/o7Aq8A11P9wbdx3I8kxxqizdMblRmgtj6ZXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gkZjNRdKanisAHiFXILKAnTcpeZGbS2cChwgj7J1M6HvwI26a3voS35abhEnoRhiC rXsCMwjOsilsaF2gvQ57dBH8GLPkJF/8dsGujMYHM4AWCT5AIkl6hsXBRN+9m8FRYR AoZRrzgdfx5vu0ouncG6/67auvh4nl9NYhQpiUgU= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH v4 1/2] eal: make cpusetp to rte thread set affinity const Date: Tue, 14 Mar 2023 15:50:38 -0700 Message-Id: <1678834239-11569-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1678834239-11569-1-git-send-email-roretzla@linux.microsoft.com> References: <1677782682-27200-1-git-send-email-roretzla@linux.microsoft.com> <1678834239-11569-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org const qualify rte_cpuset_t *cpusetp parameter in the rte_thread_set_affinity API. Signed-off-by: Tyler Retzlaff --- lib/eal/common/eal_common_thread.c | 6 +++--- lib/eal/include/rte_thread.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/eal/common/eal_common_thread.c b/lib/eal/common/eal_common_thread.c index 079a385..c9e5619 100644 --- a/lib/eal/common/eal_common_thread.c +++ b/lib/eal/common/eal_common_thread.c @@ -34,7 +34,7 @@ unsigned rte_socket_id(void) } static int -eal_cpuset_socket_id(rte_cpuset_t *cpusetp) +eal_cpuset_socket_id(const rte_cpuset_t *cpusetp) { unsigned cpu = 0; int socket_id = SOCKET_ID_ANY; @@ -62,7 +62,7 @@ unsigned rte_socket_id(void) } static void -thread_update_affinity(rte_cpuset_t *cpusetp) +thread_update_affinity(const rte_cpuset_t *cpusetp) { unsigned int lcore_id = rte_lcore_id(); @@ -83,7 +83,7 @@ unsigned rte_socket_id(void) } int -rte_thread_set_affinity(rte_cpuset_t *cpusetp) +rte_thread_set_affinity(const rte_cpuset_t *cpusetp) { if (rte_thread_set_affinity_by_id(rte_thread_self(), cpusetp) != 0) { RTE_LOG(ERR, EAL, "rte_thread_set_affinity_by_id failed\n"); diff --git a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h index ddd411e..e461354 100644 --- a/lib/eal/include/rte_thread.h +++ b/lib/eal/include/rte_thread.h @@ -348,7 +348,7 @@ int rte_thread_get_affinity_by_id(rte_thread_t thread_id, * @return * On success, return 0; otherwise return -1; */ -int rte_thread_set_affinity(rte_cpuset_t *cpusetp); +int rte_thread_set_affinity(const rte_cpuset_t *cpusetp); /** * Get core affinity of the current thread. -- 1.8.3.1