Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4564287imm; Mon, 30 Jul 2018 17:46:57 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdjpFtOmFVd4aniiTnqlAhP4bok0sqCq7xGIu7cpuy6izf/cIEmQMam1x1g/vmum1yV3ccS X-Received: by 2002:a63:cc04:: with SMTP id x4-v6mr18065086pgf.33.1532998017705; Mon, 30 Jul 2018 17:46:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532998017; cv=none; d=google.com; s=arc-20160816; b=tfu9BmcV6MXONImN0GvkLce6QOamxm1rn0MWGatCBqLi0ohOmnlErsuJMnX92L1fdU 4kRHgfEt58Ch2VyDYcHO7y0hmXe1fXYbNoMQkMueQIPYF0tym5eLRsOvekzVnA3XL+q2 zLlnvQi+x7CM+3nFsEo5SH/FX35UG2UhcDG/330DhZILHgtwpGlojeM+RbnA4uXtrjC2 489NA/8ovRcK6AtWdpX3Kl3WMUZFELlqUKMXIQ8yuO7v2S6xBFENN+s7vWu0r5SJQTcf Yq+yTbDGjz6BtT2zWcZ2dSIV+ixUn28NpAk+NydP39duT37P8YkkDZ5Fr/E/zYy1pPiH 90FA== 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=tmw/T5rJ4fdzeuEmqCo+m6/mENG3MXY4i+hJcK7k80k=; b=LHxY7YKVVhD3VlvOrTQ9t6uOGU7QTvNuuhwsF3UZIPJd2dAU/9snUYICZAmsJVyIHt XsXc8w4JuOydjkoL+wSK+fgY96/gj6v9Cg0oM1qEEI2JBqdOnOjlrTfzy3Dyv6rbjTF8 S7i1KSYGSVA4R4BZqWlqjWhmc3s72zTCUsIZKtSdtw6a5IgdIbPuSGvxsXF9ZkUCLagR vkj53VmXaifl1d1ZtjtyIu03XRPCYm8HHO/MqEkr5qbhVlAq3Thf6DJKC+xtCautNPo0 TqDIX1G1esW6pRHYtaYOjobTzc4gf3AcKlcauNhzUHj6fqY4WUr9/5sod7tDeX8x4IV5 cAuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@netronome-com.20150623.gappssmtp.com header.s=20150623 header.b=HmgHCSMF; 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 c25-v6si12159703pgm.523.2018.07.30.17.46.43; Mon, 30 Jul 2018 17:46:57 -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=HmgHCSMF; 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 S1731697AbeGaCXN (ORCPT + 99 others); Mon, 30 Jul 2018 22:23:13 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:36458 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbeGaCXM (ORCPT ); Mon, 30 Jul 2018 22:23:12 -0400 Received: by mail-qk0-f196.google.com with SMTP id a132-v6so9141243qkg.3 for ; Mon, 30 Jul 2018 17:45:37 -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=tmw/T5rJ4fdzeuEmqCo+m6/mENG3MXY4i+hJcK7k80k=; b=HmgHCSMF9ngA21Kdsf81IJAM+jdGcOvOkL+NpcXFVryk0lxwkGoEoZImvjSrPRh6BN FXwzEw94DqDS0Y7Ktnf3QzGeMybpLLFMQiwbbZ+It27N/VedTmJ1eZl0CnpwRDXKR3zb wzSfnsn2XYXbJct40ADo/iEVUyr6L9Z56GVMgFzTm32QidiugGlG2V4IPBmGaL6ozkep q8cs/AGHBvmH8G1BsXSgsC0f9UQxVxGcDjAN+j7yuZkOgXNUrgLWfi9YsjPt2cMWo3HQ 02SZMM/QJKGvg+uUx8YhbF/u0iNlfj6/oi4K6YEH/a0eb9MVTmVUageKoynsrMBA7a3q 17TQ== 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=tmw/T5rJ4fdzeuEmqCo+m6/mENG3MXY4i+hJcK7k80k=; b=j6j73nkP6kYbn5W7aTWU3qsW9B7p1xL2Jbf5oDY5+ic2NG7qR247g4n9IOFcBnXwnS lRn6h3toEaAy2dzMzX5wPuiLxfpHiYsU0l33yzRkl2dKAzp2rmpfxg04UhVAP0785Zbg VoujgGsZIHIBDsxuYsVfEMJbtjeGORE23QkflWKunpxx7dgiEVm4AH41yt23lfEQahVx 4bWUSrgBOS3DJ9/j9OCZi2doLQE4J4dO/z5zyaczwUEZTqPwyqAcer2t7DAUCNE1EPr4 xQs0kioIfgr8xin1knYK4E8vIwLuj4ZZw0Tclw7sUa1h/h17W/QHJeEjCBv4lI84a5zt WB8A== X-Gm-Message-State: AOUpUlFbQ6Jd/dR1ljCtz7gN4DT9kz1OtmnudmDwk8wu86LI+L2kG8WK mVcsUIRB46MBK3dmLLGR6qnPzQ== X-Received: by 2002:a37:b445:: with SMTP id d66-v6mr17500378qkf.357.1532997937144; Mon, 30 Jul 2018 17:45:37 -0700 (PDT) Received: from cakuba.netronome.com ([66.60.152.14]) by smtp.gmail.com with ESMTPSA id j45-v6sm11075834qta.46.2018.07.30.17.45.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 30 Jul 2018 17:45:37 -0700 (PDT) Date: Mon, 30 Jul 2018 17:45:32 -0700 From: Jakub Kicinski To: Daniel Colascione , Daniel Borkmann Cc: 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: <20180730174532.20010e0d@cakuba.netronome.com> In-Reply-To: References: <20180729205835.34850-1-dancol@google.com> <20180730172641.7d516231@cakuba.netronome.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 17:33:39 -0700, Daniel Colascione wrote: > On Mon, Jul 30, 2018 at 5:26 PM, Jakub Kicinski wrote: > > 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. > > Sure. But such a thing doesn't exist right now (right?), and we can > add that more-efficient-in-that-one-case BPF interface when it lands. > I'd rather keep things simple for now. You mean map-in-map offload doesn't exist today? True, but it's on the roadmap for Netronome. Tangentially it would be really useful for us to have a "the map has actually been freed" notification/barrier. We have complaints of users creating huge maps and then trying to free and recreate them quickly, and the creation part failing with -ENOMEM, because the free from a workqueue didn't run, yet :( It'd probably require a different API to solve than what's discussed here, but since we're talking about syncing things I thought I'd put it out there...