github.com/datadog/cilium@v1.6.12/bpf/probes/raw_lpm_map.t (about)

     1  /* Tests for availability of kernel commits (4.11+):
     2   *
     3   * b95a5c4db09b ("bpf: add a longest prefix match trie map implementation")
     4   */
     5  	{
     6  		.emits	= "HAVE_LPM_MAP_TYPE",
     7  		.type	= BPF_PROG_TYPE_SCHED_CLS,
     8  		.insns	= {
     9  			BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
    10  			BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
    11  			BPF_ST_MEM(BPF_DW, BPF_REG_2, 0, 0),
    12  			BPF_LD_MAP_FD(BPF_REG_1, 0),
    13  			BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem),
    14  			BPF_MOV64_IMM(BPF_REG_0, 0),
    15  			BPF_EXIT_INSN(),
    16  		},
    17  		.fixup_map = {
    18  			{
    19  				.off		= 3,
    20  				.type		= BPF_MAP_TYPE_LPM_TRIE,
    21  				.size_key	= 8,
    22  				.size_val	= 4,
    23  				.flags		= BPF_F_NO_PREALLOC,
    24  			},
    25  		},
    26  		.warn = "Your kernel doesn't support LPM trie maps for BPF, "
    27  		        "thus switching back to using hash table for CIDR "
    28  			"policies. Recommendation is to run 4.11+ kernels.",
    29  	},