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 B2EEE43C49; Thu, 16 May 2024 11:36:15 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3E496402F0; Thu, 16 May 2024 11:36:15 +0200 (CEST) Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mails.dpdk.org (Postfix) with ESMTP id 2511F402C2 for ; Thu, 16 May 2024 11:36:14 +0200 (CEST) Received: from mail.maildlp.com (unknown [172.18.186.231]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Vg4hN3WMSz6J7mk; Thu, 16 May 2024 17:35:32 +0800 (CST) Received: from frapeml500006.china.huawei.com (unknown [7.182.85.219]) by mail.maildlp.com (Postfix) with ESMTPS id E256F1400D4; Thu, 16 May 2024 17:36:12 +0800 (CST) Received: from frapeml500007.china.huawei.com (7.182.85.172) by frapeml500006.china.huawei.com (7.182.85.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Thu, 16 May 2024 11:36:12 +0200 Received: from frapeml500007.china.huawei.com ([7.182.85.172]) by frapeml500007.china.huawei.com ([7.182.85.172]) with mapi id 15.01.2507.039; Thu, 16 May 2024 11:36:12 +0200 From: Konstantin Ananyev To: Stephen Hemminger , Yoav Winstein CC: "dev@dpdk.org" , Konstantin Ananyev Subject: RE: [PATCH] bpf: don't verify classic bpfs Thread-Topic: [PATCH] bpf: don't verify classic bpfs Thread-Index: AQHapDErHdsNv6+CSEKCW9U9t7BvxbGToe2AgAX+P5A= Date: Thu, 16 May 2024 09:36:12 +0000 Message-ID: <2eaeaf90d9a94c8ca199f5bb51e0ba38@huawei.com> References: <20240512055545.98297-1-yoav.w@claroty.com> <20240512090325.7c085db5@hermes.local> In-Reply-To: <20240512090325.7c085db5@hermes.local> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.173.11] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 > On Sun, 12 May 2024 08:55:45 +0300 > Yoav Winstein wrote: >=20 > > When classic BPFs with lots of branching instructions are compiled, > > __rte_bpf_bpf_validate runs way too slow. A simple bpf such as: > > 'ether host a0:38:6d:af:17:eb or b3:a3:ff:b6:c1:ef or ...' 12 times > > > > results in ~1 minute of bpf validation. > > This patch makes __rte_bpf_bpf_validate be aware of bpf_prm originating > > from classic BPF, allowing to safely skip over the validation. > > > > Signed-off-by: Yoav Winstein > > --- >=20 > No. > Wallpapering over a performance bug in the BPF library is not > the best way to handle this. Please analyze the problem in the BPF > library; it should be fixed there. +1 Blindly disabling verification for all cBPFs is the worst possible option h= ere. We need at least try to understand what exactly causing such slowdown.