Skip to content

Commit 38ca930

Browse files
borkmannAlexei Starovoitov
authored andcommitted
bpf, arm32: save 4 bytes of unneeded stack space
The extra skb_copy_bits() buffer is not used anymore, therefore remove the extra 4 byte stack space requirement. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent 3625600 commit 38ca930

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎arch/arm/net/bpf_jit_32.c‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -234,18 +234,11 @@ static void jit_fill_hole(void *area, unsigned int size)
234234
#define SCRATCH_SIZE 80
235235

236236
/* total stack size used in JITed code */
237-
#define _STACK_SIZE \
238-
(ctx->prog->aux->stack_depth + \
239-
+ SCRATCH_SIZE + \
240-
+ 4 /* extra for skb_copy_bits buffer */)
241-
242-
#define STACK_SIZE ALIGN(_STACK_SIZE, STACK_ALIGNMENT)
237+
#define _STACK_SIZE (ctx->prog->aux->stack_depth + SCRATCH_SIZE)
238+
#define STACK_SIZE ALIGN(_STACK_SIZE, STACK_ALIGNMENT)
243239

244240
/* Get the offset of eBPF REGISTERs stored on scratch space. */
245-
#define STACK_VAR(off) (STACK_SIZE-off-4)
246-
247-
/* Offset of skb_copy_bits buffer */
248-
#define SKB_BUFFER STACK_VAR(SCRATCH_SIZE)
241+
#define STACK_VAR(off) (STACK_SIZE - off)
249242

250243
#if __LINUX_ARM_ARCH__ < 7
251244

0 commit comments

Comments
 (0)