dma/skeleton: fix pthread set affinity

Message ID 20230812015738.1024-1-vipin.varghese@amd.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series dma/skeleton: fix pthread set affinity |

Checks

Context Check Description
ci/loongarch-compilation success Compilation OK
ci/checkpatch success coding style OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS
ci/github-robot: build success github build: passed
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS

Commit Message

Vipin Varghese Aug. 12, 2023, 1:57 a.m. UTC
  In skeleton dma driver, the user can pin the dma thread to desired
cpu core. The previous commit changed the api from set-affinity to
get-affinity leading to thread to be pinned to first available lcore.

Bugzilla ID: 1270
Fixes: 7fdf30d8b259 ("eal/windows: remove most pthread lifetime shim functions")
Cc: roretzla@linux.microsoft.com

Cc: stable@dpdk.org

Signed-off-by: Vipin Varghese <vipin.varghese@amd.com>
---
---
 drivers/dma/skeleton/skeleton_dmadev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Tyler Retzlaff Aug. 14, 2023, 4:24 p.m. UTC | #1
On Sat, Aug 12, 2023 at 07:27:38AM +0530, Vipin Varghese wrote:
> In skeleton dma driver, the user can pin the dma thread to desired
> cpu core. The previous commit changed the api from set-affinity to
> get-affinity leading to thread to be pinned to first available lcore.
> 
> Bugzilla ID: 1270
> Fixes: 7fdf30d8b259 ("eal/windows: remove most pthread lifetime shim functions")
> Cc: roretzla@linux.microsoft.com
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Vipin Varghese <vipin.varghese@amd.com>
> ---

yikes, sorry about this and thank you for fixing it.

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  
David Marchand Aug. 15, 2023, 12:21 p.m. UTC | #2
On Mon, Aug 14, 2023 at 6:24 PM Tyler Retzlaff
<roretzla@linux.microsoft.com> wrote:
>
> On Sat, Aug 12, 2023 at 07:27:38AM +0530, Vipin Varghese wrote:
> > In skeleton dma driver, the user can pin the dma thread to desired
> > cpu core. The previous commit changed the api from set-affinity to
> > get-affinity leading to thread to be pinned to first available lcore.
> >
> > Bugzilla ID: 1270
> > Fixes: 7fdf30d8b259 ("eal/windows: remove most pthread lifetime shim functions")

This Fixes: looks wrong.

I would blame (and blame the bad reviewers):
Fixes: f241553b43ee ("dma/skeleton: drop some pthread API calls")

Can you double check?
  
Thomas Monjalon Oct. 17, 2023, 8:59 a.m. UTC | #3
15/08/2023 14:21, David Marchand:
> On Mon, Aug 14, 2023 at 6:24 PM Tyler Retzlaff
> <roretzla@linux.microsoft.com> wrote:
> >
> > On Sat, Aug 12, 2023 at 07:27:38AM +0530, Vipin Varghese wrote:
> > > In skeleton dma driver, the user can pin the dma thread to desired
> > > cpu core. The previous commit changed the api from set-affinity to
> > > get-affinity leading to thread to be pinned to first available lcore.
> > >
> > > Bugzilla ID: 1270
> > > Fixes: 7fdf30d8b259 ("eal/windows: remove most pthread lifetime shim functions")
> 
> This Fixes: looks wrong.
> 
> I would blame (and blame the bad reviewers):
> Fixes: f241553b43ee ("dma/skeleton: drop some pthread API calls")
> 
> Can you double check?

I agree with the root cause pointed by David.

Applied, thanks.
  

Patch

diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c
index c2d776dbbd..c508e4f1c4 100644
--- a/drivers/dma/skeleton/skeleton_dmadev.c
+++ b/drivers/dma/skeleton/skeleton_dmadev.c
@@ -137,7 +137,7 @@  skeldma_start(struct rte_dma_dev *dev)
 
 	if (hw->lcore_id != -1) {
 		cpuset = rte_lcore_cpuset(hw->lcore_id);
-		ret = rte_thread_get_affinity_by_id(hw->thread, &cpuset);
+		ret = rte_thread_set_affinity_by_id(hw->thread, &cpuset);
 		if (ret)
 			SKELDMA_LOG(WARNING,
 				"Set thread affinity lcore = %d fail!",