Skip to content

Commit 3b624c2

Browse files
fixup! fixup! Fix script loading synchronization issue
1 parent 4230a48 commit 3b624c2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

net/core/dev.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -4338,6 +4338,9 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
43384338
bool orig_bcast;
43394339
int hlen, off;
43404340
u32 mac_len;
4341+
#ifdef CONFIG_XDP_LUA
4342+
struct xdplua_create_work *lw;
4343+
#endif /* CONFIG_XDP_LUA */
43414344

43424345
/* Reinjected packets coming from act_mirred or similar should
43434346
* not get XDP generic processing.
@@ -4383,7 +4386,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
43834386
rxqueue = netif_get_rxqueue(skb);
43844387
xdp->rxq = &rxqueue->xdp_rxq;
43854388
#ifdef CONFIG_XDP_LUA
4386-
struct xdplua_create_work *lw = this_cpu_ptr(&luaworks);
4389+
lw = this_cpu_ptr(&luaworks);
43874390

43884391
xdp->skb = skb;
43894392
xdp->L = lw->L;
@@ -4396,7 +4399,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
43964399
lw->init = false;
43974400
spin_unlock(&lw->lock);
43984401
}
4399-
#endif
4402+
#endif /* CONFIG_XDP_LUA */
44004403

44014404
/* check if bpf_xdp_adjust_head was used */
44024405
off = xdp->data - orig_data;
@@ -9903,7 +9906,7 @@ static int __init net_dev_init(void)
99039906
sd->backlog.weight = weight_p;
99049907
#ifdef CONFIG_XDP_LUA
99059908
lw->L = luaL_newstate();
9906-
WARN_ON(!lw->L)
9909+
WARN_ON(!lw->L);
99079910

99089911
if (!lw->L)
99099912
continue;

net/core/filter.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5928,7 +5928,7 @@ BPF_CALL_4(bpf_lua_pcall, struct xdp_buff *, ctx, char *, funcname,
59285928
}
59295929

59305930
clean_state:
5931-
lua_settop(base);
5931+
lua_settop(ctx->L, base);
59325932
return num_rets;
59335933
}
59345934

0 commit comments

Comments
 (0)