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 429B941E88;
	Tue, 14 Mar 2023 00:31:16 +0100 (CET)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id EAEF541611;
	Tue, 14 Mar 2023 00:31:12 +0100 (CET)
Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182])
 by mails.dpdk.org (Postfix) with ESMTP id D4135410D1
 for <dev@dpdk.org>; Tue, 14 Mar 2023 00:31:08 +0100 (CET)
Received: by linux.microsoft.com (Postfix, from userid 1086)
 id 2F6CD2056866; Mon, 13 Mar 2023 16:31:08 -0700 (PDT)
DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2F6CD2056866
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;
 s=default; t=1678750268;
 bh=QdVmYb/o7Aq8A11P9wbdx3I8kxxqizdMblRmgtj6ZXc=;
 h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
 b=kZ4rkXpeWAQlbsSoVnmvNS89D5fVQQtNINv4eO5PBgpnnxg8xMF8sMjgn/Lt0iPYg
 FtdxMjJgnWBbix8E/hYp03dSkDLizh4cZXUIp6bVCktUddsRxFr2uv1iKtpwHEy0kW
 EE6ROVZSH2FUqz+8QmZnz36SoYw1oxbcHkUCxxBQ=
From: Tyler Retzlaff <roretzla@linux.microsoft.com>
To: dev@dpdk.org
Cc: thomas@monjalon.net, david.marchand@redhat.com,
 Tyler Retzlaff <roretzla@linux.microsoft.com>
Subject: [PATCH v2 1/2] eal: make cpusetp to rte thread set affinity const
Date: Mon, 13 Mar 2023 16:31:06 -0700
Message-Id: <1678750267-3829-2-git-send-email-roretzla@linux.microsoft.com>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1678750267-3829-1-git-send-email-roretzla@linux.microsoft.com>
References: <1677782682-27200-1-git-send-email-roretzla@linux.microsoft.com>
 <1678750267-3829-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