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 B13CDA0093; Tue, 3 May 2022 10:44:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6133040C35; Tue, 3 May 2022 10:44:47 +0200 (CEST) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150119.outbound.protection.outlook.com [40.107.15.119]) by mails.dpdk.org (Postfix) with ESMTP id 4610D40E28 for ; Mon, 2 May 2022 16:28:43 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eXRCs+QVLhIRWscJNoslZjx/l1WAcSLUc3qltBM2neUAwvWhCmLoPbPKJgePgQWiV39WYOqFkovCrU2BBoYmgbxONjA3Qnmi04GwHb4/o0VEKCjbQ7K4OWpZrMyJPvB0pCySgf6KwMi4SSiKwftJ4n6Y5M+CHP5d+a5OwgytED+GkJGni9PzHh+guCIV7Y4b+XgDbJSmwOOYvaZIV3nEKMp0eHkpW8ByfenEh9Gtibr/v8d0+uxQacuA7xyQ7ZtBXmiGtXOrO8GSnXcaA6T3auEy8dMLnhXfSZVbgVw9Jo4CAKrzS0GrSRxEngHtW+3/byjezgO3kGp/k5J65LGYDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ScmdbmUtdVvSsY32xmCF6fFuT6NXJeKu05zVzJJoW58=; b=aEn+I04JoskIuhCh0t025xMNLWZ/BNVDwYXjSDXD8CP49hENCHFL64jiQwBJUXW2AU5tQN8leC1TKS+fjoUjjEM5gyWbxHhDItko7mHIlbDDwdbCF6RursODn8zpGdqVhj2zXjiUnASJYuVqIKML1s81tuoPinW9m9Y0laqIM5gBbzZwVKujZChtHGujqqpv6dw9DHSJyVNvNZ3xKJMb+RGLfAevmHwL5MJu1fmURmhHJ05hEPLc4fRWL6x8JsVSSiSnhQswVN1jq/z+/qvHROQRffsBM/f6JKBuztdF9dQMXst9/RnS5sntIjOUyngggOZsiB5IvPF9NBLs81LaCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=est.tech; dmarc=pass action=none header.from=est.tech; dkim=pass header.d=est.tech; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=estab.onmicrosoft.com; s=selector2-estab-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ScmdbmUtdVvSsY32xmCF6fFuT6NXJeKu05zVzJJoW58=; b=aSTMUaJYhuCd9L3gzPLmtRWGMeT50icKOFNg6B5XiuJnU5CgqIxipMTTW6WQ8UXeoQxo3wHrncTRK6T23LvjDlQBMwXJOiv/omhiIRUJCh6LblVFTJCAtAgtmlyyzLaChkVAx/yFiswCbCQ/MywLDu50uTkDv+9OCmcYNI+WAhg= Received: from DB9P189MB1833.EURP189.PROD.OUTLOOK.COM (2603:10a6:10:331::10) by AS8P189MB1640.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:39a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5206.24; Mon, 2 May 2022 14:28:41 +0000 Received: from DB9P189MB1833.EURP189.PROD.OUTLOOK.COM ([fe80::b9de:b8d4:7084:93a7]) by DB9P189MB1833.EURP189.PROD.OUTLOOK.COM ([fe80::b9de:b8d4:7084:93a7%6]) with mapi id 15.20.5186.028; Mon, 2 May 2022 14:28:41 +0000 From: =?iso-8859-1?Q?Bj=F6rn_Svensson_A?= To: Konstantin Ananyev , "dev@dpdk.org" Subject: Re: librte_bpf: roadmap or any specific plans for this library Thread-Topic: librte_bpf: roadmap or any specific plans for this library Thread-Index: AQHYWPyEcT8w0wvHWEmDHHosH/+8TK0FkcQAgAYRjss= Date: Mon, 2 May 2022 14:28:41 +0000 Message-ID: References: <8e8fcdea-5265-1126-4912-c7fec9b659c4@yandex.ru> In-Reply-To: <8e8fcdea-5265-1126-4912-c7fec9b659c4@yandex.ru> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=est.tech; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3e2ffe91-77dc-47f2-f749-08da2c480e0a x-ms-traffictypediagnostic: AS8P189MB1640:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: i99oHpVHmMtWkAxPA+vqhuUPVnCGmm3dpUNniPa6V6Jl2e8gIHUOhtWrmbmmcUt4tAahEpvj/ddnYonwrGUJnuWqvAQfKmmkZxpK7vnpC4mdy2QHIIln1e/SsyClBoCJnQs0Y0IsOADmLGH8fFstq5hai66NS1psGhgC8V+stxg1OgoiQ97LExWT0o/CWLN0sGbeQeu0Hy6E2KkWMzBMW2XtBNVvZwzLKUshKHaKOD+vLZHOZG1JD9WvVy0zWc5mCiALtWch4gLWyBlOTDIq5JXHf7j1ZnYIQSGUZQQbeQ6sm0si8lH3zxI4rtBHmDcmV56dN0/hJxzA1D7FloVuIvpTeE1hyXciuceUZyT26SxzlCbEcRC7wSl7Kqensw2Ae6ehmQYaBm3nliNMW2p84IcySy+hhu1pKij5Twzk+24oSIz4FtRskbU0Hb7p/R7CReCQ7BDpOi3Xp86Md45EEPk1Cx/XU7uLIPRvFDYhnLw0VDq7mGkU7KFC2T8EizlbF4J8bs6ryKr0FhJJXE9QH+5Id9bUiWO9LxvgRgxgsxufoqRlXOzYU1xvqK6bjnn7iSsQlkrnkAycge3l0iPTP3lb2LvdBM+MJNo+Kl/V12+m3c5DW7+zJRGDHa8OB+RVZY5INlo/iLjNqhvWbVZQreQeJBz0DiJ5g/Q1viHH+8QaPcCb/NV9suS8RtLeAAw23XguNLgWDXOFRw4evU56CvLmmaeKvJ2+3NbCO6gknCdOexn3QhNHz9apqfEWxWJCyWUi0k6NrnOZg670Ns/FUIIX136nuGuGsqgyFQ+scrU= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9P189MB1833.EURP189.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230001)(136003)(366004)(396003)(376002)(346002)(39830400003)(38100700002)(52536014)(38070700005)(6506007)(7696005)(33656002)(8936002)(71200400001)(110136005)(19627405001)(26005)(966005)(508600001)(9686003)(316002)(76116006)(64756008)(8676002)(66476007)(66556008)(186003)(91956017)(86362001)(66446008)(66946007)(166002)(122000001)(55016003)(2906002)(5660300002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?6ovGtDpd7if2ffXlf9LZ41dunhA3LhrSiAO6ZCy6OXZTV0QhbXb6qlT7rZ?= =?iso-8859-1?Q?pGWX+OV7gWRzR/Etls0ot7eN7pgs1E5A0IEsvd66OzzlD/Ow3A8FCMiA8g?= =?iso-8859-1?Q?rGfU6eoGqivScHUvJkAn0VobJqdqQV0Cm/QtRCQUxK5nKwqGxaQnPiDs3Q?= =?iso-8859-1?Q?8Wtz7AL03Za3UWjp/KSlPNKK5mZ0m37ymZvrYdD9v3JFZtTSyyBHGip0jx?= =?iso-8859-1?Q?a7LTuAzG+BA2ceYrFynuhzXqSFQSaSK42dAyZI5oPBnc+E1yXPUzhGu7QV?= =?iso-8859-1?Q?VcKNNjtcTeuHBee4Rps+4V5s0Z7dTxarGhxVnWAPYs9d41bNLJV624JN8y?= =?iso-8859-1?Q?ttkUXFewfIH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CBUS?= =?iso-8859-1?Q?eRFU4IkXMXPJIKk9yrYbWvWkEjKuLXc3Rjg2groB8gIKHHD96twfW+IUdE?= =?iso-8859-1?Q?lmuQiEABZO5+99rourgoCIpSLUv5FjWlQUaqHWltqI4atGizNeoXh7TSW9?= =?iso-8859-1?Q?n1AD5/UNtUdStltHD1NvFzttARz0qZaeW3WMJjvobsVUWt24o+3PHxiwgk?= =?iso-8859-1?Q?wzrZNJOnlHIhdAADnqi5w9EDU5wXPp1ugaVbdkR60/A/4j9RnRh7b+RpxU?= =?iso-8859-1?Q?aV+lsKwH5JOXL1jdcCnqtifD1sqnlkL+uK9ss0a4N6ungkIK/nq2eQyttx?= =?iso-8859-1?Q?J8vTanoB+VFvTrmnCwQgP4uYwprU0XdenqtD5wkTL9+xziQwxRJfQtn0cj?= =?iso-8859-1?Q?IxxWyDHD2+Sjro2dTqNAly3jGEMpyOhGXMElmfKFj+x8xTXNqoCUD8M1En?= =?iso-8859-1?Q?koZVf1zDZ7ccVo15W39MEmULCCfv+cOi0f+t+RMv+TDzk44TJ6evif6jo3?= =?iso-8859-1?Q?hcZqXV8AclgXjajHSKNpShAAL49aXfccX4QUsEb6CEdT0Usz8VakvIR5An?= =?iso-8859-1?Q?Lp/RH+CQ3A=3D=3D?= Content-Type: multipart/alternative; boundary="_000_DB9P189MB18333831FC62E9A7E36B138BB9C19DB9P189MB1833EURP_" MIME-Version: 1.0 X-OriginatorOrg: est.tech X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DB9P189MB1833.EURP189.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-Network-Message-Id: 3e2ffe91-77dc-47f2-f749-08da2c480e0a X-MS-Exchange-CrossTenant-originalarrivaltime: 02 May 2022 14:28:41.0901 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d2585e63-66b9-44b6-a76e-4f4b217d97fd X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: xXbn6ODDPuhkRfEpqXWi1NC4jYq48w71Z+5PmhLDPUU5K67m9WhrLw+wNOTfvQ/92WwIQj1NnCJN7cJyZa6WJ7ltKfZhHeMTVncupDUvTUc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P189MB1640 X-Mailman-Approved-At: Tue, 03 May 2022 10:44:46 +0200 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 --_000_DB9P189MB18333831FC62E9A7E36B138BB9C19DB9P189MB1833EURP_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Thanks for the feedback. >> 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); >> > Did you look at rte_bpf_load()? > Basically it works with already pre-loaded into memory bpf program. > In fact, rte_bpf_elf_load() calls it internally after reading elf > sections, resolving external references, etc. > Would it meet your needs? Yes, I think we could create our own elf_image_load() function that uses rt= e_bpf_load(). I understand that we don't want to have a bunch of specific variants of loa= d-functions in dpdk, specially if they are not used in any example or usecase. > AFAIK linux BPF is restricted to work with a single argument only. > I don't want DPDK version to fork too far away from 'canonical' version. > Though, as I said above, nothing prevents you to create a struct > with several fields, and pass pointer to that struct to your BPF program. > Would such approach work for you? Good alternative idea. We will test this approach. I guess we will use the RTE_BPF_ARG_PTR as an argument for the program in t= his case. Just as sidenote: we have also had a glance at https://github.com/iovisor/ubpf as an alternative. This is a standalone BPF VM lib, but with Apache 2.0 lic= ense and it's not bound to the dpdk log framework. I have no views on benefits using this in dpdk, but it might be an input fo= r future talks about a common library / collaboration. Thanks again. Bjorn --_000_DB9P189MB18333831FC62E9A7E36B138BB9C19DB9P189MB1833EURP_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Thanks for the feedback.

>>&n= bsp;   Example of the new API:
>>&n= bsp;     struct rte_bpf *
>>&n= bsp;     rte_bpf_elf_image_load(const struct rte_bpf_pr= m *prm, char *image,
>>&n= bsp;            = ;            &n= bsp;   size_t size, const char *sname);
>>
> Did you look at rte_bpf_load()= ?
> Basically it works with already pre-loaded into memory bpf program. > In fact, rte_bpf_elf_load() calls it internally after reading elf
> sections, resolving external references, etc.
> Would it meet your needs?

Yes, I think we could create our ow= n elf_image_load() function that uses rte_bpf_load().
I understand that we don't want to = have a bunch of specific variants of load-functions in dpdk,
specially if they are not used in a= ny example or usecase.

> AFAIK= linux BPF is restricted to work with a single argument only.
> I don= 't want DPDK version to fork too far away from 'canonical' version.<= /div>
> Though, as I said above, nothi= ng prevents you to create a struct
> with several fields, and pass pointer to that struct to your BPF progr= am.
> Would such approach work for you?

Good alternative idea. We will test= this approach.
I guess we will use the RTE= _BPF_ARG_PTR as an argument for the program in this case.

Just as sidenote: we have also had = a glance at
htt= ps://github.com/iovisor/ubpf
as an alternative. This is a standalone BPF VM lib, but with Apache 2.0 lic= ense and it's not bound to the dpdk log framework.
I have no views on benefits usin= g this in dpdk, but it might be an input for future talks about= a common library / collaboration.

Thanks again.
Bjorn
--_000_DB9P189MB18333831FC62E9A7E36B138BB9C19DB9P189MB1833EURP_--