From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C6E6BA034C; Thu, 28 Apr 2022 12:34:54 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6F8AE40E50; Thu, 28 Apr 2022 12:34:54 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id E26904013F for ; Thu, 28 Apr 2022 12:34:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1651142092; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=byr/JHhMOBmqitrf6JkIV4W1b0rtxaG7KTEp9G9r98w=; b=UDOIlg27/XG6saYexyfbn7YE1EAtk2XUaEuuES5IoyqNmE2sc9u8GEYrSfl9arzLIy8Q57 cY0MhT/O1w6HcMyNP8/I481KxddpMjxy1fvkaG0O0CzitjOpbV8Q1fOnCvNmPuWvVQju4b pf9WAPPHCSNUYqcNh0Nief0BS0X1N2E= Received: from mail-lf1-f70.google.com (mail-lf1-f70.google.com [209.85.167.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-636-BK7eHWRYO7eRBQjxNROoGw-1; Thu, 28 Apr 2022 06:34:51 -0400 X-MC-Unique: BK7eHWRYO7eRBQjxNROoGw-1 Received: by mail-lf1-f70.google.com with SMTP id c33-20020a05651223a100b00471fc6795dfso1888501lfv.6 for ; Thu, 28 Apr 2022 03:34:50 -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:content-transfer-encoding; bh=byr/JHhMOBmqitrf6JkIV4W1b0rtxaG7KTEp9G9r98w=; b=WsLAZx8gc+0SP40cENgdFUToQfMWf+ghB56ZHs22MeRTWYiG9TVddA+tS0gts2U10I 91Ua/E87T19jKOyI6JC7cv94qIxm90k2c6uEplKhlHfmQPBaUJAvn1RcWmtpJe2mEu5o R2hYDqqHYU3gmGt7oH4FHEF6MsQBD2+AJsYyRuNMj9rwRpcz6Kft+K6F/0PEkXrFUVAX oZIQq2r6dreiaVpb0IYvR/sKE/lUc5np5tNozh1VlTC+7fZ6Oy451ayi4AGL/msPaRzL +INxMmmOZi6nnTS3unB8OqkEl9zE4PDloER1qbf85/mWIXPK4sOP83Um/CVzfPSoo9dW pH8Q== X-Gm-Message-State: AOAM531KNSiaeHmuvcXh/0SsumHoK7xKq79HpAS+BSjuHBsfR8GhLuyK 3BgUrAgzqTw09+LNDQD3WE9mIvZjegEC/wcZuuKcJtAEKhIRiPjB5kmdiQaPBdazTnxe4kkSbn0 A4DOPvlDdvbQwX1t4IdE= X-Received: by 2002:a2e:a445:0:b0:24a:c1ba:b62f with SMTP id v5-20020a2ea445000000b0024ac1bab62fmr21433842ljn.81.1651142089694; Thu, 28 Apr 2022 03:34:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoxf2aYkWiRyIWzV+OYTfo+wCsVwWAWpf64U3GyeF1FKaztPZ+oS4UluWSdHpfY5P/C2s0IBtFE8AwgXsDv+I= X-Received: by 2002:a2e:a445:0:b0:24a:c1ba:b62f with SMTP id v5-20020a2ea445000000b0024ac1bab62fmr21433836ljn.81.1651142089495; Thu, 28 Apr 2022 03:34:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: David Marchand Date: Thu, 28 Apr 2022 12:34:38 +0200 Message-ID: Subject: Re: librte_bpf: roadmap or any specific plans for this library To: =?UTF-8?Q?Bj=C3=B6rn_Svensson_A?= Cc: "dev@dpdk.org" , "Ananyev, Konstantin" , Stephen Hemminger Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Hello, On Tue, Apr 26, 2022 at 10:34 AM Bj=C3=B6rn Svensson A wrote: > > Hi all, > I hope this is the correct maillist for this topic. Yes it is. I copied the maintainer and people that might be interested in this topic. > > DPDK provides the nice library `librte_bpf` to load and execute eBPF byte= code > and we would like to broaden our usage of this library. > > Today there are hints that this library might have been purpose built to = enable inspection or modification of packets; > for example the eBPF program is expected to only use a single input argum= ent, pointing to data of some sort. > We believe it would be beneficial to be able to use this library to run g= eneric eBPF programs as well, > as an alternative to run them as RX- TX-port/queue callbacks (i.e. generi= c programs which only uses supported features) > > I have seen some discussions regarding moving towards using a common libr= ary with the kernel implementation of bpf, > but I couldn't figure out the outcome. I don't think there was progress on this. > My question is if there any plans to evolve this library or would improve= ments possibly be accepted? > > Here are some improvements we are interested to look into: > > * Add additional API for loading eBPF code. > Today it's possible to load eBPF code from an ELF file, but having an A= PI to load code from an ELF image from memory > would open up for other ways to manage eBPF code. > > Example of the new API: > struct rte_bpf * > rte_bpf_elf_image_load(const struct rte_bpf_prm *prm, char *image, > size_t size, const char *sname); > > * Add support of more than a single input argument. > There are cases when additional information is needed. Being able to us= e more than a single input argument > would help when running generic eBPF programs. > > Example of change: > struct rte_bpf_prm { > ... > - struct rte_bpf_arg prog_arg; /**< eBPF program input arg descrip= tion */ > + uint32_t nb_args; > + struct rte_bpf_arg prog_args[EBPF_FUNC_MAX_ARGS]; /**< eBPF prog= ram input args */ > }; All I can tell, is that this proposal breaks ABI. This is a blocker to get it accepted until next ABI breakage window opens. --=20 David Marchand