
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICS3XV -------------------------------- Function smp_processor_id() should not be used in preemptible code. Fixes: 4bed6ba0e88f ("net/oenetcls: introduce oenetcls for network optimization") Signed-off-by: Wang Liang <wangliang74@huawei.com> --- net/oenetcls/oenetcls_main.c | 4 ++-- net/oenetcls/oenetcls_ntuple.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/oenetcls/oenetcls_main.c b/net/oenetcls/oenetcls_main.c index 67c73f4595be..ef3c6dabb2f3 100644 --- a/net/oenetcls/oenetcls_main.c +++ b/net/oenetcls/oenetcls_main.c @@ -671,7 +671,7 @@ static int init_numa_rxq_bitmap(int nid, struct oecls_numa_info *numa_info) static int get_cluster_rxq(struct oecls_numa_bound_dev_info *bound_dev) { - int cpu = smp_processor_id(); + int cpu = raw_smp_processor_id(); int cluster_id = cpu / oecls_cluster_cpu_num; int i, j, rxq_id; @@ -796,7 +796,7 @@ static int init_oecls_numa_info(void) return ret; } - oecls_cluster_cpu_num = cpumask_weight(topology_cluster_cpumask(smp_processor_id())); + oecls_cluster_cpu_num = cpumask_weight(topology_cluster_cpumask(raw_smp_processor_id())); oecls_cluster_per_numa = (nr_cpu_ids / oecls_cluster_cpu_num) / oecls_numa_num; oecls_debug("oecls_numa_num=%d cluster_cpu_num:%d cluster_cpu_num:%d\n", oecls_numa_num, oecls_cluster_per_numa, oecls_cluster_cpu_num); diff --git a/net/oenetcls/oenetcls_ntuple.c b/net/oenetcls/oenetcls_ntuple.c index 3986d86efe83..7cbfe2841706 100644 --- a/net/oenetcls/oenetcls_ntuple.c +++ b/net/oenetcls/oenetcls_ntuple.c @@ -465,7 +465,7 @@ static void add_ntuple_rule(struct sock *sk) { struct oecls_netdev_info *oecls_dev; struct cmd_context ctx = { 0 }; - int cpu = smp_processor_id(); + int cpu = raw_smp_processor_id(); int nid = cpu_to_node(cpu); int rxq_id; int devid; @@ -511,7 +511,7 @@ static void ethtool_cfg_rxcls(void *data, struct sock *sk, int is_del) if (sk->sk_family != AF_INET && sk->sk_family != AF_INET6) return; - oecls_debug("[cpu:%d] app:%s, sk:%p, is_del:%d, ip:%pI4, port:%d\n", smp_processor_id(), + oecls_debug("[cpu:%d] app:%s, sk:%p, is_del:%d, ip:%pI4, port:%d\n", raw_smp_processor_id(), current->comm, sk, is_del, &sk->sk_rcv_saddr, (u16)sk->sk_num); if (is_del) -- 2.34.1