Commit c4f7730b authored by Jakub Kicinski's avatar Jakub Kicinski Committed by Daniel Borkmann

nfp: bpf: round up the size of the stack

Kernel enforces the alignment of the bottom of the stack, NFP
deals with positive offsets better so we should align the top
of the stack.  Round the stack size to NFP word size (4B).
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 8c6a6d98
...@@ -147,7 +147,7 @@ int nfp_bpf_translate(struct nfp_app *app, struct nfp_net *nn, ...@@ -147,7 +147,7 @@ int nfp_bpf_translate(struct nfp_app *app, struct nfp_net *nn,
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
nfp_prog->stack_depth = prog->aux->stack_depth; nfp_prog->stack_depth = round_up(prog->aux->stack_depth, 4);
nfp_prog->start_off = nn_readw(nn, NFP_NET_CFG_BPF_START); nfp_prog->start_off = nn_readw(nn, NFP_NET_CFG_BPF_START);
nfp_prog->tgt_done = nn_readw(nn, NFP_NET_CFG_BPF_DONE); nfp_prog->tgt_done = nn_readw(nn, NFP_NET_CFG_BPF_DONE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment