Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp497788pxf; Wed, 7 Apr 2021 05:00:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgvFiD9W+hCYzXIRl45CupJysUegl4KqzhQyecdJgEUaoBWgKAh+9W10CBpHbhYMNTCM3i X-Received: by 2002:a05:6e02:148f:: with SMTP id n15mr2564235ilk.265.1617796819716; Wed, 07 Apr 2021 05:00:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617796819; cv=none; d=google.com; s=arc-20160816; b=BexXVJrXrmp4vlbdT8nskNThoaDBu2hmbbyOC/t2idyjhbya02ThBcTLqaP8M3yyTJ rAs4lICwYBqWygHNNUs3LJIkN+Mf0Ot9JHxWQIWyBNPFWuigkLaOt1Q0qP/6+NQbq3br 0uDshcK3SfHZyKZpqxGqVAG/3MpoILgpsqqKueCol3lz3L9YTGjvD1nypCIQkKKQaoxi yLBOBQ50Qfc43OzMSiEVr4xOILAd+CAzP6ztlndETmCQw+zcy04+1zDawt3FvOwU20nd 6jeOBSupOG7dl3B0D7b92gxWSUwruZboom/37SzkFdOBexHmxGEFkx+419XPukVX0Dpb +w3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=fR7uBE+KZgKRNGirNt0J9yqoqy113eytjrhGmdX8vhc=; b=0ZyDZrrtksuQDmQGIDhDSUJzdDvc/p6pgO5Glo5kMJdbpWTjbudZj0qTIhJg8Ri8EO +OWud1tIyI3iR4mEAmoiOs23djhC2KtP6tmmbpCbZ7M9fFgtazLGzfOPZPlUvPwzOFS0 ewDF8FEgN0l3HiTgM0UyDfTrVkc9V3q5LOvT78G/RY9sG6eTC7XkaTASJInJKswhemoL J65ks1LIr3sCz/Q7+EDNRjBqIXjpNBVRDpECyDVN5QIJb4HZLgHqgWqaHWK20HUuys8j nzAg6toa7+mto5oUJxewWDdOspFNKtqdtHjcNGqquUS6OSbgwel3AY4RYMPU5lw6n4LO F+gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TojC3B0s; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 10si20541268ilq.136.2021.04.07.05.00.06; Wed, 07 Apr 2021 05:00:19 -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=@gmail.com header.s=20161025 header.b=TojC3B0s; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235521AbhDFTFv (ORCPT + 99 others); Tue, 6 Apr 2021 15:05:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230391AbhDFTFu (ORCPT ); Tue, 6 Apr 2021 15:05:50 -0400 Received: from mail-pl1-x643.google.com (mail-pl1-x643.google.com [IPv6:2607:f8b0:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D668C06174A; Tue, 6 Apr 2021 12:05:42 -0700 (PDT) Received: by mail-pl1-x643.google.com with SMTP id p10so2901350pld.0; Tue, 06 Apr 2021 12:05:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=fR7uBE+KZgKRNGirNt0J9yqoqy113eytjrhGmdX8vhc=; b=TojC3B0s7I3+/nfSWs80/9xaTunkHwnkKDBu0qMg6TLU4XRxHMsgSdErm3Rmk3JsJU mryDZ+lYvgfSbnj2+2DV+tNy2hSnZzx9JSrwv05R4WdMAhs0ldJA89oJuEcMaEwRndqS MYny9f2VB0fXOvTK4N4sVcpxeE/Rj7Ws45TRD7hgPxX5eQIYECZ56yD1nAnqoFnWWeL1 eGCWd7lCWR1nvBSe7EnoOCkg/OH0bhhpF9SykB/kkPf0+nJ7MSvuSYGOY7shixqk36UC Dj+tJMc9KRxOBwmpf6HwkJQicZBtHFvS1JDVL1le3a1DwLNXmIHGHzqKgTLlur+jthEJ 5ZcA== 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; bh=fR7uBE+KZgKRNGirNt0J9yqoqy113eytjrhGmdX8vhc=; b=aodHXExjcJa1UBJzDo74A5a/hp4E2KMQgyZEk3RbMjZY9B6LgkjAUEukUKobmzxN/W ts7IqeeqeV4WvyBEEG9UrJKjf7Z/V03Jc3z7CDokOkdq/BRfT4xpoD7D1g5P5Tz+Pz9Y ww0vLStlrsYKbr2nqPVFImX5PGYo4KAiGTdO6HdHwA0EcOyl1FdJWZzhTZUVfFuyT17S neLTCOuYKZaZp0Jm9kO5KIUF6hjs5o/zJYNNOoAubOsJIQswLsW9TTwqJQq+awStiSC5 YPu91F1yu7UD6kIw3tqN5ODkkbJyUWyUTKlsl8U956lJHbB0QnPJ2UujkLgD/0heq6lK cuAw== X-Gm-Message-State: AOAM530ZjUeiCZgK+I5WHVwkuvRvmoxzfiRc7XeJKwCmxBcWUNA+3VHZ WIyVoo12X0eUuunamjxouCE= X-Received: by 2002:a17:90a:f2cc:: with SMTP id gt12mr5723370pjb.136.1617735941762; Tue, 06 Apr 2021 12:05:41 -0700 (PDT) Received: from localhost ([47.9.169.206]) by smtp.gmail.com with ESMTPSA id l10sm18453586pfc.125.2021.04.06.12.05.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Apr 2021 12:05:41 -0700 (PDT) Date: Wed, 7 Apr 2021 00:35:38 +0530 From: Kumar Kartikeya Dwivedi To: Andrii Nakryiko Cc: Daniel Borkmann , bpf , Jesper Dangaard Brouer , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , Alexei Starovoitov , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Shuah Khan , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , Peter Zijlstra , open list , Networking , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH bpf-next 3/5] libbpf: add low level TC-BPF API Message-ID: <20210406190538.fdqo7g2tzolgckpy@apollo> References: <20210325120020.236504-1-memxor@gmail.com> <20210325120020.236504-4-memxor@gmail.com> <20210328080648.oorx2no2j6zslejk@apollo> <48b99ccc-8ef6-4ba9-00f9-d7e71ae4fb5d@iogearbox.net> <20210331094400.ldznoctli6fljz64@apollo> <5d59b5ee-a21e-1860-e2e5-d03f89306fd8@iogearbox.net> <20210402152743.dbadpgcmrgjt4eca@apollo> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 05, 2021 at 10:51:09PM IST, Andrii Nakryiko wrote: > > [...] > > if _block variant is just a special ifindex value, then it should be > fine for users to know such a detail (we can leave a comment > mentioning this specifically), especially given it's not a very > popular thing. Almost doubling amount of APIs just for this doesn't > make much sense, IMO. > Ok. > > If we know that we need variant with options, I'd vote for having just > one bpf_tc_attach() API which always takes options. Passing NULL for > opts is simple, no need for two APIs, I think. > Ack. > > Which parts of that id struct is the data that caller might not know > or can't know? Is it handle and chain_index? Or just one of them? > Or?... If there is something that has to be returned back, I'd keep > only that, instead of returning 6+ fields, most of which user should > already know. > The user will know ifindex and parent_id, and perhaps protocol (it would be ETH_P_ALL if they don't supply one by default). Other fields like handle, priority and chain_index can all be kernel assigned, so keeping those still makes sense. I'll change this in v2. -- Kartikeya