From: Ong Boon Leong <hidden> Date: 2021-03-29 07:57:35
xdp_return_frame() may be called outside of NAPI context to return
xdpf back to page_pool. xdp_return_frame() calls __xdp_return() with
napi_direct = false. For page_pool memory model, __xdp_return() calls
xdp_return_frame_no_direct() unconditionally and below false negative
kernel BUG throw happened under preempt-rt build:
[ 430.450355] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/3884
[ 430.451678] caller is __xdp_return+0x1ff/0x2e0
[ 430.452111] CPU: 0 PID: 3884 Comm: modprobe Tainted: G U E 5.12.0-rc2+ #45
So, this patch fixes the issue by adding "if (napi_direct)" condition
to skip calling xdp_return_frame_no_direct() if napi_direct = false.
Fixes: 2539650fadbf ("xdp: Helpers for disabling napi_direct of xdp_return_frame")
Signed-off-by: Ong Boon Leong <redacted>
---
net/core/xdp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
On Mon, 29 Mar 2021 16:00:39 +0800
Ong Boon Leong [off-list ref] wrote:
xdp_return_frame() may be called outside of NAPI context to return
xdpf back to page_pool. xdp_return_frame() calls __xdp_return() with
napi_direct = false. For page_pool memory model, __xdp_return() calls
xdp_return_frame_no_direct() unconditionally and below false negative
kernel BUG throw happened under preempt-rt build:
[ 430.450355] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/3884
[ 430.451678] caller is __xdp_return+0x1ff/0x2e0
[ 430.452111] CPU: 0 PID: 3884 Comm: modprobe Tainted: G U E 5.12.0-rc2+ #45
So, this patch fixes the issue by adding "if (napi_direct)" condition
to skip calling xdp_return_frame_no_direct() if napi_direct = false.
Fixes: 2539650fadbf ("xdp: Helpers for disabling napi_direct of xdp_return_frame")
Signed-off-by: Ong Boon Leong <redacted>
---
This looks correct to me.
Acked-by: Jesper Dangaard Brouer <redacted>
On Mon, 29 Mar 2021 16:00:39 +0800
Ong Boon Leong [off-list ref] wrote:
quoted
xdp_return_frame() may be called outside of NAPI context to return
xdpf back to page_pool. xdp_return_frame() calls __xdp_return() with
napi_direct = false. For page_pool memory model, __xdp_return() calls
xdp_return_frame_no_direct() unconditionally and below false negative
kernel BUG throw happened under preempt-rt build:
[ 430.450355] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/3884
[ 430.451678] caller is __xdp_return+0x1ff/0x2e0
[ 430.452111] CPU: 0 PID: 3884 Comm: modprobe Tainted: G U E 5.12.0-rc2+ #45
So, this patch fixes the issue by adding "if (napi_direct)" condition
to skip calling xdp_return_frame_no_direct() if napi_direct = false.
Fixes: 2539650fadbf ("xdp: Helpers for disabling napi_direct of xdp_return_frame")
Signed-off-by: Ong Boon Leong <redacted>
---
This looks correct to me.
Acked-by: Jesper Dangaard Brouer <redacted>
Hi Ong,
Patch is in "Changes Requested".
Thus, please send a V2 patch with suggested code changes below.
--Jesper
On Mon, 29 Mar 2021 18:25:08 +0200
Toke Høiland-Jørgensen [off-list ref] wrote:
Jesper Dangaard Brouer [off-list ref] writes:
quoted
On Mon, 29 Mar 2021 16:00:39 +0800
Ong Boon Leong [off-list ref] wrote:
quoted
xdp_return_frame() may be called outside of NAPI context to return
xdpf back to page_pool. xdp_return_frame() calls __xdp_return() with
napi_direct = false. For page_pool memory model, __xdp_return() calls
xdp_return_frame_no_direct() unconditionally and below false negative
kernel BUG throw happened under preempt-rt build:
[ 430.450355] BUG: using smp_processor_id() in preemptible [00000000] code: modprobe/3884
[ 430.451678] caller is __xdp_return+0x1ff/0x2e0
[ 430.452111] CPU: 0 PID: 3884 Comm: modprobe Tainted: G U E 5.12.0-rc2+ #45
So, this patch fixes the issue by adding "if (napi_direct)" condition
to skip calling xdp_return_frame_no_direct() if napi_direct = false.
Fixes: 2539650fadbf ("xdp: Helpers for disabling napi_direct of xdp_return_frame")
Signed-off-by: Ong Boon Leong <redacted>
---
This looks correct to me.
Acked-by: Jesper Dangaard Brouer <redacted>