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 9B8B041EA5; Thu, 16 Mar 2023 01:04:13 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 15FF140EF1; Thu, 16 Mar 2023 01:04:13 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 4F1D440DF6 for ; Thu, 16 Mar 2023 01:04:12 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6A6AD20C343F; Wed, 15 Mar 2023 17:04:11 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6A6AD20C343F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1678925051; bh=QdVmYb/o7Aq8A11P9wbdx3I8kxxqizdMblRmgtj6ZXc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pweXQUnjtw1JEGEsHXdnqTWcR98fteHChLXEE/hX80u4hsH0JjRtyLS4Ud9OeSy0j Sk8Az8FIl2kw1LOYdRrcso7UMyenX5OuErR5hG1JfJG9w4lVWAScon6yV4JI96XMmd eOzldwH7fCAkU18I/kMVPCJd/eaPx8APlwux1p0E= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, stephen@networkplumber.org, Tyler Retzlaff Subject: [PATCH v4 1/2] eal: make cpusetp to rte thread set affinity const Date: Wed, 15 Mar 2023 17:04:09 -0700 Message-Id: <1678925050-1955-2-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1678925050-1955-1-git-send-email-roretzla@linux.microsoft.com> References: <1677782682-27200-1-git-send-email-roretzla@linux.microsoft.com> <1678925050-1955-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