Skip to content

Commit

Permalink
fixup! Add core version of XDPLua
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorNogueiraRio committed Aug 25, 2019
1 parent ae1ab47 commit d23c42c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -4437,9 +4437,10 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
rxqueue = netif_get_rxqueue(skb);
xdp->rxq = &rxqueue->xdp_rxq;

if (xdp_prog) {
if (xdp_prog)
act = bpf_prog_run_xdp(xdp_prog, xdp);
} else {

if (act == XDP_PASS || !xdp_prog) {
cpu = smp_processor_id();
list_for_each_entry(sc, &lua_state_cpu_list, list) {
if (sc->cpu == cpu) {
Expand Down
2 changes: 1 addition & 1 deletion net/core/rtnetlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,7 @@ static const struct nla_policy ifla_xdp_policy[IFLA_XDP_MAX + 1] = {
[IFLA_XDP_ATTACHED] = { .type = NLA_U8 },
[IFLA_XDP_FLAGS] = { .type = NLA_U32 },
[IFLA_XDP_PROG_ID] = { .type = NLA_U32 },
[IFLA_XDP_LUA_PROG] = { .type = NLA_STRING, .len = 4096 },
[IFLA_XDP_LUA_PROG] = { .type = NLA_STRING, .len = 8192 },
[IFLA_XDP_LUA_FUNC] = { .type = NLA_STRING, .len = 256 },
};

Expand Down
4 changes: 2 additions & 2 deletions tools/lib/bpf/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ int bpf_set_link_xdp_lua_prog(int ifindex, char *lua_prog) {
struct {
struct nlmsghdr nh;
struct ifinfomsg ifinfo;
char attrbuf[4096 + 256];
char attrbuf[8192];
} req;
__u32 nl_pid;

Expand Down Expand Up @@ -248,7 +248,7 @@ int bpf_set_link_xdp_lua_func(int ifindex, char *lua_funcname)
struct {
struct nlmsghdr nh;
struct ifinfomsg ifinfo;
char attrbuf[4096 + 256];
char attrbuf[256];
} req;
__u32 nl_pid;

Expand Down

0 comments on commit d23c42c

Please sign in to comment.