]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: virtio - Replace package id with numa node id
authorBibo Mao <maobibo@loongson.cn>
Tue, 13 Jan 2026 03:05:56 +0000 (11:05 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 31 Jan 2026 02:52:30 +0000 (10:52 +0800)
With multiple virtio crypto devices supported with different NUMA
nodes, when crypto session is created, it will search virtio crypto
device with the same numa node of current CPU.

Here API topology_physical_package_id() is replaced with cpu_to_node()
since package id is physical concept, and one package id have multiple
memory numa id.

Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/virtio/virtio_crypto_common.h

index 19c934af3df6bfc186f40dbfc8faa64e3504f77b..e559bdadf4f9132544fec24775191a7da0bed70d 100644 (file)
@@ -135,7 +135,7 @@ static inline int virtio_crypto_get_current_node(void)
        int cpu, node;
 
        cpu = get_cpu();
-       node = topology_physical_package_id(cpu);
+       node = cpu_to_node(cpu);
        put_cpu();
 
        return node;