Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp793187pxa; Wed, 19 Aug 2020 15:20:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6uRsdHOStBoVKweHKBlUe7a6MaZ1pPWPpm5mJa509e1rREPOYu6YMn9oq9CZ7zgxzQajy X-Received: by 2002:aa7:c246:: with SMTP id y6mr197240edo.78.1597875658724; Wed, 19 Aug 2020 15:20:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597875658; cv=none; d=google.com; s=arc-20160816; b=aboC+s+aUQdZi7rA877tRKsq4o8/XJtF2P1DUDzCzz6ydxlksO7FCHFE51/k0YYXna oFNnDKBt6Rz1Hsgir4rSyYuXu47mzS9rPflKkTlHcjUn41pJwFbd3wutFxT4YQQNI+tf yroEuJm+BAt2UwI+8dBktM1u65kX0So9z5HRklkCsqx1BCb+xVb3FA/aAyvb9HOBoPCW H2RtP/cmP8i2uX3BWFqDnWKzuavGQmU+5hyMEfRw9BfLTbs48dcIeitrqDWo1eI8vU5X pjyekdllAZHshVsrGa2VicNEBPC8A2p8RULtdPxj13hkHXtexqUs9AywaQo9+Lh/8oSE zBSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=c+nD+6rOSt5uemBROilNSHXJdZPlPNIu2EDTx+MPmGY=; b=jHNXO7nVqxgf6Jt0Z+HA629f0nseIkjcu0STO7uId2xc8CajOn7w8hACdwFH/D5ZMy vRwsTagrX4lgiVNvlWXO2yEi+8jAd/2v7RwEb2slIfhzTnkfaWUp277QfqzwefQu2QS4 pnkYKXe2Iic20Iwwa9TG3HXupdMja8i9thBNFa6o3IJ5TKqKU0gQjviMKTLn/YlKzSd9 ZYu2IXF8UNas/cftU/vrhCTgnb9fi3tbxn2q1cKdpAdfnJaxX8xLbKSxonKiXO9Jp6Hp EstfDJTAvNvnFvazVlWTNOPCMsuqD8W9L0cG3JNKINBtat9Fn8ssre3VVUSj9/Hid5Kf FPEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Ef522J+H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si194600edq.1.2020.08.19.15.20.35; Wed, 19 Aug 2020 15:20:58 -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=@chromium.org header.s=google header.b=Ef522J+H; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726700AbgHSWTv (ORCPT + 99 others); Wed, 19 Aug 2020 18:19:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38598 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726681AbgHSWTr (ORCPT ); Wed, 19 Aug 2020 18:19:47 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C90F7C061383 for ; Wed, 19 Aug 2020 15:19:46 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id d6so292844ejr.5 for ; Wed, 19 Aug 2020 15:19:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=c+nD+6rOSt5uemBROilNSHXJdZPlPNIu2EDTx+MPmGY=; b=Ef522J+HKC9VQ3bXTdQCKpaISrqMAApkaMt0vil8OTOF7bGl/toU8qGdBGUstpcOqL 7TvPKLv3ULgx8c5b25OU0ONXCq5g193Cxas0ff1KGyXSKNqk3GB+VuXaMUfUh3k1AT+s t0tZroI67koT3PQ7a/dFTvQC3LLqKlUymmTV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=c+nD+6rOSt5uemBROilNSHXJdZPlPNIu2EDTx+MPmGY=; b=Ugt0WZYKykmeVKEiND4v4X394TtSpisXy8MNzE5D8CgAmOyNImwWivlLpJtbBwj6Am 7X9Z3WtnYfhh0VIPYWhtQVl9Uw4EB8clzERBYeEVQrYniJ/9GteKOH6VVJekKfisuUu/ +AQqPphWsOhyQjoRXs9+UV7imf2xwMayEEErFcRQYeDPDP5mmBPS1pHZma4gLRprosMZ C4p/M+pkasS1EkaZ8mC2sk4PmC2sI313xBw13dIzW6HVQIEQ+Iyb+wOKikjq9JMAJPGY d8ZNq9j3IHo/wjFDXQPlyI2kJb0Bigvm3mwrSHC1GW59S22GelFEcWoleM/vY4LNduaw bDnQ== X-Gm-Message-State: AOAM5328r3ZXSG1UVFqi3PCYXtJV8vM7T2EYhSW5N0bc9mix+wQscGVg FbQi9sKrXH1E+UUbmIFvmjTquQ== X-Received: by 2002:a17:906:6d59:: with SMTP id a25mr453935ejt.193.1597875585467; Wed, 19 Aug 2020 15:19:45 -0700 (PDT) Received: from kpsingh-macbookpro2.roam.corp.google.com ([81.6.44.51]) by smtp.gmail.com with ESMTPSA id x16sm47545edr.25.2020.08.19.15.19.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 19 Aug 2020 15:19:44 -0700 (PDT) Subject: Re: [PATCH bpf-next v8 3/7] bpf: Generalize bpf_sk_storage To: Martin KaFai Lau Cc: linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-security-module@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Paul Turner , Jann Horn , Florent Revest References: <20200803164655.1924498-1-kpsingh@chromium.org> <20200803164655.1924498-4-kpsingh@chromium.org> <20200818010545.iix72le4tkhuyqe5@kafai-mbp.dhcp.thefacebook.com> <6cb51fa0-61a5-2cf6-b44d-84d58d08c775@chromium.org> <20200819171215.lcgoon3fbm4kvkpc@kafai-mbp.dhcp.thefacebook.com> From: KP Singh Message-ID: Date: Thu, 20 Aug 2020 00:19:44 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20200819171215.lcgoon3fbm4kvkpc@kafai-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 19.08.20 19:12, Martin KaFai Lau wrote: > On Wed, Aug 19, 2020 at 02:41:50PM +0200, KP Singh wrote: >> On 8/18/20 3:05 AM, Martin KaFai Lau wrote: >>> On Mon, Aug 03, 2020 at 06:46:51PM +0200, KP Singh wrote: >>>> From: KP Singh >>>> >>>> Refactor the functionality in bpf_sk_storage.c so that concept of [...] >>>> + struct bpf_local_storage_map *smap, >>>> + struct bpf_local_storage_elem *first_selem); >>>> + >>>> +struct bpf_local_storage_data * >>>> +bpf_local_storage_update(void *owner, struct bpf_map *map, void *value, >>> Nit. It may be more consistent to take "struct bpf_local_storage_map *smap" >>> instead of "struct bpf_map *map" here. >>> >>> bpf_local_storage_map_check_btf() will be the only one taking >>> "struct bpf_map *map". >> >> That's because it is used in map operations as map_check_btf which expects >> a bpf_map *map pointer. We can wrap it in another function but is that >> worth doing? > Agree. bpf_local_storage_map_check_btf() should stay as is. > > I meant to only change the "bpf_local_storage_update()" to take > "struct bpf_local_storage_map *smap". > Apologies, I misread that. Updated. - KP up here >> * or when the storage is freed e.g. >> * by bpf_sk_storage_free() during __sk_destruct(). >> > +1 >