nfp: bpf: allow receiving perf events on data queues
Control queue is fairly low latency, and requires SKB allocations, which means we can't even reach 0.5Msps with perf events. Allow perf events to be delivered to data queues. This allows us to not only use multiple queues, but also receive and deliver to user space more than 5Msps per queue (Xeon E5-2630 v4 2.20GHz, no retpolines). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
This commit is contained in:
parent
20c5420421
commit
0958762748
|
@ -468,3 +468,21 @@ err_unlock:
|
|||
err_free:
|
||||
dev_kfree_skb_any(skb);
|
||||
}
|
||||
|
||||
void
|
||||
nfp_bpf_ctrl_msg_rx_raw(struct nfp_app *app, const void *data, unsigned int len)
|
||||
{
|
||||
struct nfp_app_bpf *bpf = app->priv;
|
||||
const struct cmsg_hdr *hdr = data;
|
||||
|
||||
if (unlikely(len < sizeof(struct cmsg_reply_map_simple))) {
|
||||
cmsg_warn(bpf, "cmsg drop - too short %d!\n", len);
|
||||
return;
|
||||
}
|
||||
|
||||
if (hdr->type == CMSG_TYPE_BPF_EVENT)
|
||||
nfp_bpf_event_output(bpf, data, len);
|
||||
else
|
||||
cmsg_warn(bpf, "cmsg drop - msg type %d with raw buffer!\n",
|
||||
hdr->type);
|
||||
}
|
||||
|
|
|
@ -490,6 +490,7 @@ const struct nfp_app_type app_bpf = {
|
|||
.vnic_free = nfp_bpf_vnic_free,
|
||||
|
||||
.ctrl_msg_rx = nfp_bpf_ctrl_msg_rx,
|
||||
.ctrl_msg_rx_raw = nfp_bpf_ctrl_msg_rx_raw,
|
||||
|
||||
.setup_tc = nfp_bpf_setup_tc,
|
||||
.bpf = nfp_ndo_bpf,
|
||||
|
|
|
@ -505,4 +505,7 @@ int nfp_bpf_event_output(struct nfp_app_bpf *bpf, const void *data,
|
|||
unsigned int len);
|
||||
|
||||
void nfp_bpf_ctrl_msg_rx(struct nfp_app *app, struct sk_buff *skb);
|
||||
void
|
||||
nfp_bpf_ctrl_msg_rx_raw(struct nfp_app *app, const void *data,
|
||||
unsigned int len);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue