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 3071B4550C for ; Thu, 27 Jun 2024 17:13:48 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 293FE42D89; Thu, 27 Jun 2024 17:13:48 +0200 (CEST) Received: from mail-il1-f173.google.com (mail-il1-f173.google.com [209.85.166.173]) by mails.dpdk.org (Postfix) with ESMTP id 8751B40A82 for ; Thu, 27 Jun 2024 17:13:47 +0200 (CEST) Received: by mail-il1-f173.google.com with SMTP id e9e14a558f8ab-378d954e505so6211155ab.1 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=U4UwKiNA7rs5/iibxRznXDziQjXzcaUUuET2dx6fofyFSZrkSL+Z7ZZuj7nTKGYI03 palIZwomGZE2GdZDtKDku4hgLo+ZZzorNy3eHt1kDy7VO7rh49tbTDMoWGQ43P6NmZal /0QLVdVZNWl+9/ECKTBNLp5J7+0Re+lOe89Mfhs468qlI0usKb0SAo5zSzapHyPdpo+/ c7MqzFNIH/N30STIMtd3CdmMLYpo4Lw9wvHJaXMwqapC9195OBrfiI4Sjl5v/JRFG9W4 elAOCz1FDEMuoWFpJBkuFXYAk6sDPsm2+cn5UMkWRuh/w3dQ92tz26X1XsCbEqMKzJPU m6kQ== X-Forwarded-Encrypted: i=1; AJvYcCVt55T3FiUv6Qd8EQlb8GF+JN5mH1/RuHhFu7CHklnnLP45nM8fwSnoAjamYMKTe2MqoEYndZLZrnxPLiDim4M= X-Gm-Message-State: AOJu0YzuIti4bjO8R49E70pSoKi4lEmui5zS48PzOBYqc1+rEii4b1i9 Edb6NN4dmBPWFNkRmpQ1GxHnmf0Mu/oGqF6XbxarTaDwUMR/iiWHRrFj0lePEZY= 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: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-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