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 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2096DC433F5 for ; Mon, 9 May 2022 06:59:36 +0000 (UTC) Received: from localhost ([::1]:38870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnxMl-000478-2D for qemu-devel@archiver.kernel.org; Mon, 09 May 2022 02:59:35 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54428) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnxGP-0001XN-Te for qemu-devel@nongnu.org; Mon, 09 May 2022 02:53:01 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:58808) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnxGJ-0003MA-CU for qemu-devel@nongnu.org; Mon, 09 May 2022 02:52:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652079173; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ImBrI8EsVqAbznY0xvGFCKzFfdiwe5vDWdOi4Olx7FM=; b=VKVGsJkcXeN8z4jqI9mB96obbM0JuKX8MVkMwCdTQhBUbifwgyvoj3Rz7xREI7P26Uv9Wi UNVq164UsCCzF6m09lmWaph8ijfi18llSOkY4WDL8tglkiVqqobTg029hvnDvzQY0GQzvq KBoZaeawtDVoVe8Fvqpsucl37TiEZ0Q= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-79-FWbqCgILNPCCj0yJH1slGQ-1; Mon, 09 May 2022 02:52:52 -0400 X-MC-Unique: FWbqCgILNPCCj0yJH1slGQ-1 Received: by mail-lj1-f199.google.com with SMTP id f6-20020a2e9186000000b0024f3dfdf894so3832516ljg.2 for ; Sun, 08 May 2022 23:52:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ImBrI8EsVqAbznY0xvGFCKzFfdiwe5vDWdOi4Olx7FM=; b=me6kwHKtuy30rWw5ZD/apEfrdaY8W5nVhr4wnhBm8TNS/3FnaZAwSh1vLgkZnQrvAG exqPtPMxFSA5VZ9zPAirtRHdMjHkoviYpImVDLmN9b0TcC5fHglzuUtrW21qpzikZWDS sUqHF2zEkROqhXNA8u+xmTdQB9Meq4kPgqCqolQU1/3KhXuqVyuWA//aITw/ofjklzHD mKpjPjlQ/WAmtmTRTAqWOfQtP98TSBRkoxiz4xGis9tEaH8YId/0RMUDAX8lCqO9p05R hcCmGUpvMzN0WX9gQ7H9Ug+rbxHFfdJiJHWc0l/Tx9r2EIBeuL9/NbEt+Y6wPaI7JV5W EgMQ== X-Gm-Message-State: AOAM531sE0s7fHCQtGiDhCZuGKw2UTni8jBKsUqhXTxR5BmLaUulKbHw m7eSCvJ0HPu+kzDz6hb85Pdd1DG0VaR2K3nk0B7Jm9A2oIWAEKFcNR7afq7OaJXQ0OPK0fqfXli +QyD8h9OTKXRu2pwZ8xkEuEgvNpkTGrk= X-Received: by 2002:a05:6512:1291:b0:473:b522:ef58 with SMTP id u17-20020a056512129100b00473b522ef58mr11404887lfs.190.1652079170688; Sun, 08 May 2022 23:52:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt5pEHR1sA4nNRbLaphT/zzm2EHrjp6s2P7etjenSpcb5EnNzQi4m2pKRRSsoceczNyfptfJKr6DpevXJfKVY= X-Received: by 2002:a05:6512:1291:b0:473:b522:ef58 with SMTP id u17-20020a056512129100b00473b522ef58mr11404876lfs.190.1652079170423; Sun, 08 May 2022 23:52:50 -0700 (PDT) MIME-Version: 1.0 References: <87a6bulueg.fsf@pond.sub.org> <8a8b144a-c9d6-41b0-71fd-c7850dce9c93@redhat.com> <87bkw7e0mc.fsf@pond.sub.org> In-Reply-To: <87bkw7e0mc.fsf@pond.sub.org> From: Jason Wang Date: Mon, 9 May 2022 14:52:39 +0800 Message-ID: Subject: Re: ebpf/rss.bpf.skeleton.h generated by what? To: Markus Armbruster Cc: Paolo Bonzini , Andrew Melnychenko , qemu-devel Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=170.10.129.124; envelope-from=jasowang@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, May 9, 2022 at 1:27 PM Markus Armbruster wrote: > > Jason Wang writes: > > > On Sat, May 7, 2022 at 2:58 PM Paolo Bonzini wrote: > >> > >> On 5/7/22 08:53, Jason Wang wrote: > >> > On Sat, May 7, 2022 at 2:46 PM Paolo Bonzini wrote: > >> >> > >> >> On 5/7/22 07:05, Jason Wang wrote: > >> >>>> If it was generated by something in the tree, it should not be committed > >> >>>> to git. Doesn't look like it is. > >> >>> Andrew may know more. > >> >>> > >> >>> I remember it was generated by libbpf. > >> >> > >> >> What is the source? > >> > > >> > It's tools/ebpf/rss.bpf.c. > > Aha: > > $ cat tools/ebpf/Makefile.ebpf > [...] > $(OBJS): %.o:%.c > $(CLANG) $(INC_FLAGS) \ > -D__KERNEL__ -D__ASM_SYSREG_H \ > -I../include $(LINUXINCLUDE) \ > $(EXTRA_CFLAGS) -c $< -o -| $(LLC) -march=bpf -filetype=obj -o $@ > bpftool gen skeleton rss.bpf.o > rss.bpf.skeleton.h > ---> cp rss.bpf.skeleton.h ../../ebpf/ > > and > > $ cat docs/devel/ebpf_rss.rst > [...] > RSS eBPF program > ---------------- > > RSS program located in ebpf/rss.bpf.skeleton.h generated by bpftool. > So the program is part of the qemu binary. > Initially, the eBPF program was compiled by clang and source code located at tools/ebpf/rss.bpf.c. > Prerequisites to recompile the eBPF program (regenerate ebpf/rss.bpf.skeleton.h): > > llvm, clang, kernel source tree, bpftool > Adjust Makefile.ebpf to reflect the location of the kernel source tree > > $ cd tools/ebpf > $ make -f Makefile.ebpf > [...] > > Together, this answers my "what" question. It doesn't answer my next > question: why? That one gets answered ... > > >> Thanks, maybe we can reuse some of the support for cross compilation > >> that will be introduced soon. > > > > That would be better. > > ... here: > > > The reason we don't auto generate during make is > > to avoid adding new dependencies (where libbpf/bpftool is not popular > > at that time). > > Always, always, *always* document your reasons for doing stuff right in > the commit message, unless they are blindingly obvious. I understand > reasons can be obvious enough to the author. Document them anyway if > there is any chance they are not obvious to others. > Ok. Andrew, want to post a patch to explain this? Thanks