]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/net/ethernet/netronome/nfp/bpf/fw.h
nfp: bpf: perf event output helpers support
[linux.git] / drivers / net / ethernet / netronome / nfp / bpf / fw.h
index 39639ac28b01785c64c6333d5e3bdde1ec132b32..3dbc21653ce574abb833bdcbdf35293bbd0c7371 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2017 Netronome Systems, Inc.
+ * Copyright (C) 2017-2018 Netronome Systems, Inc.
  *
  * This software is dual licensed under the GNU General License Version 2,
  * June 1991 as shown in the file COPYING in the top-level directory of this
 #include <linux/bitops.h>
 #include <linux/types.h>
 
+/* Kernel's enum bpf_reg_type is not uABI so people may change it breaking
+ * our FW ABI.  In that case we will do translation in the driver.
+ */
+#define NFP_BPF_SCALAR_VALUE           1
+#define NFP_BPF_MAP_VALUE              4
+#define NFP_BPF_STACK                  6
+#define NFP_BPF_PACKET_DATA            8
+
 enum bpf_cap_tlv_type {
        NFP_BPF_CAP_TYPE_FUNC           = 1,
        NFP_BPF_CAP_TYPE_ADJUST_HEAD    = 2,
@@ -81,6 +89,7 @@ enum nfp_bpf_cmsg_type {
        CMSG_TYPE_MAP_DELETE    = 5,
        CMSG_TYPE_MAP_GETNEXT   = 6,
        CMSG_TYPE_MAP_GETFIRST  = 7,
+       CMSG_TYPE_BPF_EVENT     = 8,
        __CMSG_TYPE_MAP_MAX,
 };
 
@@ -155,4 +164,13 @@ struct cmsg_reply_map_op {
        __be32 resv;
        struct cmsg_key_value_pair elem[0];
 };
+
+struct cmsg_bpf_event {
+       struct cmsg_hdr hdr;
+       __be32 cpu_id;
+       __be64 map_ptr;
+       __be32 data_size;
+       __be32 pkt_size;
+       u8 data[0];
+};
 #endif