diff mbox series

[SRU,J:linux-bluefield,1/1] UBUNTU: SAUCE: net/sched: fix ct offload action

Message ID 20230719182940.873851-2-witu@nvidia.com
State New
Headers show
Series UBUNTU: SAUCE: net/sched: fix ct | expand

Commit Message

William Tu July 19, 2023, 6:29 p.m. UTC
From: Paul Blakey <paulb@nvidia.com>

BugLink: https://bugs.launchpad.net/bugs/2028190

The patch fixes the kernel panic due to getting tc flower stats,
when testing conntrack offload with pedit.

[ 226.156222] Unable to handle kernel access to user memory outside uaccess routines at
[ 226.177783] Mem abort info:
[ 226.183408] ESR = 0x0000000096000004
[ 226.190953] EC = 0x25: DABT (current EL), IL = 32 bits
[ 226.201641] SET = 0, FnV = 0
[ 226.207786] EA = 0, S1PTW = 0
[ 226.214095] FSC = 0x04: level 0 translation fault
[ 226.223906] Data abort info:
[ 226.229695] ISV = 0, ISS = 0x00000004
[ 226.237410] CM = 0, WnR = 0
[ 226.243372] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000123f25000
[ 226.256328] [0000000000000090] pgd=0000000000000000, p4d=0000000000000000
[ 226.269984] Internal error: Oops: 96000004 [#1] SMP
[ 226.279779] Modules linked in: act_pedit act_ct nf_flow_table iptable_raw xt_CT xt_tcpudp bpfilter xt_comment xt_mark
[ 226.279938] async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq raid1 raid0 multipath
[ 226.544260] CPU: 2 PID: 4293 Comm: handler3 Tainted: G
[ 226.565581] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS 4.2.0.12795 Jun 30 2023
[ 226.585497] pstate: a0400005 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 226.599481] pc : tcf_action_update_stats+0x8/0xc4
[ 226.608933] lr : mlx5e_tc_act_stats_fill_stats+0xf8/0x19c [mlx5_core]
[ 226.622089] sp : ffff80000e073130
[ 226.628735] x29: ffff80000e073130 x28: 0000000000000008 x27: 0000000000000020
[ 226.643067] x26: ffffffffffffffe0 x25: ffff5913c62dfe71 x24: ffff5913c62dfe00
[ 226.657398] x23: 0000000000000000 x22: 0000000000000000 x21: ffff5913c62dfe70
[ 226.671730] x20: ffff5913c2fc3b00 x19: ffff5913f0058000 x18: 0000000000000014
[ 226.686059] x17: 00000000b96d1a87 x16: ffffc6320acb93e0 x15: 0000000000000000
[ 226.700390] x14: 0000000000000001 x13: 0000000000000000 x12: 0000000000000002
[ 226.714720] x11: 7f7f7f7f7f7f7f7f x10: 0000000000000000 x9 : ffffc631ce0b66ac
[ 226.729052] x8 : ffff80000e073130 x7 : 0000000000000000 x6 : 000000000000000d
[ 226.743384] x5 : 0000000000000c62 x4 : 0000000000000001 x3 : 0000000000000000
[ 226.757715] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
[ 226.772047] Call trace:
[ 226.776947] tcf_action_update_stats+0x8/0xc4
[ 226.785695] mlx5e_tc_act_stats_fill_stats_flow+0x78/0xc0 [mlx5_core]
[ 226.798833] mlx5e_stats_flower+0x394/0x3c0 [mlx5_core]
[ 226.809502] mlx5e_rep_setup_tc_cls_flower+0x8c/0xa0 [mlx5_core]
[ 226.821732] mlx5e_rep_setup_tc_cb+0x74/0xb0 [mlx5_core]
[ 226.832549] tc_setup_cb_call+0xa4/0x160
[ 226.840426] fl_hw_update_stats+0x98/0x164 [cls_flower]
[ 226.850927] fl_dump.part.0+0x224/0x260 [cls_flower]
[ 226.860891] fl_dump+0x20/0x34 [cls_flower]
[ 226.869284] tcf_fill_node+0x164/0x244
[ 226.876803] tfilter_notify+0xc0/0x140
[ 226.884323] tc_new_tfilter+0x454/0x8bc
[ 226.892018] rtnetlink_rcv_msg+0x2e8/0x3cc
[ 226.900245] netlink_rcv_skb+0x64/0x130
[ 226.907942] rtnetlink_rcv+0x20/0x30
[ 226.915110] netlink_unicast+0x2ec/0x360

Fixes: e334c2b80bea ("SAUCE: net/sched: Provide act to offload action")
Signed-off-by: Paul Blakey <paulb@nvidia.com>
Signed-off-by: William Tu <witu@nvidia.com>
---
 net/sched/cls_api.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Bodong Wang July 19, 2023, 7:32 p.m. UTC | #1
Dann, please pull this fix on top of Ubuntu-bluefield-5.15.0-1019.21. 
This is a critical bug fix for our July release. Sorry for the last 
minute turnaround.

On 7/19/2023 1:29 PM, William Tu wrote:
> From: Paul Blakey <paulb@nvidia.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/2028190
> 
> The patch fixes the kernel panic due to getting tc flower stats,
> when testing conntrack offload with pedit.
> 
> [ 226.156222] Unable to handle kernel access to user memory outside uaccess routines at
> [ 226.177783] Mem abort info:
> [ 226.183408] ESR = 0x0000000096000004
> [ 226.190953] EC = 0x25: DABT (current EL), IL = 32 bits
> [ 226.201641] SET = 0, FnV = 0
> [ 226.207786] EA = 0, S1PTW = 0
> [ 226.214095] FSC = 0x04: level 0 translation fault
> [ 226.223906] Data abort info:
> [ 226.229695] ISV = 0, ISS = 0x00000004
> [ 226.237410] CM = 0, WnR = 0
> [ 226.243372] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000123f25000
> [ 226.256328] [0000000000000090] pgd=0000000000000000, p4d=0000000000000000
> [ 226.269984] Internal error: Oops: 96000004 [#1] SMP
> [ 226.279779] Modules linked in: act_pedit act_ct nf_flow_table iptable_raw xt_CT xt_tcpudp bpfilter xt_comment xt_mark
> [ 226.279938] async_raid6_recov async_memcpy async_pq async_xor async_tx xor xor_neon raid6_pq raid1 raid0 multipath
> [ 226.544260] CPU: 2 PID: 4293 Comm: handler3 Tainted: G
> [ 226.565581] Hardware name: https://www.mellanox.com BlueField SoC/BlueField SoC, BIOS 4.2.0.12795 Jun 30 2023
> [ 226.585497] pstate: a0400005 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [ 226.599481] pc : tcf_action_update_stats+0x8/0xc4
> [ 226.608933] lr : mlx5e_tc_act_stats_fill_stats+0xf8/0x19c [mlx5_core]
> [ 226.622089] sp : ffff80000e073130
> [ 226.628735] x29: ffff80000e073130 x28: 0000000000000008 x27: 0000000000000020
> [ 226.643067] x26: ffffffffffffffe0 x25: ffff5913c62dfe71 x24: ffff5913c62dfe00
> [ 226.657398] x23: 0000000000000000 x22: 0000000000000000 x21: ffff5913c62dfe70
> [ 226.671730] x20: ffff5913c2fc3b00 x19: ffff5913f0058000 x18: 0000000000000014
> [ 226.686059] x17: 00000000b96d1a87 x16: ffffc6320acb93e0 x15: 0000000000000000
> [ 226.700390] x14: 0000000000000001 x13: 0000000000000000 x12: 0000000000000002
> [ 226.714720] x11: 7f7f7f7f7f7f7f7f x10: 0000000000000000 x9 : ffffc631ce0b66ac
> [ 226.729052] x8 : ffff80000e073130 x7 : 0000000000000000 x6 : 000000000000000d
> [ 226.743384] x5 : 0000000000000c62 x4 : 0000000000000001 x3 : 0000000000000000
> [ 226.757715] x2 : 0000000000000000 x1 : 0000000000000000 x0 : 0000000000000000
> [ 226.772047] Call trace:
> [ 226.776947] tcf_action_update_stats+0x8/0xc4
> [ 226.785695] mlx5e_tc_act_stats_fill_stats_flow+0x78/0xc0 [mlx5_core]
> [ 226.798833] mlx5e_stats_flower+0x394/0x3c0 [mlx5_core]
> [ 226.809502] mlx5e_rep_setup_tc_cls_flower+0x8c/0xa0 [mlx5_core]
> [ 226.821732] mlx5e_rep_setup_tc_cb+0x74/0xb0 [mlx5_core]
> [ 226.832549] tc_setup_cb_call+0xa4/0x160
> [ 226.840426] fl_hw_update_stats+0x98/0x164 [cls_flower]
> [ 226.850927] fl_dump.part.0+0x224/0x260 [cls_flower]
> [ 226.860891] fl_dump+0x20/0x34 [cls_flower]
> [ 226.869284] tcf_fill_node+0x164/0x244
> [ 226.876803] tfilter_notify+0xc0/0x140
> [ 226.884323] tc_new_tfilter+0x454/0x8bc
> [ 226.892018] rtnetlink_rcv_msg+0x2e8/0x3cc
> [ 226.900245] netlink_rcv_skb+0x64/0x130
> [ 226.907942] rtnetlink_rcv+0x20/0x30
> [ 226.915110] netlink_unicast+0x2ec/0x360
> 
> Fixes: e334c2b80bea ("SAUCE: net/sched: Provide act to offload action")
> Signed-off-by: Paul Blakey <paulb@nvidia.com>
> Signed-off-by: William Tu <witu@nvidia.com>
> ---
>   net/sched/cls_api.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
> index 1637529a6cbf..2ccd66e34dc0 100644
> --- a/net/sched/cls_api.c
> +++ b/net/sched/cls_api.c
> @@ -3844,6 +3844,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
>   				entry->hw_stats = tc_act_hw_stats(act->hw_stats);
>   				entry->miss_cookie =
>   					tcf_exts_miss_cookie_get(miss_cookie_base, i);
> +				entry->act = act;
>   
>   				entry = &flow_action->entries[++j];
>   			}
diff mbox series

Patch

diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index 1637529a6cbf..2ccd66e34dc0 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3844,6 +3844,7 @@  int tc_setup_flow_action(struct flow_action *flow_action,
 				entry->hw_stats = tc_act_hw_stats(act->hw_stats);
 				entry->miss_cookie =
 					tcf_exts_miss_cookie_get(miss_cookie_base, i);
+				entry->act = act;
 
 				entry = &flow_action->entries[++j];
 			}