github.phpd.cn/cilium/cilium@v1.6.12/bpf/probes/raw_lru_map.t (about)

     1  /* Tests for availability of kernel commits (4.10+):
     2   *
     3   * 961578b63474 ("bpf: Add percpu LRU list")
     4   * 3a08c2fd7634 ("bpf: LRU List")
     5   */
     6  	{
     7  		.emits	= "HAVE_LRU_MAP_TYPE",
     8  		.type	= BPF_PROG_TYPE_SCHED_CLS,
     9  		.insns	= {
    10  			BPF_MOV64_REG(BPF_REG_2, BPF_REG_10),
    11  			BPF_ALU64_IMM(BPF_ADD, BPF_REG_2, -8),
    12  			BPF_ST_MEM(BPF_DW, BPF_REG_2, 0, 0),
    13  			BPF_LD_MAP_FD(BPF_REG_1, 0),
    14  			BPF_EMIT_CALL(BPF_FUNC_map_lookup_elem),
    15  			BPF_MOV64_IMM(BPF_REG_0, 0),
    16  			BPF_EXIT_INSN(),
    17  		},
    18  		.fixup_map = {
    19  			{
    20  				.off		= 3,
    21  				.type		= BPF_MAP_TYPE_LRU_HASH,
    22  				.size_key	= 8,
    23  				.size_val	= 8,
    24  			},
    25  		},
    26  		.warn = "Your kernel doesn't support LRU maps for BPF, thus "
    27  			"switching back to using hash table for the cilium "
    28  			"connection tracker. Recommendation is to run 4.10+ "
    29  			"kernels.",
    30  	},