Skip to content

Commit d4069fe

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next
Daniel Borkmann says: ==================== pull-request: bpf-next 2018-03-31 The following pull-request contains BPF updates for your *net-next* tree. The main changes are: 1) Add raw BPF tracepoint API in order to have a BPF program type that can access kernel internal arguments of the tracepoints in their raw form similar to kprobes based BPF programs. This infrastructure also adds a new BPF_RAW_TRACEPOINT_OPEN command to BPF syscall which returns an anon-inode backed fd for the tracepoint object that allows for automatic detach of the BPF program resp. unregistering of the tracepoint probe on fd release, from Alexei. 2) Add new BPF cgroup hooks at bind() and connect() entry in order to allow BPF programs to reject, inspect or modify user space passed struct sockaddr, and as well a hook at post bind time once the port has been allocated. They are used in FB's container management engine for implementing policy, replacing fragile LD_PRELOAD wrapper intercepting bind() and connect() calls that only works in limited scenarios like glibc based apps but not for other runtimes in containerized applications, from Andrey. 3) BPF_F_INGRESS flag support has been added to sockmap programs for their redirect helper call bringing it in line with cls_bpf based programs. Support is added for both variants of sockmap programs, meaning for tx ULP hooks as well as recv skb hooks, from John. 4) Various improvements on BPF side for the nfp driver, besides others this work adds BPF map update and delete helper call support from the datapath, JITing of 32 and 64 bit XADD instructions as well as offload support of bpf_get_prandom_u32() call. Initial implementation of nfp packet cache has been tackled that optimizes memory access (see merge commit for further details), from Jakub and Jiong. 5) Removal of struct bpf_verifier_env argument from the print_bpf_insn() API has been done in order to prepare to use print_bpf_insn() soon out of perf tool directly. This makes the print_bpf_insn() API more generic and pushes the env into private data. bpftool is adjusted as well with the print_bpf_insn() argument removal, from Jiri. 6) Couple of cleanups and prep work for the upcoming BTF (BPF Type Format). The latter will reuse the current BPF verifier log as well, thus bpf_verifier_log() is further generalized, from Martin. 7) For bpf_getsockopt() and bpf_setsockopt() helpers, IPv4 IP_TOS read and write support has been added in similar fashion to existing IPv6 IPV6_TCLASS socket option we already have, from Nikita. 8) Fixes in recent sockmap scatterlist API usage, which did not use sg_init_table() for initialization thus triggering a BUG_ON() in scatterlist API when CONFIG_DEBUG_SG was enabled. This adds and uses a small helper sg_init_marker() to properly handle the affected cases, from Prashant. 9) Let the BPF core follow IDR code convention and therefore use the idr_preload() and idr_preload_end() helpers, which would also help idr_alloc_cyclic() under GFP_ATOMIC to better succeed under memory pressure, from Shaohua. 10) Last but not least, a spelling fix in an error message for the BPF cookie UID helper under BPF sample code, from Colin. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 70ae722 + 7828f20 commit d4069fe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+4265
-399
lines changed

drivers/infiniband/hw/hfi1/file_ops.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ static int get_ctxt_info(struct hfi1_filedata *fd, unsigned long arg, u32 len)
11531153
cinfo.sdma_ring_size = fd->cq->nentries;
11541154
cinfo.rcvegr_size = uctxt->egrbufs.rcvtid_size;
11551155

1156-
trace_hfi1_ctxt_info(uctxt->dd, uctxt->ctxt, fd->subctxt, cinfo);
1156+
trace_hfi1_ctxt_info(uctxt->dd, uctxt->ctxt, fd->subctxt, &cinfo);
11571157
if (copy_to_user((void __user *)arg, &cinfo, len))
11581158
return -EFAULT;
11591159

drivers/infiniband/hw/hfi1/trace_ctxts.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ TRACE_EVENT(hfi1_uctxtdata,
106106
TRACE_EVENT(hfi1_ctxt_info,
107107
TP_PROTO(struct hfi1_devdata *dd, unsigned int ctxt,
108108
unsigned int subctxt,
109-
struct hfi1_ctxt_info cinfo),
109+
struct hfi1_ctxt_info *cinfo),
110110
TP_ARGS(dd, ctxt, subctxt, cinfo),
111111
TP_STRUCT__entry(DD_DEV_ENTRY(dd)
112112
__field(unsigned int, ctxt)
@@ -120,11 +120,11 @@ TRACE_EVENT(hfi1_ctxt_info,
120120
TP_fast_assign(DD_DEV_ASSIGN(dd);
121121
__entry->ctxt = ctxt;
122122
__entry->subctxt = subctxt;
123-
__entry->egrtids = cinfo.egrtids;
124-
__entry->rcvhdrq_cnt = cinfo.rcvhdrq_cnt;
125-
__entry->rcvhdrq_size = cinfo.rcvhdrq_entsize;
126-
__entry->sdma_ring_size = cinfo.sdma_ring_size;
127-
__entry->rcvegr_size = cinfo.rcvegr_size;
123+
__entry->egrtids = cinfo->egrtids;
124+
__entry->rcvhdrq_cnt = cinfo->rcvhdrq_cnt;
125+
__entry->rcvhdrq_size = cinfo->rcvhdrq_entsize;
126+
__entry->sdma_ring_size = cinfo->sdma_ring_size;
127+
__entry->rcvegr_size = cinfo->rcvegr_size;
128128
),
129129
TP_printk("[%s] ctxt %u:%u " CINFO_FMT,
130130
__get_str(dev),

drivers/net/ethernet/netronome/nfp/bpf/cmsg.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ nfp_bpf_cmsg_communicate(struct nfp_app_bpf *bpf, struct sk_buff *skb,
218218
return skb;
219219

220220
hdr = (struct cmsg_hdr *)skb->data;
221-
/* 0 reply_size means caller will do the validation */
222-
if (reply_size && skb->len != reply_size) {
223-
cmsg_warn(bpf, "cmsg drop - wrong size %d != %d!\n",
224-
skb->len, reply_size);
225-
goto err_free;
226-
}
227221
if (hdr->type != __CMSG_REPLY(type)) {
228222
cmsg_warn(bpf, "cmsg drop - wrong type 0x%02x != 0x%02lx!\n",
229223
hdr->type, __CMSG_REPLY(type));
230224
goto err_free;
231225
}
226+
/* 0 reply_size means caller will do the validation */
227+
if (reply_size && skb->len != reply_size) {
228+
cmsg_warn(bpf, "cmsg drop - type 0x%02x wrong size %d != %d!\n",
229+
type, skb->len, reply_size);
230+
goto err_free;
231+
}
232232

233233
return skb;
234234
err_free:

drivers/net/ethernet/netronome/nfp/bpf/fw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ enum bpf_cap_tlv_type {
4141
NFP_BPF_CAP_TYPE_FUNC = 1,
4242
NFP_BPF_CAP_TYPE_ADJUST_HEAD = 2,
4343
NFP_BPF_CAP_TYPE_MAPS = 3,
44+
NFP_BPF_CAP_TYPE_RANDOM = 4,
4445
};
4546

4647
struct nfp_bpf_cap_tlv_func {

0 commit comments

Comments
 (0)