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 334A6437D7; Thu, 4 Jan 2024 21:32:05 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF4BE402B9; Thu, 4 Jan 2024 21:32:04 +0100 (CET) Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id 4A4434029A for ; Thu, 4 Jan 2024 21:32:03 +0100 (CET) Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-28cf8de47e3so584886a91.3 for ; Thu, 04 Jan 2024 12:32:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1704400322; x=1705005122; 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=ZyBU1YyH4TYCFee/BA+OQJFC/0/kJmo18qnWxe7Orsk=; b=WKoYiedbeloyszRoEMYU93OHdLE58LzqaO8DIEZ2enXlAlU+kC5yrzKWqkYqk0rGyw z7kbZy2LwR7lQjU/sb8otYiajmFXC6wg+eqQ8YofyhJLqrnxA0h7ERs9VB2OAbDI0aD6 hKOpoTAZN5jC3aU4lo8X1esz8B8cWHkRZ7T5u242oEARKjYzYjtq6Zs9x/YhEK24QF1B uaoYxJQ4JxrpjWXNWnF6FJSIjVgjQzaQ7KI5uXd+/PXNsQoX9AFtBSJfqwjhlNRfQZZg sbywlhylSRC2QeDGdZC6cpWWT6IXncNLAKbCjm2/j5gMO+TUlT8646oHruTQHxbRi3Jl BSSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704400322; x=1705005122; 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=ZyBU1YyH4TYCFee/BA+OQJFC/0/kJmo18qnWxe7Orsk=; b=sE7ZEm0IpVh2NkTfojAiVz4NmTjQhxYA6uzzcfDi0kiv8v8jDTAY/2dKJmh/P0HdNQ nc683zAZIAajzsa/EjBZ6NnurDVSAvuNRdy5pbfbHMORYQdWWO0rFmaoggEpaNF9vEy/ ICDR6uxv3ancOexxL/2+fQ4YUqGDjpJ/MZ4K7ykj83uRiyJ17FFtUAeAMjYsUoLtGmEg zp72ZI/LQ3WPMoK01Ng38KU08RSY3nen4XUO1JBV3udpa2HsuSuf5UjXh/FppnF0BVym dKDmkz1CCEWsMPscyoM+osmC144Fi27GogdjX02XkeUstJwrCDRDfdHm1mKaZewOggGt e64Q== X-Gm-Message-State: AOJu0YwTyrkKn1eBhc/emJZQv939gWiLxmRSKHT+0YOpafpHPPoylJyh HUFgwECXphTnHMYWY1p3vrh3IZiM3ktZdg== X-Google-Smtp-Source: AGHT+IFB0QPQuktAFqLK9ocHdPdvBqIgoYUOBhyJ8vdRsb4qg4KEwfnPkDphnKvt+nWb2SwnyNATaA== X-Received: by 2002:a17:90a:fd96:b0:286:a708:cd2c with SMTP id cx22-20020a17090afd9600b00286a708cd2cmr1022356pjb.9.1704400322155; Thu, 04 Jan 2024 12:32:02 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id f89-20020a17090a706200b0028cf4cb2c85sm144051pjk.40.2024.01.04.12.32.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 12:32:01 -0800 (PST) Date: Thu, 4 Jan 2024 12:32:00 -0800 From: Stephen Hemminger To: madhuker.mythri@oracle.com Cc: ferruh.yigit@amd.com, dev@dpdk.org Subject: Re: [PATCH] net/tap: Modified TAP BPF program as per the new Kernel-version upgrade requirements. Message-ID: <20240104123200.740ddfd8@hermes.local> In-Reply-To: <20240104172756.2213-1-madhuker.mythri@oracle.com> References: <20240104172756.2213-1-madhuker.mythri@oracle.com> 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, 4 Jan 2024 22:57:56 +0530 madhuker.mythri@oracle.com wrote: > From: Madhuker Mythri > > When multiple queues configured, internally RSS will be enabled and thus TAP BPF RSS byte-code will be loaded on to the Kernel using BPF system calls. > > Here, the problem is loading the existing BPF byte-code to the Kernel-5.15 and above versions throws errors, i.e: Kernel BPF verifier not accepted this existing BPF byte-code and system calls return error code "-7" as follows: > ------------------------ > rss_add_actions(): Failed to load BPF section l3_l4 (7): Argument list too long > ------------------------ > > RCA: These errors started coming after from the Kernel-5.15 version, in which lots of new BPF verification restrictions were added for safe execution of byte-code on to the Kernel, due to which existing BPF program verification does not pass. > Here are the major BPF verifier restrictions observed: > 1) Need to use new BPF maps structure. > 2) Kernel SKB data pointer access not allowed. > 3) Undefined loops were not allowed(which are bounded by a variable value). > 4) unreachable instructions(like: undefined array access). > > After addressing all these Kernel BPF verifier restrictions able to load the BPF byte-code onto the Kernel successfully. > > Note: This new BPF changes supports from Kernel:4.10 version. > > Bugzilla Id: 1329 > > Signed-off-by: Madhuker Mythri > --- > drivers/net/tap/bpf/tap_bpf_program.c | 243 +- > drivers/net/tap/tap_bpf_api.c | 4 +- > drivers/net/tap/tap_bpf_insns.h | 3781 ++++++++++++++----------- > 3 files changed, 2151 insertions(+), 1877 deletions(-) Patch has trailing whitespace, git complains: $ git am /tmp/bpf.mbox Applying: net/tap: Modified TAP BPF program as per the new Kernel-version upgrade requirements. /home/shemminger/DPDK/main/.git/worktrees/libbpf/rebase-apply/patch:98: trailing whitespace. // queue match /home/shemminger/DPDK/main/.git/worktrees/libbpf/rebase-apply/patch:243: trailing whitespace. /** Is IP fragmented **/ /home/shemminger/DPDK/main/.git/worktrees/libbpf/rebase-apply/patch:326: trailing whitespace. /* bpf_printk(">>>>> rss_l3_l4 hash=0x%x queue:1=%u\n", hash, queue); */ warning: 3 lines add whitespace errors.