Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3643131pxk; Tue, 29 Sep 2020 02:22:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdJ7FCyNPtBZ3yCmzKficeTMC/eOkwAH6XCNwJnsd1gMg4l4v9bCHpsrqpTJzIWiLa/6EL X-Received: by 2002:a17:906:cb94:: with SMTP id mf20mr3047865ejb.8.1601371361805; Tue, 29 Sep 2020 02:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601371361; cv=none; d=google.com; s=arc-20160816; b=TZYxwh2aViLY822kDWkeSHGh2pP+jaosCmGZYJeexdqcc0GV/ikOLZoOFckCz8TjRL ptXldBg24uX5r3PFsmglhEThFRz6T9FSCPxn8hpKuzti9V7VL5Z+xb4T0+YTRPR9gSzH Woup/dMtOfxgtBWpge3HEIdL7ayYVx1IkKEwDVoSrh5Tv3j1muwN+QUKydwKfeTfz6GP Z8vO0tgUYonUm63jCCTp6yQ36SkrobojC4xgk/wfw/Qe4mSqHrHbJ4asqDMbYdj9XaKF BjXGxCmiYiNG/X47/DKgHSr1eDAfc0+eZLR4BXaLURbAKsMZ5icGfeb8XnXXx5sGI8pK 6FVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=id5psVTZSDMhOlckpGo8CUqtpbTSRfiT9gOWo0ny4ek=; b=pJArPdgMVZkw3UM3R2/25pH5Yf6eS7Sh/wLuzS5SPSdSqP/WZAtQH+cWSRFK/lPUS9 yr5z0VkYHOvYhHD2EE4xGgqXj9WHQPGYqvk0nmD8zc91m90lVYVdPg3D29dsRcIVB3oQ Jdt7IA+nIsFJrnfjsURq5u39TVGH9WLv/cyw6EkeUJtFPT3gD5CzCe04ad9F1pvUQKQC HRmyvlMv4aDQm9jTw6vvPo4VsH4GeWBdHMgzL0yHMVmwmRVIwGPMA4tmVm+p80i8o1ZF H8BrBKByHq2Elbmv/I8/UhDhwtTs3lBa9goQVzojC9QRgIIL3wqtROHzvDTBSfWlsfKk MJBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloudflare.com header.s=google header.b=UYXIyfDh; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e20si2341137ejm.210.2020.09.29.02.22.18; Tue, 29 Sep 2020 02:22:41 -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=@cloudflare.com header.s=google header.b=UYXIyfDh; 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=REJECT sp=REJECT dis=NONE) header.from=cloudflare.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728014AbgI2JVT (ORCPT + 99 others); Tue, 29 Sep 2020 05:21:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727035AbgI2JVR (ORCPT ); Tue, 29 Sep 2020 05:21:17 -0400 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66E73C061755 for ; Tue, 29 Sep 2020 02:21:17 -0700 (PDT) Received: by mail-oi1-x243.google.com with SMTP id c13so4676959oiy.6 for ; Tue, 29 Sep 2020 02:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=id5psVTZSDMhOlckpGo8CUqtpbTSRfiT9gOWo0ny4ek=; b=UYXIyfDhH977ntPsM+7Oah43rWc7WFUVqZoHhuofAV+q6RF3NFEbVZay5xczF/VUZ5 sMVityv4M8OSy84DcK6AbcfQzSERk7VYSvBFBkAEpQCTjlxP8Z1YCzEfNfeCReBCVG6j GjIvRVGx0Glf5sBtrAQS+xN6ZzUjHEsUC/Ndw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=id5psVTZSDMhOlckpGo8CUqtpbTSRfiT9gOWo0ny4ek=; b=UQHZJzzrk4IcHj+cTYTInKhjGBPV48nEL7r2TcY+IZzdyifJCYnrHVsJz78vTcWVEt dyUgIiZUfaZcB0taPX5QRgubjjKT3Wp9bsLm0I2Y6PTNJuJ6qnC5K+2DjXofDIdeNQWx thGzfFb5KZJOIHySz+vYHQ45sHGM9FsdGcuHYVg44ad04x3O9Bii7P5V4jCz8Zr4Hmtn /FyEt0cZD9JJgiwQDB2B8Ya9uIZu3gwPQo5CSSGP39l5xy+gm+kJQQiG+hXJ5rS0HEhF hnBfnrJouJIHuCv+gHNFgcllcbq44abMojd3GIqyaPtqHHTxDSzKqvMPCMIJ0wR1aQGm ITYg== X-Gm-Message-State: AOAM5328ZfA8YsCuiqzBDsJZifDuSEYqsyib1fGPkmgMBcvH6YaEAlLe sSavTo7cI5cWw4bM/enwT62SCAEADGfQ3scpVF/j0A== X-Received: by 2002:aca:f0a:: with SMTP id 10mr1965385oip.13.1601371276527; Tue, 29 Sep 2020 02:21:16 -0700 (PDT) MIME-Version: 1.0 References: <20200928090805.23343-1-lmb@cloudflare.com> <20200928090805.23343-5-lmb@cloudflare.com> <20200929060619.psnobg3cz3zbfx6u@kafai-mbp> In-Reply-To: <20200929060619.psnobg3cz3zbfx6u@kafai-mbp> From: Lorenz Bauer Date: Tue, 29 Sep 2020 10:21:05 +0100 Message-ID: Subject: Re: [PATCH bpf-next v2 4/4] selftest: bpf: Test copying a sockmap and sockhash To: Martin KaFai Lau Cc: Shuah Khan , Alexei Starovoitov , Daniel Borkmann , kernel-team , linux-kselftest@vger.kernel.org, Networking , bpf , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 Sep 2020 at 07:06, Martin KaFai Lau wrote: ... > > + /* We need a temporary buffer on the stack, since the verifier doesn't > > + * let us use the pointer from the context as an argument to the helper. > Is it something that can be improved later? > > others LGTM. Yeah, I think so. We'd need to do something similar to your sock_common work for PTR_TO_RDONLY_BUF_OR_NULL. The fact that the pointer is read only makes it a bit more difficult I think. After that, a user could just plug the key into map_update_elem directly. Alternatively, allow specialising map_ops per context. -- Lorenz Bauer | Systems Engineer 6th Floor, County Hall/The Riverside Building, SE1 7PB, UK www.cloudflare.com