History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Pull networking fixes from David Miller: 1) Verify netlink attributes properly in nf_queue, from Eric Dumazet. 2) Need to bump memory lock rlimit for test_sockmap bpf test, from Yonghong Song. 3) Fix VLAN handling in lan78xx driver, from Dave Stevenson. 4) Fix uninitialized read in nf_log, from Jann Horn. 5) Fix raw command length parsing in mlx5, from Alex Vesker. 6) Cleanup loopback RDS connections upon netns deletion, from Sowmini Varadhan. 7) Fix regressions in FIB rule matching during create, from Jason A. Donenfeld and Roopa Prabhu. 8) Fix mpls ether type detection in nfp, from Pieter Jansen van Vuuren. 9) More bpfilter build fixes/adjustments from Masahiro Yamada. 10) Fix XDP_{TX,REDIRECT} flushing in various drivers, from Jesper Dangaard Brouer. 11) fib_tests.sh file permissions were broken, from Shuah Khan. 12) Make sure BH/preemption is disabled in data path of mac80211, from Denis Kenzior. 13) Don't ignore nla_parse_nested() return values in nl80211, from Johannes berg. 14) Properly account sock objects ot kmemcg, from Shakeel Butt. 15) Adjustments to setting bpf program permissions to read-only, from Daniel Borkmann. 16) TCP Fast Open key endianness was broken, it always took on the host endiannness. Whoops. Explicitly make it little endian. From Yuching Cheng. 17) Fix prefix route setting for link local addresses in ipv6, from David Ahern. 18) Potential Spectre v1 in zatm driver, from Gustavo A. R. Silva. 19) Various bpf sockmap fixes, from John Fastabend. 20) Use after free for GRO with ESP, from Sabrina Dubroca. 21) Passing bogus flags to crypto_alloc_shash() in ipv6 SR code, from Eric Biggers. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (87 commits) qede: Adverstise software timestamp caps when PHC is not available. qed: Fix use of incorrect size in memcpy call. qed: Fix setting of incorrect eswitch mode. qed: Limit msix vectors in kdump kernel to the minimum required count. ipvlan: call dev_change_flags when ipvlan mode is reset ipv6: sr: fix passing wrong flags to crypto_alloc_shash() net: fix use-after-free in GRO with ESP tcp: prevent bogus FRTO undos with non-SACK flows bpf: sockhash, add release routine bpf: sockhash fix omitted bucket lock in sock_close bpf: sockmap, fix smap_list_map_remove when psock is in many maps bpf: sockmap, fix crash when ipv6 sock is added net: fib_rules: bring back rule_exists to match rule during add hv_netvsc: split sub-channel setup into async and sync net: use dev_change_tx_queue_len() for SIOCSIFTXQLEN atm: zatm: Fix potential Spectre v1 s390/qeth: consistently re-enable device features s390/qeth: don't clobber buffer on async TX completion s390/qeth: avoid using is_multicast_ether_addr_64bits on (u8 *)[6] s390/qeth: fix race when setting MAC address ...

Linus Torvalds committed 8 years ago

Commit 4e33d7d2 parents 021c917 e48e097114 files · +1249 −624Browse files

Showing the changes to include/uapi/linux (1 of 114 files). Show all

Unified · Split

include/uapi/linux/bpf.h+23−5
@@ -1857,7 +1857,8 @@ union bpf_attr { · 1856 unmodified lines
18571857 * is resolved), the nexthop address is returned in ipv4_dst
18581858 * or ipv6_dst based on family, smac is set to mac address of
18591859 * egress device, dmac is set to nexthop mac address, rt_metric
1860− * is set to metric from route (IPv4/IPv6 only).
1860+ * is set to metric from route (IPv4/IPv6 only), and ifindex
1861+ * is set to the device index of the nexthop from the FIB lookup.
18611862 *
18621863 * *plen* argument is the size of the passed in struct.
18631864 * *flags* argument can be a combination of one or more of the
@@ -1873,9 +1874,10 @@ union bpf_attr { · 9 unmodified lines
18731874 * *ctx* is either **struct xdp_md** for XDP programs or
18741875 * **struct sk_buff** tc cls_act programs.
18751876 * Return
1876− * Egress device index on success, 0 if packet needs to continue
1877− * up the stack for further processing or a negative error in case
1878− * of failure.
1877+ * * < 0 if any input argument is invalid
1878+ * * 0 on success (packet is forwarded, nexthop neighbor exists)
1879+ * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the
1880+ * * packet is not forwarded or needs assist from full stack
18791881 *
18801882 * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags)
18811883 * Description
@@ -2612,6 +2614,18 @@ struct bpf_raw_tracepoint_args { · 730 unmodified lines
26122614 #define BPF_FIB_LOOKUP_DIRECT BIT(0)
26132615 #define BPF_FIB_LOOKUP_OUTPUT BIT(1)
26142616
2617+enum {
2618+ BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */
2619+ BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */
2620+ BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */
2621+ BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */
2622+ BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */
2623+ BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */
2624+ BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */
2625+ BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */
2626+ BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */
2627+};
2628+
26152629 struct bpf_fib_lookup {
26162630 /* input: network family for lookup (AF_INET, AF_INET6)
26172631 * output: network family of egress nexthop
@@ -2625,7 +2639,11 @@ struct bpf_fib_lookup { · 7 unmodified lines
26252639
26262640 /* total length of packet from network header - used for MTU check */
26272641 __u16 tot_len;
2628− __u32 ifindex; /* L3 device index for lookup */
2642+
2643+ /* input: L3 device index for lookup
2644+ * output: device index from FIB lookup
2645+ */
2646+ __u32 ifindex;
26292647
26302648 union {
26312649 /* inputs to lookup */