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 0EA564550C; Thu, 27 Jun 2024 17:13:49 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F39542DC9; Thu, 27 Jun 2024 17:13:48 +0200 (CEST) Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by mails.dpdk.org (Postfix) with ESMTP id 8A9DC42D89 for ; Thu, 27 Jun 2024 17:13:47 +0200 (CEST) Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-3761f8d689fso34629255ab.3 for ; Thu, 27 Jun 2024 08:13:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1719501227; x=1720106027; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=OmaZauSwUzFXrOgRK9MMekx2zWF+FSU/WieV5MhAkeE=; b=srPc0MKbQUf3x3vgFY0KS4KSRBNeraf/cuhOnRKf0/nODZmwPo/vgaRPNcYcFJvLn3 VKaZEqJbHbHTVXT3zpVQbJPnrAnPjTkRR906EFP274UuTIHD9H9kZYVAtJ6twEyHizNc +i/iXR8A4nII28wSNaEsC7lgEAPSjLNfvrFWjbPApCPK0AeLcbmdC7a5p2kCCFDAUAp1 Sf/b6q3BpN3JLxPAN8dAvB/lWaLocNPHcb7uhHjF6/sZvG/fgVvWJhldhE7jiniNr0BM 3923UixksXHamFWbEjbc1ctXAQAHVZjhY8p0MRtmEn8xmWcQq2b0oSnw/UlGR4O3coZk SmjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719501227; x=1720106027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OmaZauSwUzFXrOgRK9MMekx2zWF+FSU/WieV5MhAkeE=; b=P8urDMJvAZTCT7H0wm85mZYnqYWvOVliWeW8fYtGumC/RiWnQ2eZytXaAhGlQZWd71 oxcvE32YX1uKvXFaUkzbnzxl83mArbhC9F0XMmHfPkDLpxc5KfkDwUntZgFAGE1MxTgV XNcMmSBC0CX3bGdcrPkW1hK3R4qQCcH3qBfqN4ta9ZxF9m4iXkUZpMWk9zm8tXJpSED8 LSTGb4YsI1iu+Xiqeoh7dRv19YYUTE+YRoaG2SYJR0CzNYSavqlAR+HGNXYrf/9oAlPN ZLHmc3Y7loo10mhqAqrqmvpVh7BW8ESDoQmGxdH9vELCs/PAXIlwM/1PuhHcxs2WQj5V hKiw== X-Gm-Message-State: AOJu0Yw1qKwNnjTDkHFgdR9C06l2C2x92nyg0zy2eVoTqK459TfHQEKS zkjCTkX2EQaHnMLOaQBFw9xUHZVbq1bPqyq9H3T8huWKyLqU14Z5zTDwO6azdco= X-Google-Smtp-Source: AGHT+IE5dngRj18f8i6RwDvLOfTaR+NaGuG0HFrDkMjklBI4XS1sH5kBjqdxQLYKzXgxN9dl0GAWhQ== X-Received: by 2002:a05:6e02:b21:b0:374:a286:7b3f with SMTP id e9e14a558f8ab-3763f60ebcamr171188585ab.14.1719501225802; Thu, 27 Jun 2024 08:13:45 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-727450935cdsm1191758a12.7.2024.06.27.08.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jun 2024 08:13:45 -0700 (PDT) Date: Thu, 27 Jun 2024 08:13:43 -0700 From: Stephen Hemminger To: Konstantin Ananyev Cc: dev@dpdk.org, Konstantin Ananyev , stable@dpdk.org, Isaac Boukris Subject: Re: [PATCH 2/3] bfp: fix load hangs with six IPv6 addresses Message-ID: <20240627081343.744b612d@hermes.local> In-Reply-To: <20240627115531.1440-3-konstantin.v.ananyev@yandex.ru> References: <20240627115531.1440-1-konstantin.v.ananyev@yandex.ru> <20240627115531.1440-3-konstantin.v.ananyev@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Thu, 27 Jun 2024 12:55:30 +0100 Konstantin Ananyev wrote: > From: Konstantin Ananyev > > As described in: https://bugs.dpdk.org/show_bug.cgi?id=1465 > converting from following cBPF filter: > "host 1::1 or host 1::1 or host 1::1 or host 1::1 or host 1::1 or host 1::1" > taking too long for BPF verifier ito complete (up to 25 seconds). > Looking at it I didn't find any actual functional bug. > In fact, it does what is expected: goes through each possible path of > BPF program and evaluates register/stack state for each instruction. > The problem is that for program with a lot of conditional branches number > of possible paths starts to grow exponentially and such walk becomes very > excessive. > So to minimize number of evaluations, this patch implements heuristic > similar to what Linux kernel does - state pruning: > If from given instruction for given program state we explore all possible > paths and for each of them reach bpf_exit() without any complaints and a > valid R0 value, then for that instruction this program state can be > marked as 'safe'. When we later arrive at the same instruction with a state > equivalent to an earlier instruction 'safe' state, we can prune the search. > For now, only states for JCC targets are saved/examined. > Plus added few extra logging for DEBUG level. > > Bugzilla ID: 1465 > Fixes: 8021917293d0 ("bpf: add extra validation for input BPF program") > Cc: stable@dpdk.org Acked-by: Stephen Hemminger > + struct bpf_eval_state *cur; /*save/restore for jcc targets */ Nit: should have space after /* in this comment