Skip to content

Commit

Permalink
fixup! fixup! Fix script loading synchronization issue
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorNogueiraRio committed Mar 18, 2020
1 parent 4230a48 commit 3b624c2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4338,6 +4338,9 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
bool orig_bcast;
int hlen, off;
u32 mac_len;
#ifdef CONFIG_XDP_LUA
struct xdplua_create_work *lw;
#endif /* CONFIG_XDP_LUA */

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

xdp->skb = skb;
xdp->L = lw->L;
Expand All @@ -4396,7 +4399,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
lw->init = false;
spin_unlock(&lw->lock);
}
#endif
#endif /* CONFIG_XDP_LUA */

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

if (!lw->L)
continue;
Expand Down
2 changes: 1 addition & 1 deletion net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -5928,7 +5928,7 @@ BPF_CALL_4(bpf_lua_pcall, struct xdp_buff *, ctx, char *, funcname,
}

clean_state:
lua_settop(base);
lua_settop(ctx->L, base);
return num_rets;
}

Expand Down

0 comments on commit 3b624c2

Please sign in to comment.