From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4905DC433E0 for ; Wed, 27 May 2020 01:09:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2031C207CB for ; Wed, 27 May 2020 01:09:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590541761; bh=T0IVk+W0jmSuwjR9xT3b3xG1pvcq2QYiZ1jAJhmAfAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aDT8uW2GRvO8a1qtRGHCtyu3tbCzavmc7CKo7f4YBe1P72YG8J58Hr+Yd/hSDetqt N1N8d3cfJ68q6TMe7ZYlwvUbBmrudweYB1bjEMekXpBZcbifWmtK+A4vNbgnplbP3z mM3e4cRKG7otEjL170rKCnRDwmkdv2EhEeYIhJvw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728178AbgE0BJU (ORCPT ); Tue, 26 May 2020 21:09:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:35330 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728140AbgE0BJM (ORCPT ); Tue, 26 May 2020 21:09:12 -0400 Received: from C02YQ0RWLVCF.internal.digitalocean.com (c-73-181-34-237.hsd1.co.comcast.net [73.181.34.237]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D80E20E65; Wed, 27 May 2020 01:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590541751; bh=T0IVk+W0jmSuwjR9xT3b3xG1pvcq2QYiZ1jAJhmAfAQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j9+QjSTTg7ci7H0px9taJANQHJzMqQ5IONS7sbXcqryqcS6lq2nk+44v0qGCx/gJ2 bouG3IVKvfNxC5AuFzZWW7U4PtyCRHHuxcA3jGtIdrEH80mtFaqbHkPYdRqMK209E7 9tWcJ1m7EAws9Sy0xSZdaG1/1XMwhypeV+7NlrvE= From: David Ahern To: netdev@vger.kernel.org Cc: davem@davemloft.net, kuba@kernel.org, brouer@redhat.com, toke@redhat.com, daniel@iogearbox.net, john.fastabend@gmail.com, ast@kernel.org, kafai@fb.com, songliubraving@fb.com, yhs@fb.com, andriin@fb.com, dsahern@gmail.com, David Ahern Subject: [PATCH bpf-next 4/5] bpftool: Add SEC name for xdp programs attached to device map Date: Tue, 26 May 2020 19:09:04 -0600 Message-Id: <20200527010905.48135-5-dsahern@kernel.org> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200527010905.48135-1-dsahern@kernel.org> References: <20200527010905.48135-1-dsahern@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Support SEC("xdp_dm*") as a short cut for loading the program with type BPF_PROG_TYPE_XDP and expected attach type BPF_XDP_DEVMAP. Signed-off-by: David Ahern --- tools/lib/bpf/libbpf.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c index fa04cbe547ed..563827b260e8 100644 --- a/tools/lib/bpf/libbpf.c +++ b/tools/lib/bpf/libbpf.c @@ -6657,6 +6657,8 @@ static const struct bpf_sec_def section_defs[] = { .expected_attach_type = BPF_TRACE_ITER, .is_attach_btf = true, .attach_fn = attach_iter), + BPF_EAPROG_SEC("xdp_dm", BPF_PROG_TYPE_XDP, + BPF_XDP_DEVMAP), BPF_PROG_SEC("xdp", BPF_PROG_TYPE_XDP), BPF_PROG_SEC("perf_event", BPF_PROG_TYPE_PERF_EVENT), BPF_PROG_SEC("lwt_in", BPF_PROG_TYPE_LWT_IN), -- 2.21.1 (Apple Git-122.3)