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 5BBD5437D7; Thu, 4 Jan 2024 21:57:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2EF11402B9; Thu, 4 Jan 2024 21:57:10 +0100 (CET) Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) by mails.dpdk.org (Postfix) with ESMTP id 117F14029A for ; Thu, 4 Jan 2024 21:57:09 +0100 (CET) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1d41bb4da91so5886775ad.0 for ; Thu, 04 Jan 2024 12:57:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1704401828; x=1705006628; 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=ldIL2rRQSujM1MetaqaQ35DTxMhO5nNKVrZHO0JutMM=; b=mxXP1+qQ/rEiCrmwOuStlOI38u00VGL/aylPehyk5qTwQfruzd8ljU47yBL8oLUMFb +IIpJ/Dv8gHka2IzQdVvqbKpSBGx2LBZYrK28QiHPtlfsZxbiQw533afI/6UQNj/c1/8 HkIdkGlYO/vjuxmIsObuVJBM8AgW+o2E75Z7ySewz85K6+JxJF4JyrwcSZ7WP8GbuBpb ZxyaIHHbyV8wNtESPGXgk0Y1kQRw49Sc0+8+o8aWX13XYklCWvxAbHTxdoMDUWW5XAYT FAtae+gRUmZGt1W1xVixpO8QCmKiDKKSMLQDi7IgoOriEnwf2P1c91/zhagsRLpIO/Yo MxDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704401828; x=1705006628; 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=ldIL2rRQSujM1MetaqaQ35DTxMhO5nNKVrZHO0JutMM=; b=n6oh8usHIeNrxuuCwE24wwUjiD3Q18m8ExudTvIus44LRmogwZD1mkYzrgTgDgaVpU GjELE3pmCTe3WJJa4EkcDfc6Sk5rCoghtoUmZS9MFRmWWNNTtLYj9dq1Mbs8ahplFJJS kNI85AFrbbDfxFUwNlLDZ/KWlrGQQnTs0pLBOZFyFKKtkKuEw5XPo2npQ432+TmTRf59 mtWpBg2pyyCswJ9kBOeLuPO0TmRSs7Mf2hUFwpHJsCiNcOEFjlovcNwsO200CeoeobSN rpsJRHoN8dxfpLKP3Se9hmM1g8pljR48ZxH98TuBfdzdgNNjdP3QmCOVyfFjtKRZ0Q+o SrdQ== X-Gm-Message-State: AOJu0Yyo2NTy87v9a/HRtDPM1f4bJoV0yNTSM8/xeQIgr05N/IZxtH0G g1XYyUVJY+jvRRRggpFOh47jaC8MtCBseQ== X-Google-Smtp-Source: AGHT+IEj8Sl4fpaRXWjo3TUESaJVjFn1soI+D9+o4YA9VwGfpYA6XPnQtdSEq+jgVfGiu5Z35u8YNg== X-Received: by 2002:a17:903:2301:b0:1d3:ecc0:9cd5 with SMTP id d1-20020a170903230100b001d3ecc09cd5mr1105954plh.60.1704401828267; Thu, 04 Jan 2024 12:57:08 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id l4-20020a170902eb0400b001d33c85ce1bsm50421plb.2.2024.01.04.12.57.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 12:57:08 -0800 (PST) Date: Thu, 4 Jan 2024 12:57:05 -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: <20240104125705.3171fe53@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: > ------------------------ > > 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. I noticed you are now using bpf_skb_load_bytes(), but the bpf helper man page implies it is not needed. long bpf_skb_load_bytes(const void *skb, u32 offset, void *to, u32 len) Description This helper was provided as an easy way to load data from a packet. It can be used to load len bytes from offset from the packet associated to skb, into the buffer pointed by to. Since Linux 4.7, usage of this helper has mostly been replaced by "direct packet access", enabling packet data to be manipulated with skb->data and skb->data_end pointing respectively to the first byte of packet data and to the byte after the last byte of packet data. However, it remains useful if one wishes to read large quantities of data at once from a packet into the eBPF stack. Return 0 on success, or a negative error in case of