Skip to content

Commit 15ceaae

Browse files
Di Zhuksacilotto
authored andcommitted
pktgen: fix misuse of BUG_ON() in pktgen_thread_worker()
BugLink: https://bugs.launchpad.net/bugs/1920235 [ Upstream commit 275b1e8 ] pktgen create threads for all online cpus and bond these threads to relevant cpu repecivtily. when this thread firstly be woken up, it will compare cpu currently running with the cpu specified at the time of creation and if the two cpus are not equal, BUG_ON() will take effect causing panic on the system. Notice that these threads could be migrated to other cpus before start running because of the cpu hotplug after these threads have created. so the BUG_ON() used here seems unreasonable and we can replace it with WARN_ON() to just printf a warning other than panic the system. Signed-off-by: Di Zhu <zhudi21@huawei.com> Link: https://lore.kernel.org/r/20210125124229.19334-1-zhudi21@huawei.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Kelsey Skunberg <kelsey.skunberg@canonical.com>
1 parent b0367e8 commit 15ceaae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/pktgen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3465,7 +3465,7 @@ static int pktgen_thread_worker(void *arg)
34653465
struct pktgen_dev *pkt_dev = NULL;
34663466
int cpu = t->cpu;
34673467

3468-
BUG_ON(smp_processor_id() != cpu);
3468+
WARN_ON(smp_processor_id() != cpu);
34693469

34703470
init_waitqueue_head(&t->queue);
34713471
complete(&t->start_done);

0 commit comments

Comments
 (0)