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=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no 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 2A2A7C433FF for ; Wed, 31 Jul 2019 10:08:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F13CE20657 for ; Wed, 31 Jul 2019 10:08:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727136AbfGaKIM (ORCPT ); Wed, 31 Jul 2019 06:08:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47888 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbfGaKIL (ORCPT ); Wed, 31 Jul 2019 06:08:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 703488553F; Wed, 31 Jul 2019 10:08:11 +0000 (UTC) Received: from carbon (ovpn-200-29.brq.redhat.com [10.40.200.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5B0D360852; Wed, 31 Jul 2019 10:08:06 +0000 (UTC) Date: Wed, 31 Jul 2019 12:08:05 +0200 From: Jesper Dangaard Brouer To: "Daniel T. Lee" Cc: brouer@redhat.com, Daniel Borkmann , Alexei Starovoitov , netdev@vger.kernel.org, Quentin Monnet Subject: Re: [PATCH 1/2] tools: bpftool: add net load command to load XDP on interface Message-ID: <20190731120805.1091d5c9@carbon> In-Reply-To: <20190730184821.10833-2-danieltimlee@gmail.com> References: <20190730184821.10833-1-danieltimlee@gmail.com> <20190730184821.10833-2-danieltimlee@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Wed, 31 Jul 2019 10:08:11 +0000 (UTC) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Wed, 31 Jul 2019 03:48:20 +0900 "Daniel T. Lee" wrote: > By this commit, using `bpftool net load`, user can load XDP prog on > interface. New type of enum 'net_load_type' has been made, as stated at > cover-letter, the meaning of 'load' is, prog will be loaded on interface. Why the keyword "load" ? Why not "attach" (and "detach")? For BPF there is a clear distinction between the "load" and "attach" steps. I know this is under subcommand "net", but to follow the conversion of other subcommands e.g. "prog" there are both "load" and "attach" commands. > BPF prog will be loaded through libbpf 'bpf_set_link_xdp_fd'. Again this is a "set" operation, not a "load" operation. > Signed-off-by: Daniel T. Lee [...] > static int do_show(int argc, char **argv) > { > struct bpf_attach_info attach_info = {}; > @@ -305,13 +405,17 @@ static int do_help(int argc, char **argv) > > fprintf(stderr, > "Usage: %s %s { show | list } [dev ]\n" > + " %s %s load PROG LOAD_TYPE \n" The "PROG" here does it correspond to the 'bpftool prog' syntax?: PROG := { id PROG_ID | pinned FILE | tag PROG_TAG } > " %s %s help\n" > + "\n" > + " " HELP_SPEC_PROGRAM "\n" > + " LOAD_TYPE := { xdp | xdpgeneric | xdpdrv | xdpoffload }\n" > "Note: Only xdp and tc attachments are supported now.\n" > " For progs attached to cgroups, use \"bpftool cgroup\"\n" > " to dump program attachments. For program types\n" > " sk_{filter,skb,msg,reuseport} and lwt/seg6, please\n" > " consult iproute2.\n", -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer