Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1662331imm; Thu, 19 Jul 2018 05:55:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpesD1bdGPmFeJuLOl+UeLJ+XXzKoVVNTpZ9XJnnl3MQjGepNfG724bVjPDmIQmwSc9ij2V3 X-Received: by 2002:a17:902:aa87:: with SMTP id d7-v6mr10003354plr.215.1532004908650; Thu, 19 Jul 2018 05:55:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532004908; cv=none; d=google.com; s=arc-20160816; b=LiWcWQnPMOQiq71pnnMs7pfMCybO+tSliN0PZ5vnT257Pj5Of6Lkhbsxg0SRUhJQ89 CWBA0MmxpQhuE9xW2064wTwIELLO4j3Ir6WE1wowJB4c9QVn2OQ+a7/YoUxzGxe/kBHe MaSUicZ2PFjf1C6Gd2nxXvaJhg6cL69nDj4cNkw/2GTlMGH+YQ9Qq56Dyb75QgKhWKba pa8mpllMYaBT994dpflNGiLaOcgGCIDMXQ46qmU296akwmfOJV1RsC8Y/AJnpD5eTe8A dKF+to3AzNXOT/iemJTjeqobNCucS1/+W3BxO/gHo5BZhYwHrYUOa9B+pw97STrJfE8p 0OJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=P6HQcAyahz1ho8/lhWUA4Qi64gqdoR7TrRjI+gxpkx0=; b=kW9dsz80TQ4PNOaiaNy5aOHe1sTWMXpgbTovyJt5KVRoYHg1vWAwoc2hWEPywIqTaJ wEnoFc8MItJ6vZyskQR19mC/ODpws9h48dFyn99zHtHTlyGWMIXHVOTgO/tcMl5tIrJs LhV03KjKqy/9XajkbcBLesBD1ZtsVhPTLBGqVu1HTrYDQrh8jKEHQUycrvBNggEP/fG1 JjhgmgiMfV+bRq/DEbjqiucNjNhnlpzzguzE+wIlTfp0p2UTkWD9QX2I3QwfCkgi2Zce 2oGV3YQ+koYdF544CgcY4pwtNE1yYK0Tv8wTQ/UKPa7E+hvD8nsjwPJUxO8KRhwwAcpo /kxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o65ujatD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j5-v6si5896026pgt.370.2018.07.19.05.54.48; Thu, 19 Jul 2018 05:55:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=o65ujatD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731308AbeGSNhP (ORCPT + 99 others); Thu, 19 Jul 2018 09:37:15 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:44049 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730053AbeGSNhP (ORCPT ); Thu, 19 Jul 2018 09:37:15 -0400 Received: by mail-pg1-f194.google.com with SMTP id r1-v6so3676541pgp.11; Thu, 19 Jul 2018 05:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=P6HQcAyahz1ho8/lhWUA4Qi64gqdoR7TrRjI+gxpkx0=; b=o65ujatDJKSYScEnUThtN3JmC/0PZkema93/ngSrDXre4aw2aNGmelWZaeMmiFLZG7 2EhiVgFzPqXwSuF56beJKqMeTP3Xw2ipWgk7kp8FYavho5JERtC5I6V9+8HuPNrJm7la SWW8XrhXHiVqN6zBYowLs24XEiPXWHsc5FhuWkTZ3nMqbUfJ+5bOgE5v06e14L9vQOQ7 vhY7RjHO5Ak0a6worcxxsCrqvdu2g2iBEXMyHPV8bmdDITBjsnJKa4XmSZx8wI0zhjh1 OuMmhxt2Bm+ICXp23V6mDDqQoeXXsRvyPvAhKo2ASIjR5Jx8icMUzougsb6HByhXkAbU OGUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=P6HQcAyahz1ho8/lhWUA4Qi64gqdoR7TrRjI+gxpkx0=; b=Wl6SzrkYRTr3TjlNFf6lpQs8JqvbXGrjVqR3enDk7CXAK7AGuZotvdflddYpyHEDma Yw+JbUpHw0N9e7RCTPTiEZdihVTIIR4j3tUDV6RSK1QxC1AltbDDvDfzEQnysdJHNgp/ MwCLREXWG2Ffcy6JCC9jtqlRR/yyHqXp4Zzd2GrZr6SnhDMyA46crD+9xBW/B2AVEh7x YCXjW5Ngb/oKbjdq+F9NpQNOnt5EHAV1oZ6hrlVvzAYZ/fu5mAFTaBI0OFDuYaVOJeqp 8IvkdnRGRWnLLwJfD9FdalmxpJ1cIpE16stBU3H9MNlseFAEpO8XVP0Q578Toy43rP2Y OAbw== X-Gm-Message-State: AOUpUlEORoO7gKlrVkiDMG5fz0wOlgGGtmRcPGeRK9A8L+EeyWH0AAPH G3lR1qddBMffaWjKCWP09vo= X-Received: by 2002:a62:c4c3:: with SMTP id h64-v6mr9424381pfk.39.1532004853575; Thu, 19 Jul 2018 05:54:13 -0700 (PDT) Received: from localhost.localdomain ([211.196.191.92]) by smtp.gmail.com with ESMTPSA id h10-v6sm18141853pfj.78.2018.07.19.05.54.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jul 2018 05:54:12 -0700 (PDT) From: Taeung Song To: Alexei Starovoitov , Daniel Borkmann Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , David Ahern Subject: [PATCH] bpf: synchronize bpf uapi header with tools Date: Thu, 19 Jul 2018 21:53:55 +0900 Message-Id: <20180719125355.26441-1-treeze.taeung@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org To pick the change in: 4c79579b44b1 ("bpf: Change bpf_fib_lookup to return lookup status") This bpftool build warning occurs: Warning: Kernel ABI header at 'tools/include/uapi/linux/bpf.h' differs from latest version at 'include/uapi/linux/bpf.h' Cc: Arnaldo Carvalho de Melo Cc: David Ahern Signed-off-by: Taeung Song --- tools/include/uapi/linux/bpf.h | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h index 59b19b6a40d7..b7db3261c62d 100644 --- a/tools/include/uapi/linux/bpf.h +++ b/tools/include/uapi/linux/bpf.h @@ -1857,7 +1857,8 @@ union bpf_attr { * is resolved), the nexthop address is returned in ipv4_dst * or ipv6_dst based on family, smac is set to mac address of * egress device, dmac is set to nexthop mac address, rt_metric - * is set to metric from route (IPv4/IPv6 only). + * is set to metric from route (IPv4/IPv6 only), and ifindex + * is set to the device index of the nexthop from the FIB lookup. * * *plen* argument is the size of the passed in struct. * *flags* argument can be a combination of one or more of the @@ -1873,9 +1874,10 @@ union bpf_attr { * *ctx* is either **struct xdp_md** for XDP programs or * **struct sk_buff** tc cls_act programs. * Return - * Egress device index on success, 0 if packet needs to continue - * up the stack for further processing or a negative error in case - * of failure. + * * < 0 if any input argument is invalid + * * 0 on success (packet is forwarded, nexthop neighbor exists) + * * > 0 one of **BPF_FIB_LKUP_RET_** codes explaining why the + * * packet is not forwarded or needs assist from full stack * * int bpf_sock_hash_update(struct bpf_sock_ops_kern *skops, struct bpf_map *map, void *key, u64 flags) * Description @@ -2612,6 +2614,18 @@ struct bpf_raw_tracepoint_args { #define BPF_FIB_LOOKUP_DIRECT BIT(0) #define BPF_FIB_LOOKUP_OUTPUT BIT(1) +enum { + BPF_FIB_LKUP_RET_SUCCESS, /* lookup successful */ + BPF_FIB_LKUP_RET_BLACKHOLE, /* dest is blackholed; can be dropped */ + BPF_FIB_LKUP_RET_UNREACHABLE, /* dest is unreachable; can be dropped */ + BPF_FIB_LKUP_RET_PROHIBIT, /* dest not allowed; can be dropped */ + BPF_FIB_LKUP_RET_NOT_FWDED, /* packet is not forwarded */ + BPF_FIB_LKUP_RET_FWD_DISABLED, /* fwding is not enabled on ingress */ + BPF_FIB_LKUP_RET_UNSUPP_LWT, /* fwd requires encapsulation */ + BPF_FIB_LKUP_RET_NO_NEIGH, /* no neighbor entry for nh */ + BPF_FIB_LKUP_RET_FRAG_NEEDED, /* fragmentation required to fwd */ +}; + struct bpf_fib_lookup { /* input: network family for lookup (AF_INET, AF_INET6) * output: network family of egress nexthop @@ -2625,7 +2639,11 @@ struct bpf_fib_lookup { /* total length of packet from network header - used for MTU check */ __u16 tot_len; - __u32 ifindex; /* L3 device index for lookup */ + + /* input: L3 device index for lookup + * output: device index from FIB lookup + */ + __u32 ifindex; union { /* inputs to lookup */ -- 2.17.1