Skip to contentSkip to conversation

dma/skeleton: fix pthread set affinity

PATCH Applied Vipin Varghese 4 participants 4 messages Aug 12, 2023 – Oct 17, 2023 dmaengine

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma/skeleton: fix pthread set affinity

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")

---

---
 drivers/dma/skeleton/skeleton_dmadev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/skeleton/skeleton_dmadev.c +1 -1
index c2d776dbbd..c508e4f1c4 100644
@@ -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!",
Signature · 1 line
2.34.1
Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Vipin Varghese

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.

Quoted 8 lines

Bugzilla ID: 1270

Fixes 7fdf30d8b259 ("eal/windows: remove most pthread lifetime shim functions")

---

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

#2 lore raw
Quoted 8 lines · Tyler Retzlaff
Quoted 6 lines · Vipin Varghese

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?

Signature · 1 line
David Marchand
#3 lore raw

15/08/2023 14:21, David Marchand:

Quoted 11 lines
Quoted 8 lines · Tyler Retzlaff
Quoted 6 lines · Vipin Varghese

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")
Quoted 6 lines

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.