From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
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 <dev@dpdk.org>; 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 <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, david.marchand@redhat.com, stephen@networkplumber.org,
 Tyler Retzlaff <roretzla@linux.microsoft.com>
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 <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=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 <roretzla@linux.microsoft.com>
---
 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