Skip to content

Commit 89e70ca

Browse files
fixup! Add core version of XDPLua
1 parent bd712d1 commit 89e70ca

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

net/core/dev.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -4425,9 +4425,10 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
44254425
rxqueue = netif_get_rxqueue(skb);
44264426
xdp->rxq = &rxqueue->xdp_rxq;
44274427

4428-
if (xdp_prog) {
4428+
if (xdp_prog)
44294429
act = bpf_prog_run_xdp(xdp_prog, xdp);
4430-
} else {
4430+
4431+
if (act == XDP_PASS || !xdp_prog) {
44314432
cpu = smp_processor_id();
44324433
list_for_each_entry(sc, &lua_state_cpu_list, list) {
44334434
if (sc->cpu == cpu) {

net/core/rtnetlink.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ static const struct nla_policy ifla_xdp_policy[IFLA_XDP_MAX + 1] = {
17991799
[IFLA_XDP_ATTACHED] = { .type = NLA_U8 },
18001800
[IFLA_XDP_FLAGS] = { .type = NLA_U32 },
18011801
[IFLA_XDP_PROG_ID] = { .type = NLA_U32 },
1802-
[IFLA_XDP_LUA_PROG] = { .type = NLA_STRING, .len = 4096 },
1802+
[IFLA_XDP_LUA_PROG] = { .type = NLA_STRING, .len = 8192 },
18031803
[IFLA_XDP_LUA_FUNC] = { .type = NLA_STRING, .len = 256 },
18041804
};
18051805

tools/lib/bpf/netlink.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ int bpf_set_link_xdp_lua_prog(int ifindex, char *lua_prog) {
193193
struct {
194194
struct nlmsghdr nh;
195195
struct ifinfomsg ifinfo;
196-
char attrbuf[4096 + 256];
196+
char attrbuf[8192];
197197
} req;
198198
__u32 nl_pid;
199199

@@ -248,7 +248,7 @@ int bpf_set_link_xdp_lua_func(int ifindex, char *lua_funcname)
248248
struct {
249249
struct nlmsghdr nh;
250250
struct ifinfomsg ifinfo;
251-
char attrbuf[4096 + 256];
251+
char attrbuf[256];
252252
} req;
253253
__u32 nl_pid;
254254

0 commit comments

Comments
 (0)