History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next

Daniel Borkmann says: ==================== pull-request: bpf-next 2019-07-03 The following pull-request contains BPF updates for your *net-next* tree. There is a minor merge conflict in mlx5 due to 8960b38932be ("linux/dim: Rename externally used net_dim members") which has been pulled into your tree in the meantime, but resolution seems not that bad ... getting current bpf-next out now before there's coming more on mlx5. ;) I'm Cc'ing Saeed just so he's aware of the resolution below: ** First conflict in drivers/net/ethernet/mellanox/mlx5/core/en_main.c: <<<<<<< HEAD static int mlx5e_open_cq(struct mlx5e_channel *c, struct dim_cq_moder moder, struct mlx5e_cq_param *param, struct mlx5e_cq *cq) ======= int mlx5e_open_cq(struct mlx5e_channel *c, struct net_dim_cq_moder moder, struct mlx5e_cq_param *param, struct mlx5e_cq *cq) >>>>>>> e5a3e259ef239f443951d401db10db7d426c9497 Resolution is to take the second chunk and rename net_dim_cq_moder into dim_cq_moder. Also the signature for mlx5e_open_cq() in ... drivers/net/ethernet/mellanox/mlx5/core/en.h +977 ... and in mlx5e_open_xsk() ... drivers/net/ethernet/mellanox/mlx5/core/en/xsk/setup.c +64 ... needs the same rename from net_dim_cq_moder into dim_cq_moder. ** Second conflict in drivers/net/ethernet/mellanox/mlx5/core/en_main.c: <<<<<<< HEAD int cpu = cpumask_first(mlx5_comp_irq_get_affinity_mask(priv->mdev, ix)); struct dim_cq_moder icocq_moder = {0, 0}; struct net_device *netdev = priv->netdev; struct mlx5e_channel *c; unsigned int irq; ======= struct net_dim_cq_moder icocq_moder = {0, 0}; >>>>>>> e5a3e259ef239f443951d401db10db7d426c9497 Take the second chunk and rename net_dim_cq_moder into dim_cq_moder as well. Let me know if you run into any issues. Anyway, the main changes are: 1) Long-awaited AF_XDP support for mlx5e driver, from Maxim. 2) Addition of two new per-cgroup BPF hooks for getsockopt and setsockopt along with a new sockopt program type which allows more fine-grained pass/reject settings for containers. Also add a sock_ops callback that can be selectively enabled on a per-socket basis and is executed for every RTT to help tracking TCP statistics, both features from Stanislav. 3) Follow-up fix from loops in precision tracking which was not propagating precision marks and as a result verifier assumed that some branches were not taken and therefore wrongly removed as dead code, from Alexei. 4) Fix BPF cgroup release synchronization race which could lead to a double-free if a leaf's cgroup_bpf object is released and a new BPF program is attached to the one of ancestor cgroups in parallel, from Roman. 5) Support for bulking XDP_TX on veth devices which improves performance in some cases by around 9%, from Toshiaki. 6) Allow for lookups into BPF devmap and improve feedback when calling into bpf_redirect_map() as lookup is now performed right away in the helper itself, from Toke. 7) Add support for fq's Earliest Departure Time to the Host Bandwidth Manager (HBM) sample BPF program, from Lawrence. 8) Various cleanups and minor fixes all over the place from many others. ====================

David S. Miller committed 7 years ago

Commit c4cde582 parents e2c7469 e5a3e2598 files · +6197 −841Browse files

Showing the changes to include/uapi/linux (2 of 98 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/bpf.h +30 −3
  2. include/uapi/linux/if_xdp.h +8 −0
include/uapi/linux/bpf.h+30−3
@@ -170,6 +170,7 @@ enum bpf_prog_type { · 169 unmodified lines
170 BPF_PROG_TYPE_FLOW_DISSECTOR,170 BPF_PROG_TYPE_FLOW_DISSECTOR,
171 BPF_PROG_TYPE_CGROUP_SYSCTL,171 BPF_PROG_TYPE_CGROUP_SYSCTL,
172 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,172 BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE,
173 BPF_PROG_TYPE_CGROUP_SOCKOPT,
173};174};
174 175
175enum bpf_attach_type {176enum bpf_attach_type {
@@ -194,6 +195,8 @@ enum bpf_attach_type { · 18 unmodified lines
194 BPF_CGROUP_SYSCTL,195 BPF_CGROUP_SYSCTL,
195 BPF_CGROUP_UDP4_RECVMSG,196 BPF_CGROUP_UDP4_RECVMSG,
196 BPF_CGROUP_UDP6_RECVMSG,197 BPF_CGROUP_UDP6_RECVMSG,
198 BPF_CGROUP_GETSOCKOPT,
199 BPF_CGROUP_SETSOCKOPT,
197 __MAX_BPF_ATTACH_TYPE200 __MAX_BPF_ATTACH_TYPE
198};201};
199 202
@@ -1568,8 +1571,11 @@ union bpf_attr { · 1368 unmodified lines
1568 * but this is only implemented for native XDP (with driver1571 * but this is only implemented for native XDP (with driver
1569 * support) as of this writing).1572 * support) as of this writing).
1570 *1573 *
1571 * All values for *flags* are reserved for future usage, and must1574 * The lower two bits of *flags* are used as the return code if
1572 * be left at zero.1575 * the map lookup fails. This is so that the return value can be
1576 * one of the XDP program return codes up to XDP_TX, as chosen by
1577 * the caller. Any higher bits in the *flags* argument must be
1578 * unset.
1573 *1579 *
1574 * When used to redirect packets to net devices, this helper1580 * When used to redirect packets to net devices, this helper
1575 * provides a high performance increase over **bpf_redirect**\ ().1581 * provides a high performance increase over **bpf_redirect**\ ().
@@ -1764,6 +1770,7 @@ union bpf_attr { · 188 unmodified lines
1764 * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out)1770 * * **BPF_SOCK_OPS_RTO_CB_FLAG** (retransmission time out)
1765 * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission)1771 * * **BPF_SOCK_OPS_RETRANS_CB_FLAG** (retransmission)
1766 * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change)1772 * * **BPF_SOCK_OPS_STATE_CB_FLAG** (TCP state change)
1773 * * **BPF_SOCK_OPS_RTT_CB_FLAG** (every RTT)
1767 *1774 *
1768 * Therefore, this function can be used to clear a callback flag by1775 * Therefore, this function can be used to clear a callback flag by
1769 * setting the appropriate bit to zero. e.g. to disable the RTO1776 * setting the appropriate bit to zero. e.g. to disable the RTO
@@ -3066,6 +3073,12 @@ struct bpf_tcp_sock { · 1296 unmodified lines
3066 * sum(delta(snd_una)), or how many bytes3073 * sum(delta(snd_una)), or how many bytes
3067 * were acked.3074 * were acked.
3068 */3075 */
3076 __u32 dsack_dups; /* RFC4898 tcpEStatsStackDSACKDups
3077 * total number of DSACK blocks received
3078 */
3079 __u32 delivered; /* Total data packets delivered incl. rexmits */
3080 __u32 delivered_ce; /* Like the above but only ECE marked packets */
3081 __u32 icsk_retransmits; /* Number of unrecovered [RTO] timeouts */
3069};3082};
3070 3083
3071struct bpf_sock_tuple {3084struct bpf_sock_tuple {
@@ -3308,7 +3321,8 @@ struct bpf_sock_ops { · 236 unmodified lines
3308#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0)3321#define BPF_SOCK_OPS_RTO_CB_FLAG (1<<0)
3309#define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1)3322#define BPF_SOCK_OPS_RETRANS_CB_FLAG (1<<1)
3310#define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2)3323#define BPF_SOCK_OPS_STATE_CB_FLAG (1<<2)
3311#define BPF_SOCK_OPS_ALL_CB_FLAGS 0x7 /* Mask of all currently3324#define BPF_SOCK_OPS_RTT_CB_FLAG (1<<3)
3325#define BPF_SOCK_OPS_ALL_CB_FLAGS 0xF /* Mask of all currently
3312 * supported cb flags3326 * supported cb flags
3313 */3327 */
3314 3328
@@ -3363,6 +3377,8 @@ enum { · 48 unmodified lines
3363 BPF_SOCK_OPS_TCP_LISTEN_CB, /* Called on listen(2), right after3377 BPF_SOCK_OPS_TCP_LISTEN_CB, /* Called on listen(2), right after
3364 * socket transition to LISTEN state.3378 * socket transition to LISTEN state.
3365 */3379 */
3380 BPF_SOCK_OPS_RTT_CB, /* Called on every RTT.
3381 */
3366};3382};
3367 3383
3368/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect3384/* List of TCP states. There is a build check in net/ipv4/tcp.c to detect
@@ -3541,4 +3557,15 @@ struct bpf_sysctl { · 172 unmodified lines
3541 */3557 */
3542};3558};
3543 3559
3560struct bpf_sockopt {
3561 __bpf_md_ptr(struct bpf_sock *, sk);
3562 __bpf_md_ptr(void *, optval);
3563 __bpf_md_ptr(void *, optval_end);
3564
3565 __s32 level;
3566 __s32 optname;
3567 __s32 optlen;
3568 __s32 retval;
3569};
3570
3544#endif /* _UAPI__LINUX_BPF_H__ */3571#endif /* _UAPI__LINUX_BPF_H__ */
include/uapi/linux/if_xdp.h+8−0
@@ -46,6 +46,7 @@ struct xdp_mmap_offsets { · 45 unmodified lines
46#define XDP_UMEM_FILL_RING 546#define XDP_UMEM_FILL_RING 5
47#define XDP_UMEM_COMPLETION_RING 647#define XDP_UMEM_COMPLETION_RING 6
48#define XDP_STATISTICS 748#define XDP_STATISTICS 7
49#define XDP_OPTIONS 8
49 50
50struct xdp_umem_reg {51struct xdp_umem_reg {
51 __u64 addr; /* Start of packet data area */52 __u64 addr; /* Start of packet data area */
@@ -60,6 +61,13 @@ struct xdp_statistics { · 8 unmodified lines
60 __u64 tx_invalid_descs; /* Dropped due to invalid descriptor */61 __u64 tx_invalid_descs; /* Dropped due to invalid descriptor */
61};62};
62 63
64struct xdp_options {
65 __u32 flags;
66};
67
68/* Flags for the flags field of struct xdp_options */
69#define XDP_OPTIONS_ZEROCOPY (1 << 0)
70
63/* Pgoff for mmaping the rings */71/* Pgoff for mmaping the rings */
64#define XDP_PGOFF_RX_RING 072#define XDP_PGOFF_RX_RING 0
65#define XDP_PGOFF_TX_RING 0x8000000073#define XDP_PGOFF_TX_RING 0x80000000