BPF List
 help / color / mirror / Atom feed
From: Wang Liang <wangliang74@huawei.com>
To: Nikolay Aleksandrov <razor@blackwall.org>, <jv@jvosburgh.net>,
	<andrew+netdev@lunn.ch>, <davem@davemloft.net>,
	<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
	<horms@kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>,
	<hawk@kernel.org>, <john.fastabend@gmail.com>,
	<joamaki@gmail.com>
Cc: <yuehaibing@huawei.com>, <zhangchangzhong@huawei.com>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<bpf@vger.kernel.org>
Subject: Re: [PATCH net v2] bonding: check xdp prog when set bond mode
Date: Fri, 21 Mar 2025 17:01:33 +0800	[thread overview]
Message-ID: <63bba360-473c-47fd-b7b4-06cadf995704@huawei.com> (raw)
In-Reply-To: <977fc7da-b7dc-4518-b7c9-0c492e2508f6@blackwall.org>


在 2025/3/21 16:49, Nikolay Aleksandrov 写道:
> On 3/21/25 06:48, Wang Liang wrote:
>> Following operations can trigger a warning[1]:
>>
>>      ip netns add ns1
>>      ip netns exec ns1 ip link add bond0 type bond mode balance-rr
>>      ip netns exec ns1 ip link set dev bond0 xdp obj af_xdp_kern.o sec xdp
>>      ip netns exec ns1 ip link set bond0 type bond mode broadcast
>>      ip netns del ns1
>>
>> When delete the namespace, dev_xdp_uninstall() is called to remove xdp
>> program on bond dev, and bond_xdp_set() will check the bond mode. If bond
>> mode is changed after attaching xdp program, the warning may occur.
>>
>> Some bond modes (broadcast, etc.) do not support native xdp. Set bond mode
>> with xdp program attached is not good. Add check for xdp program when set
>> bond mode.
>>
>>      [1]
>>      ------------[ cut here ]------------
>>      WARNING: CPU: 0 PID: 11 at net/core/dev.c:9912 unregister_netdevice_many_notify+0x8d9/0x930
>>      Modules linked in:
>>      CPU: 0 UID: 0 PID: 11 Comm: kworker/u4:0 Not tainted 6.14.0-rc4 #107
>>      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
>>      Workqueue: netns cleanup_net
>>      RIP: 0010:unregister_netdevice_many_notify+0x8d9/0x930
>>      Code: 00 00 48 c7 c6 6f e3 a2 82 48 c7 c7 d0 b3 96 82 e8 9c 10 3e ...
>>      RSP: 0018:ffffc90000063d80 EFLAGS: 00000282
>>      RAX: 00000000ffffffa1 RBX: ffff888004959000 RCX: 00000000ffffdfff
>>      RDX: 0000000000000000 RSI: 00000000ffffffea RDI: ffffc90000063b48
>>      RBP: ffffc90000063e28 R08: ffffffff82d39b28 R09: 0000000000009ffb
>>      R10: 0000000000000175 R11: ffffffff82d09b40 R12: ffff8880049598e8
>>      R13: 0000000000000001 R14: dead000000000100 R15: ffffc90000045000
>>      FS:  0000000000000000(0000) GS:ffff888007a00000(0000) knlGS:0000000000000000
>>      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
>>      CR2: 000000000d406b60 CR3: 000000000483e000 CR4: 00000000000006f0
>>      Call Trace:
>>       <TASK>
>>       ? __warn+0x83/0x130
>>       ? unregister_netdevice_many_notify+0x8d9/0x930
>>       ? report_bug+0x18e/0x1a0
>>       ? handle_bug+0x54/0x90
>>       ? exc_invalid_op+0x18/0x70
>>       ? asm_exc_invalid_op+0x1a/0x20
>>       ? unregister_netdevice_many_notify+0x8d9/0x930
>>       ? bond_net_exit_batch_rtnl+0x5c/0x90
>>       cleanup_net+0x237/0x3d0
>>       process_one_work+0x163/0x390
>>       worker_thread+0x293/0x3b0
>>       ? __pfx_worker_thread+0x10/0x10
>>       kthread+0xec/0x1e0
>>       ? __pfx_kthread+0x10/0x10
>>       ? __pfx_kthread+0x10/0x10
>>       ret_from_fork+0x2f/0x50
>>       ? __pfx_kthread+0x10/0x10
>>       ret_from_fork_asm+0x1a/0x30
>>       </TASK>
>>      ---[ end trace 0000000000000000 ]---
>>
>> Fixes: 9e2ee5c7e7c3 ("net, bonding: Add XDP support to the bonding driver")
>> Signed-off-by: Wang Liang <wangliang74@huawei.com>
>> ---
>>   drivers/net/bonding/bond_main.c    | 8 ++++----
>>   drivers/net/bonding/bond_options.c | 3 +++
>>   include/net/bonding.h              | 1 +
>>   3 files changed, 8 insertions(+), 4 deletions(-)
> Just fyi you should include what changed since v1 below the ---.
Got it. Thank you very much for the reminder!
> Anyway, thanks! This is exactly what I meant.
>
> Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
>
>

  reply	other threads:[~2025-03-21  9:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21  4:48 [PATCH net v2] bonding: check xdp prog when set bond mode Wang Liang
2025-03-21  8:22 ` Jussi Maki
2025-03-21  8:49 ` Nikolay Aleksandrov
2025-03-21  9:01   ` Wang Liang [this message]
2025-03-21 10:20 ` Toke Høiland-Jørgensen
2025-03-25 15:10 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63bba360-473c-47fd-b7b4-06cadf995704@huawei.com \
    --to=wangliang74@huawei.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=horms@kernel.org \
    --cc=joamaki@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=jv@jvosburgh.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=yuehaibing@huawei.com \
    --cc=zhangchangzhong@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox