From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by mail.toke.dk (Postfix) with ESMTPS id 19FD59CD4E7 for ; Fri, 9 Dec 2022 02:30:58 +0100 (CET) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=OsALoXsh Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1EA82B826F7; Fri, 9 Dec 2022 01:30:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DFD6C433EF; Fri, 9 Dec 2022 01:30:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670549454; bh=O3gqpaHAaVJ+VQYk3KlcocWeL7MxNJI9S3vqrlnG0Bw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OsALoXsh10Da1s1AEPa+oFbbLFFzlOlm3vbQRcHkv91I2trG2iMe4JzhVO8Qp64mB z9zUQeJpAPGw+0KrcE6Jw6QkUY3+E56pypWi62g8tG7lq2tdJQYqXxQDkR2MNU0/ph 5gIBzClnT4IXgy/EqP+bVXi+F4Gho1/46Luu/sgR4tsfbSsOhtp1tFblWTrQ6b39lO COyjWGkRmuK9+nbOaGdUDc33gFd43RLvTQGHlU/vL9Oon1mosxK3HluuqRpO3e/9go iWjwArPMPMiQd4f2tzXPK+qhRgdgKmDDEP0YDOosXGHp3xodsdFyp5UUv7xJgY+SbC OohIvtjrzj5iw== Date: Thu, 8 Dec 2022 17:30:53 -0800 From: Jakub Kicinski To: Stanislav Fomichev Message-ID: <20221208173053.1145a8cb@kernel.org> In-Reply-To: References: <20221206024554.3826186-1-sdf@google.com> <20221206024554.3826186-4-sdf@google.com> <20221207210019.41dc9b6b@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: V4IQUDF46AXRLJZNWCGV6EXJY7QBAH6D X-Message-ID-Hash: V4IQUDF46AXRLJZNWCGV6EXJY7QBAH6D X-MailFrom: kuba@kernel.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, David Ahern , Willem de Bruijn , Jesper Dangaard Brouer , Anatoly Burakov , Alexander Lobakin , Magnus Karlsson , Maryam Tahhan , xdp-hints@xdp-project.net, netdev@vger.kernel.org X-Mailman-Version: 3.3.7 Precedence: list Subject: [xdp-hints] Re: [PATCH bpf-next v3 03/12] bpf: XDP metadata RX kfuncs List-Id: XDP hardware hints design discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, 8 Dec 2022 11:07:43 -0800 Stanislav Fomichev wrote: > > > bpf_free_used_maps(aux); > > > bpf_free_used_btfs(aux); > > > - if (bpf_prog_is_offloaded(aux)) > > > + if (bpf_prog_is_dev_bound(aux)) > > > bpf_prog_offload_destroy(aux->prog); > > > > This also looks a touch like a mix of terms (condition vs function > > called). > > Here, not sure, open to suggestions. These > bpf_prog_offload_init/bpf_prog_offload_destroy are generic enough > (now) that I'm calling them for both dev_bound/offloaded. > > The following paths trigger for both offloaded/dev_bound cases: > > if (bpf_prog_is_dev_bound()) bpf_prog_offload_init(); > if (bpf_prog_is_dev_bound()) bpf_prog_offload_destroy(); > > Do you think it's worth it having completely separate > dev_bound/offloaded paths? Or, alternatively, can rename to > bpf_prog_dev_bound_{init,destroy} but still handle both cases? Any offload should be bound, right? So I think functions which handle both can use the bound naming scheme, only the offload-specific ones should explicitly use offload?