Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4551847imm; Mon, 30 Jul 2018 17:27:50 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdY34FI3ZK2FwYM/+XskodPg8rkkqAMvYPj5EMLBvihkdFWGSywbbRv0oDtXkhoq0PKzVNM X-Received: by 2002:a17:902:7287:: with SMTP id d7-v6mr18092261pll.54.1532996870051; Mon, 30 Jul 2018 17:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532996870; cv=none; d=google.com; s=arc-20160816; b=Yr8kymNSFmLCfEHDq2wQ/Wnk5KLmHIpAyOOx092lB5AHMeEDZ/CqXNVqPoSqIfK1aV wCVauXjzgjCZC8JKs8f4JvoHePtvVWBp6bPvRSyFqR59n188NoHk970FrbjfT5NXpnxi 1jZBiV9NfMT6fcAx41vUx9R8O3eeLjk0WtkWcIH6k+4nVscMGVwp25Bi87MA1dm0DJOb +BsFZHZwDWsYlIcdpzimAecSDkHfZJp3nSJcK9YuqPdeempYJQoGDTCpZbSwxRFIVRr8 5hkr9/yI8uaaHEV8LyZ3MGuYcd9eoiz9gewpUVAjGIMqZyGVmXQ3UH01GZZxqM5lEODE FokA== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature:arc-authentication-results; bh=lML/9e5DPmfPBOELuLbRd8D4Yfl+H3yeH4FSFKo0z6I=; b=vFda8O0c0WaMgTDWqUd8oWsTsWZGfE4R8Lb/+eNUQY/3zG/d9yrgXwnaqypjePg1Rr B7KRgMxmXeW4CyhEULJ2i0R+eb1dyGvJ+Kls6I9xLOZDaRHqTLh9Ro527VtzgHCPNBJG uvynoJgg93yoDzbDBFgRF0w5FhkwNP7+XVysWBTg2o6oXC0gteZkqIH+vyUCvrubIKEx wvxVEwVVg+w13LeU6nmHjKEHiFMktRpQ4pwfER4dlrOU2oLWAqK+XSqVw/tj+Kh+PQvq M97n9FXTDcgqss+mmCKo8Sy/PYyqV+B0r6QvQiXQmqxK+YzUJfwPmLfD9kBzh9JY4de7 6IoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=PGyvR5mj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 68-v6si2036523pla.332.2018.07.30.17.27.35; Mon, 30 Jul 2018 17:27:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=PGyvR5mj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732164AbeGaCEQ (ORCPT + 99 others); Mon, 30 Jul 2018 22:04:16 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:40685 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732099AbeGaCEQ (ORCPT ); Mon, 30 Jul 2018 22:04:16 -0400 Received: by mail-qt0-f195.google.com with SMTP id h4-v6so14158568qtj.7 for ; Mon, 30 Jul 2018 17:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :organization:mime-version:content-transfer-encoding; bh=lML/9e5DPmfPBOELuLbRd8D4Yfl+H3yeH4FSFKo0z6I=; b=PGyvR5mjq/R1seCYScxKmdWcgBhVrqQvy6PFPpdCvEnUtkhLBfZB+GogzalXTl7ZeZ 90VYOTvD1NUOsHMAHjcV+yKVR0Or37TSZTXmvXj/l3474BWFgZHxPAo6Jnrceoupd7db XF8ZS/+eMLGhS4curGQFYEVnlNhYH/r/S9weLfTtODOWpySm7Wr8gw9YM3WJZdHqbGDp Z3P8ngqHVJ7w+R1wVGgSW2LyNCHHgOwxbCAWd2ZYBmkEv4twPigcP8/qmsHW0qECuXA6 oSoipRgaqhmo4hah3KtLH8kn4BlNlwHl+OufJeqLarWfdFViV6P5/V193+UCwrTxsa4T haVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=lML/9e5DPmfPBOELuLbRd8D4Yfl+H3yeH4FSFKo0z6I=; b=UrtkRqseZ6oHT1HBroFn8Tdc1cordF3HS83IHbjl9PPgLIwvqt+tIVZaCVYCju+mvC Auzr66dX21AgQTaUEfEc2Tehr5q8vzzkDIyVJociAxZQvibdwtB+NnE0ZzZS578kspZ9 lajQMr+uZNtr4zZ/kh2OZdgON29EmirpcpUZI0XA+uYYM0tRRMZRclnoE606tKYsk5oz jqmWyrDLbFlAx6CGSLxsseQQMlS3fWSDfD4zJ901XB3hlYPPCZ0aBnF6EGdJrD3A6J/l nj+VLepmWcfL1oYT4+olbTJZpukEw2DbenEslWYN4TLYuKh+u1b/H7yWnqSSCbyPY8Yu nJhQ== X-Gm-Message-State: AOUpUlFnFm/rHhDFiXxgK93e5fWzUxEXvPfykkFMGzO0OQKoNlxlWPAy DisiPoV103EtDeCSEApJp12T2g== X-Received: by 2002:aed:25a2:: with SMTP id x31-v6mr18637171qtc.228.1532996805528; Mon, 30 Jul 2018 17:26:45 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id u8-v6sm10201585qtc.76.2018.07.30.17.26.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 17:26:45 -0700 (PDT) Date: Mon, 30 Jul 2018 17:26:41 -0700 From: Jakub Kicinski To: Daniel Colascione Cc: Daniel Borkmann , Joel Fernandes , linux-kernel , Tim Murray , netdev , Alexei Starovoitov , Lorenzo Colitti , Chenbo Feng , Mathieu Desnoyers , Alexei Starovoitov Subject: Re: [PATCH v3] Add BPF_SYNCHRONIZE_MAP_TO_MAP_REFERENCES bpf(2) command Message-ID: <20180730172641.7d516231@cakuba.netronome.com> In-Reply-To: References: <20180729205835.34850-1-dancol@google.com> Organization: Netronome Systems, Ltd. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 30 Jul 2018 03:25:43 -0700, Daniel Colascione wrote: > On Mon, Jul 30, 2018 at 3:04 AM, Daniel Borkmann wrote: > > Hmm, I don't think such UAPI as above is future-proof. In case we would want > > a similar mechanism in future for other maps, we would need a whole new bpf > > command or reuse BPF_SYNCHRONIZE_MAP_TO_MAP_REFERENCES as a workaround though > > the underlying map may not even be a map-to-map. Additionally, we don't have > > any map object at hand in the above, so we couldn't make any finer grained > > decisions either. Something like below would be more suitable and leaves room > > for extending this further in future. > > YAGNI. Your proposed mechanism doesn't add anything under the current > implementation. FWIW in case of HW offload targeting a particular map may allow users to avoid a potentially slow sync with all the devices on the system. > It's also not clear how a map-specific synchronization > command is supposed to work in cases where we swap multiple map > references. Do we synchronize_rcu multiple times? Why would we impose > that inefficiency just for the sake of some non-specific future > extensibility? Add some kind of batching layer? The current approach > works for the anticipated use cases. > > While my preference is not to talk about map-to-maps at all in the > user API and instead spec the thing as talking about map references in > general, I'd rather have something that talks about > references-to-maps-acquired-from-maps than this interface.