Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp244774pxb; Wed, 3 Nov 2021 03:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMpinlSpwsSyUF81ohta/ir+pRyj0pbhGeJZztZsAPkmWvziilEpljc+pYz5q0lL0PAnFR X-Received: by 2002:a02:ac12:: with SMTP id a18mr20735794jao.78.1635935732905; Wed, 03 Nov 2021 03:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635935732; cv=none; d=google.com; s=arc-20160816; b=UNdOaDhJQSLiUxEHE44hSOYeArCdUUdmuhveaJatEDp8fbT+I8ESaD432yZMeeQs3y 3uXWXJH41fq4E7x0yrQiGIg2S2sAGPjVcMQgz1nJcx08dqGVSNBR9AXRrrE8dFaulGYM K/gYRXtXGkgE5eO9B7UknL+epOyf11l6mHSuQZv1QPFUAZaxAiIoLD/pjn15Qk+5eQIx YGwHfZuQzFPar8+tkNy01sn2b9aVM8f74eyth5MF5gwti00pScEbwpDwCpJQKQuvkDr0 013aFy6/MVzjdqycPAwhkFWPt8a53CWGakZklGiCg0y6x8+tHbRzJCgTE6i1uzk60BSe VFSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Xom/hPiNgRklPy6PHcPTBsv7vizg3n2pK7P+Hb9c8c8=; b=zW7sI7Oj6QTvVP5J7apOqUuWyBHEDRAVQTAHxebJY5kZxASHPLAKzlRe383txQD3pF 5QFlpAAXPVMWlwB6Dx86p5ffYQmdUf2ogomn3hWGCAh6mOX4SkALW8RpYyTwALar6h9O 68uwyOWhrKO9ZFMDfRCnqeX8tcV/HseV/7K7FwlmH97Pqe6qXrbgMTjzhzNQ/FnpchOw Vz8YXDxWDPIxfeTQyKTrcAPo4TB61UqzusM800Y2huskfV1yXspkp9fLr5btnui0p5cT w14kPoZgvu0lz2iVAbUq+RhsxoBeu8/hYQW6kKEGEiJU8Jby4/AZ98ni8cXfbxEWK08r IMYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mojatatu-com.20210112.gappssmtp.com header.s=20210112 header.b=lp00QQOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y1si3312202jat.66.2021.11.03.03.35.15; Wed, 03 Nov 2021 03:35:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mojatatu-com.20210112.gappssmtp.com header.s=20210112 header.b=lp00QQOs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231757AbhKCKgs (ORCPT + 99 others); Wed, 3 Nov 2021 06:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231939AbhKCKgr (ORCPT ); Wed, 3 Nov 2021 06:36:47 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBE57C061205 for ; Wed, 3 Nov 2021 03:34:10 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id v4so469135qtw.8 for ; Wed, 03 Nov 2021 03:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=Xom/hPiNgRklPy6PHcPTBsv7vizg3n2pK7P+Hb9c8c8=; b=lp00QQOsPKxBS5e3MyUDUTuCVQF3o1j2ruBENN32WTbQ+VSvXRahf/mNw9oPtwnS54 ZtJUwPQp518dkw+Tonau/iePibZv3mYllnivU9e1tVi6ENCUiDJOaYhytTPJEFJCWdOu ZM/2FkDWVff79sfaG0CVaqxsXKUN1cCE9xt/MfZi2olugzVRuRQH936IjxK9tG/lc0zl AiPmFWVBE78FPnGXQLJJKEVlFSOVsBKmyV3DgWydRK0Tq4wbzKeCSR3m8eZEhXrVgQky 5SOwMDYKm6RNdjbmUUjcAnb5j7KhqBOgwVw25nHfNRzaw/FKpjyWw4Vmhq7WthGYPl9g DVUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Xom/hPiNgRklPy6PHcPTBsv7vizg3n2pK7P+Hb9c8c8=; b=75QH7PRNvQwFAdzkNa4LMIsUpAv84YZbMgdohLgPuaU9H8O8M+s2eeMxK90FISUxGC tq4QwjXKcrrMt+O+D73G0pp41j1pE8GqEHo+lJfMAxlHWcudesS/JDus8EugnXntRWAY Vi8rTXBK7Xd69HgCBwOlvuH0aucv6I2XkPeObIWa0oOqNv6RtX1IX1quBJNys2lYdffk 7WeBU7LWk4aCh7Mlx9Tqkd6ZSmANIW/GkZbeU4j6gkvnFmnb+ke6HiNFhU0qoMDfbS4Q 9r5MhOfLIdPLm8i7fBavuAPQXlAn+dfchLK35p5P4f73kyaflntAP5ICtuJuH1/Fv8b+ M7Ng== X-Gm-Message-State: AOAM531lBWalrMqngGKNS/BmgCinFJ6jVEXe4I3IOm1cn8/eNJ69arV9 qZoTNeN8BFPdEkvDPoe/Bfachw== X-Received: by 2002:a05:622a:107:: with SMTP id u7mr21943459qtw.79.1635935650114; Wed, 03 Nov 2021 03:34:10 -0700 (PDT) Received: from [192.168.1.173] (bras-base-kntaon1617w-grc-33-142-112-185-132.dsl.bell.ca. [142.112.185.132]) by smtp.googlemail.com with ESMTPSA id r7sm1329295qtw.56.2021.11.03.03.34.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Nov 2021 03:34:09 -0700 (PDT) Message-ID: Date: Wed, 3 Nov 2021 06:34:08 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [RFC PATCH v3 0/3] Introduce BPF map tracing capability Content-Language: en-US To: Joe Burton , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org Cc: Petar Penkov , Stanislav Fomichev , Joe Burton References: <20211102021432.2807760-1-jevburton.kernel@gmail.com> From: Jamal Hadi Salim In-Reply-To: <20211102021432.2807760-1-jevburton.kernel@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-11-01 22:14, Joe Burton wrote: > From: Joe Burton > > This is the third version of a patch series implementing map tracing. > > Map tracing enables executing BPF programs upon BPF map updates. This > might be useful to perform upgrades of stateful programs; e.g., tracing > programs can propagate changes to maps that occur during an upgrade > operation. > > This version uses trampoline hooks to provide the capability. > fentry/fexit/fmod_ret programs can attach to two new functions: > int bpf_map_trace_update_elem(struct bpf_map* map, void* key, > void* val, u32 flags); > int bpf_map_trace_delete_elem(struct bpf_map* map, void* key); > > These hooks work as intended for the following map types: > BPF_MAP_TYPE_ARRAY > BPF_MAP_TYPE_PERCPU_ARRAY > BPF_MAP_TYPE_HASH > BPF_MAP_TYPE_PERCPU_HASH > BPF_MAP_TYPE_LRU_HASH > BPF_MAP_TYPE_LRU_PERCPU_HASH > > The only guarantee about the semantics of these hooks is that they execute > before the operation takes place. We cannot call them with locks held > because the hooked program might try to acquire the same locks. Thus they > may be invoked in situations where the traced map is not ultimately > updated. Sorry, I may have missed something obvious while staring at the patches, but: Dont you want the notification if the command actually was successful on the map? If the command failed for whatever reason theres nothing to synchronize? Unless you use that as an indicator to re-read the map? cheers, jamal