From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C983C43444 for ; Wed, 16 Jan 2019 16:52:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C861A205C9 for ; Wed, 16 Jan 2019 16:52:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=fomichev-me.20150623.gappssmtp.com header.i=@fomichev-me.20150623.gappssmtp.com header.b="YbiTWH71" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388370AbfAPQw5 (ORCPT ); Wed, 16 Jan 2019 11:52:57 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45339 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729915AbfAPQw5 (ORCPT ); Wed, 16 Jan 2019 11:52:57 -0500 Received: by mail-pf1-f195.google.com with SMTP id g62so3312609pfd.12 for ; Wed, 16 Jan 2019 08:52:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fomichev-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=bYlcejWW4DHD7hI2ySaJazVCy3LXPlWXz644TDiJY2M=; b=YbiTWH715zpLdMl/MneYhIyAScNTQjA9ekPF8tgppVBvmVat5UduGcQ9RPFclE//XP ZovvlgJUHJTHxaaNPx7jTj8+lqv+N4kkBLpF0MhU5XkpRoSaYd+huNZdTeWho8lf3OJq G8zWBFUxCmZTC8YuB963Vt+mixFJSS30KNCcUgWKgY+jEWPNuKfAyG50IO2KcKMHRVl9 YjGohQi4e6k7ZZEkMbIKTSSuiAAbaWdGDxWsYmfRo7TCahmc4c96IQZ/BpdHutRq1Hha l4ANnInrV7fR2TQlhPGMlQamLaKrLFIefdpK+lY1Lx4MIBug8GEk4bEPiLTGfEzJl+yY y0Gg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=bYlcejWW4DHD7hI2ySaJazVCy3LXPlWXz644TDiJY2M=; b=UNWME0wus2chkRVVYQi4OqGMcAVKtW43IGLgKQJu10M+HCnZSImF9+wf0AkT9s4sQ7 sfeoP8fyhONibRSF5ZiPG64xd+HZ0kRmXLNXYnwkSXRI/Y90YEXACwN1oLweRN4Xvz55 Sftlz2fRbryTNpSsGuOAIzbf+3JU1kbRJ2f+meiRUsMZbJ8JruyK7j5mx/o4w2xNfCwK 06jsTCvvvmrN9o8Ld5p/YW7Aw4sRKWlCIn86SCF5JxBoP0wtxO4nXDVpU7QbbXWWTPzT HP+PX6wiXFiNjK8yL+Lr2oCSPu4IBWxxU3GvBuu+IGBiEw614whZCxSFZiOVVKF+rrE5 fgQA== X-Gm-Message-State: AJcUukezw5K/uiK31yZpjg8e8JXF55kyd2bM27e4FK9iWnubWeTJk+Gr CTpar+3h2Brk4qNF45CKEOa71Q== X-Google-Smtp-Source: ALg8bN7qMqTkheKHeC6j/5GqWthuJXNt/phvVdhDkhqSYmVcTNjDTZk6nr1Y9Wu5HKdbef8+d4nrsg== X-Received: by 2002:a62:8e19:: with SMTP id k25mr10673834pfe.185.1547657576095; Wed, 16 Jan 2019 08:52:56 -0800 (PST) Received: from localhost ([2601:646:8f00:18d9:d0fa:7a4b:764f:de48]) by smtp.gmail.com with ESMTPSA id g70sm11723462pfg.98.2019.01.16.08.52.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 16 Jan 2019 08:52:55 -0800 (PST) Date: Wed, 16 Jan 2019 08:52:54 -0800 From: Stanislav Fomichev To: Jakub Kicinski Cc: Stanislav Fomichev , netdev@vger.kernel.org, davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net, quentin.monnet@netronome.com Subject: Re: [PATCH bpf-next 0/6] bpftool: support queue and stack Message-ID: <20190116165254.GD726@mini-arch> References: <20190115232252.5736-1-sdf@google.com> <20190115175215.11816afd@cakuba.netronome.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190115175215.11816afd@cakuba.netronome.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 01/15, Jakub Kicinski wrote: > On Tue, 15 Jan 2019 15:22:46 -0800, Stanislav Fomichev wrote: > > This patch series add support for queue/stack manipulations. > > > > It goes like this: > > > > #1 and #2 add support for queue/stack in existing 'update' and 'lookup' > > commands by permitting empty keys. > > #3 make sure we don't print empty keys for queue/stack. > > #4 adds peek command, it's essentially an alias for 'lookup'. > > #5 adds push/enqueue commands, an alias to 'update'. > > #6 adds pop/dequeue commands that use bpf_map_lookup_and_delete_elem. > > > > (Not sure whether it makes sense to have push/enqueue + pop/dequeue or > > just have push/pop for both stack/queue, comments are welcome). > > Other than one part of last patch looks good! > > I'd personally be tempted to only allow the peek/push/pop commands for > stacks/queues, i.e. for maps which don't have a key. Right now even > though the help says: > > **bpftool** **map peek** *MAP* > > it's just an alias to lookup, so key can be specified.. > > Could bash completions also only suggest them when the map type is > right (and perhaps vice versa - not suggest lookup etc.)? I can look into bash completion. I'm not at all familiar with it. Also, let me maybe add some checks in the do_lookup/do_update which print an error in case key is specified when info->key_size is zero (and the same for value).