Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp196278imw; Wed, 13 Jul 2022 23:01:22 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vy/TxA62utLOcPyOJdivDlW7g3dCZlUBK7hmzk0I4QshE4kxMNQ58T+/V3252gO4iazZsD X-Received: by 2002:a17:902:d4c5:b0:16c:48bd:3585 with SMTP id o5-20020a170902d4c500b0016c48bd3585mr6929826plg.79.1657778482104; Wed, 13 Jul 2022 23:01:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657778482; cv=none; d=google.com; s=arc-20160816; b=j2G+z9Lsn9jkpz3EYsiwKVRiGKLlDyeIHZEFvwz/24+33I/411xi3ZfbAC4hLKqLdK +R+7NJAmUZajd9Bn+dg2NkEpc54LTljIWjVrOnNtT1c5ZfLR4ay1yuDsMH2owasIUXFr ZWhVXN0wHewQgMAVAc4RtDDhb0kIJDy+XIno1tCz3mvvv1vDvkPAChwGEUW8d6u2OuqB rMZxMG36WdqkwT0NC4PQ9mdm1+r//WI9LWODI4+mornts5ocFveZtdN3XB5gSba/dNeE BbkQSQsUaJRAdu3cpUw2KlMXp67D/etuGVJPYMwAN0w5AjmiHvKxk53Ad3evk5RwjRqj fPpw== 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=fddzfmY1VQJk/xZ5uftP/6jRX43mYICKRVm1mF6JZ+Y=; b=uTe3P8Ry4NN06G3T4gH+GgSb0flvkNbQI9hZhsCcRLbUIJxU+TNYiwcMDoMV0IG/ZB 24RIbBrg7qAS/H8/onIMnGSg9MleFxr7UXarilMDPfYyQZaxEu1Vxcx4+H2gynNcuBoR ob2WMu0VDZIHPQqatr3VVRVcWAWmJM4vYbiAlQyuImLG7NPp2qvRCjkAd81uofwrlDIY 4HIKd/MjYtkkMrMNUHiSKa7H8J5J0s/08PWJq0PikQo3Aj9T+9D2PyQClFITE1XiuaN5 Yzt5kVWsZFeDBUXWxVrfA/ViRLsFMPBfw1+yjEL8fSDhXfpu4RRLq9w19LZTWwlxDjwO 5GaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=goDk9hhm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k82-20020a628455000000b0052aceb310c2si1168151pfd.95.2022.07.13.23.01.10; Wed, 13 Jul 2022 23:01:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=goDk9hhm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234724AbiGNFyQ (ORCPT + 99 others); Thu, 14 Jul 2022 01:54:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234379AbiGNFyO (ORCPT ); Thu, 14 Jul 2022 01:54:14 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BC4713CCD; Wed, 13 Jul 2022 22:54:13 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id os14so1507279ejb.4; Wed, 13 Jul 2022 22:54:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=fddzfmY1VQJk/xZ5uftP/6jRX43mYICKRVm1mF6JZ+Y=; b=goDk9hhmMO9rA29ENrdgWRn/vKUdqrMLKd/6Xl85OO1LpbfXvF9sSjJB1ZcZ/CyQhf Xl/agqJ4EF1zpgpqYzhtsgHTMYYfczMVOAhRJ0q9Jf5cojatWL5AFedi5DtRuaHXO4Nj jLpC/DpkNYCQFAYaSeDa3MDGi2lSgC6RL/0ofd/KJzUnmlo14cwF+R6V+4QkIv+7PHCJ hzNxdYgiEvCcxBPxmAvRsRzUTLEsRSDPqLJrJg9wLLH2QsbgixG/5gffyAlcPYp98bVJ YvStbUyOiviJrQkQC+ATR0DIRqNG37XeQsmOFd1ff8m0W5ZL5NDQQkDK9WAqhBS60hk4 it5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fddzfmY1VQJk/xZ5uftP/6jRX43mYICKRVm1mF6JZ+Y=; b=OSZzTafmNw9vvUcp3pW9C/D3Gim/pXWBst97/ZWe0g2NC2TKMLgj39r3WCLotnD5ee M+wjipqcURC40qT8O0QbJNlzI6nFHHNRnAQGwqBotwOT3wUq82S2vDDPrqfHUoxzWkr/ 23wa/L/uFoVkVGWPk+P9HbfkGFePOPeX8xu4q9XjoJ4ifI3ysMHluIwMRaMYHg+J0PEH TB6qnnxLVDO5OH57x/xLS+HLKgrzJ493bfmB+NX03VOVqpfH/PSNwKFBiSrjm3JZgBRM 9s7hGmig8CPZelg6eOKuJOWvkvH412L30oO/T5MwBLN8ZJgmuOZ0xR1uarJci7vrlD2l L/Eg== X-Gm-Message-State: AJIora9S3GRqvn+Y3rEcv15DsiJdJDnWHQR+9d/ap2BCWVnVlEh36QBr +bjRQ1z0ayYFHp1lYAhYIeoWvs+cs7ykLKCtR1g= X-Received: by 2002:a17:906:3f51:b0:712:3945:8c0d with SMTP id f17-20020a1709063f5100b0071239458c0dmr7086679ejj.302.1657778052209; Wed, 13 Jul 2022 22:54:12 -0700 (PDT) MIME-Version: 1.0 References: <20220713214246.2545204-1-jevburton.kernel@gmail.com> In-Reply-To: From: Andrii Nakryiko Date: Wed, 13 Jul 2022 22:54:01 -0700 Message-ID: Subject: Re: [PATCH bpf-next] libbpf: Add bpf_map__set_name() To: Stanislav Fomichev Cc: Joe Burton , Joe Burton , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Hao Luo , Jiri Olsa , bpf , open list Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 13, 2022 at 4:02 PM Stanislav Fomichev wrote: > > On Wed, Jul 13, 2022 at 3:32 PM Joe Burton wrote: > > > > > Asked you internally, but not sure I follow. Can you share more on why > > > the following won't fix it for us: > > > > > > https://lore.kernel.org/bpf/OSZP286MB1725CEA1C95C5CB8E7CCC53FB8869@OSZP286MB1725.JPNP286.PROD.OUTLOOK.COM/ > > > > > > ? > > > > > > The idea seems to be to get the supplied map name (from the obj) > > > instead of using pin name? So why is it not enough? > > > > You're correct, this approach also resolves the issue. No need for this > > new API. > > SG! New helper might still be useful, but I'm not sure how safe that > is, given how much we use the name internally in libbpf > (name/pin_path). So it might be safer to use Anquan's approach for > now. > > Andrii, any concerns with [1] ? Should we pull that in? I already applied [1]. I'm uncomfortable with bpf_map__set_name() in general, because map name is tied into BTF and other things, so it needs much more careful thinking how to support sudden map renames. But given the problem was with bpf_map__reuse_fd(), I think [1] solves it already. > > [1] https://lore.kernel.org/bpf/OSZP286MB1725CEA1C95C5CB8E7CCC53FB8869@OSZP286MB1725.JPNP286.PROD.OUTLOOK.COM/