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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52111C433F5 for ; Wed, 5 Oct 2022 14:32:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbiJEOca (ORCPT ); Wed, 5 Oct 2022 10:32:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229723AbiJEOc3 (ORCPT ); Wed, 5 Oct 2022 10:32:29 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DCC172870 for ; Wed, 5 Oct 2022 07:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664980347; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tObMQCdQ5lmhGEfWf1G2BnwejS8NcVQfKMZ4dQuOMzs=; b=Vxw4P2IuHE5f2hkwhPxYjdtVosMxHq3OeUWlpxhRb55uc1DCMMfVU8VCXDMBjeyGI+wtKk V10UBAKmuz8k9GjzWIBUd5IGQ8iNUlZ48BbizRPdEuDwdmJah+9503SBg9pKHD7Ip+xGi3 axlPYTT/Lclovj31JWQ87WbUeXf82sA= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-170-WVvcl_U-NxmOuC0PL_bT4w-1; Wed, 05 Oct 2022 10:32:26 -0400 X-MC-Unique: WVvcl_U-NxmOuC0PL_bT4w-1 Received: by mail-ed1-f69.google.com with SMTP id y9-20020a056402270900b00451dfbbc9b2so13598721edd.12 for ; Wed, 05 Oct 2022 07:32:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=tObMQCdQ5lmhGEfWf1G2BnwejS8NcVQfKMZ4dQuOMzs=; b=3BoYrL6mfR3iMVtOahdoEBicpAo52ZxRxVBYyVZxnGX8QICtUhVI6LVRHodPz415SD og6olIfz6W8hcJ+8uBObaiZuVCwd4dAtesrEKkbhlYkZ7UyQ9cMyXWVHNbFaVnepRhWx g7ycUmB2LpYyhcpz6eMfel7b8EIVJWu7cnLSA7UyhmChRtZI301jthcpJkfYwCrvdb0R PG4atKslqp1mTwxcElFgg3vVgcv7JKniWIsOYFddfTXjCl7GRQIgdKUWKiR/7Jok+OgP XzefG5ERXdH58iw3G+z1h+hamN4C1ZkofIkIoNTMDMnERKWlK9mfwmp+sdCQT6NPoJnK Xcrw== X-Gm-Message-State: ACrzQf01GfWyj5dX/HPvlLgSBE0Akd0uf9Xs9MGMl6nBr1lRwrBy8VFM 3P+qdJ3bandUAUT2DnJ0lxIB6mZO2pc4vjTTcbsCUcvhyrqR7sFSM0JDeoX202KASr+GWZajE9w KSzquk38wAk7V X-Received: by 2002:aa7:cfc4:0:b0:459:7fa7:ee29 with SMTP id r4-20020aa7cfc4000000b004597fa7ee29mr43163edy.414.1664980344949; Wed, 05 Oct 2022 07:32:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM42hwJh/HghS6gIi4751Sbigc/2qbv0QE2vCVQMGtKvzUxOB4o2QM8m4GamdJlVRWdwnPFMng== X-Received: by 2002:aa7:cfc4:0:b0:459:7fa7:ee29 with SMTP id r4-20020aa7cfc4000000b004597fa7ee29mr43132edy.414.1664980344506; Wed, 05 Oct 2022 07:32:24 -0700 (PDT) Received: from alrua-x1.borgediget.toke.dk ([45.145.92.2]) by smtp.gmail.com with ESMTPSA id k11-20020a17090632cb00b007030c97ae62sm8767269ejk.191.2022.10.05.07.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 07:32:23 -0700 (PDT) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id E996264EBBE; Wed, 5 Oct 2022 16:32:22 +0200 (CEST) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Daniel Borkmann , bpf@vger.kernel.org Cc: razor@blackwall.org, ast@kernel.org, andrii@kernel.org, martin.lau@linux.dev, john.fastabend@gmail.com, joannelkoong@gmail.com, memxor@gmail.com, joe@cilium.io, netdev@vger.kernel.org Subject: Re: [PATCH bpf-next 01/10] bpf: Add initial fd-based API to attach tc BPF programs In-Reply-To: <3cc8a0c3-7767-12cf-f753-82e2df8ef293@iogearbox.net> References: <20221004231143.19190-1-daniel@iogearbox.net> <20221004231143.19190-2-daniel@iogearbox.net> <87bkqqimpy.fsf@toke.dk> <3cc8a0c3-7767-12cf-f753-82e2df8ef293@iogearbox.net> X-Clacks-Overhead: GNU Terry Pratchett Date: Wed, 05 Oct 2022 16:32:22 +0200 Message-ID: <87wn9egx3d.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org Daniel Borkmann writes: > On 10/5/22 12:33 PM, Toke H=C3=B8iland-J=C3=B8rgensen wrote: >> Daniel Borkmann writes: >>=20 >>> As part of the feedback from LPC, there was a suggestion to provide a >>> name for this infrastructure to more easily differ between the classic >>> cls_bpf attachment and the fd-based API. As for most, the XDP vs tc >>> layer is already the default mental model for the pkt processing >>> pipeline. We refactored this with an xtc internal prefix aka 'express >>> traffic control' in order to avoid to deviate too far (and 'express' >>> given its more lightweight/faster entry point). >>=20 >> Woohoo, bikeshed time! :) >>=20 >> I am OK with having a separate name for this, but can we please pick one >> that doesn't sound like 'XDP' when you say it out loud? You really don't >> have to mumble much for 'XDP' and 'XTC' to sound exactly alike; this is >> bound to lead to confusion! >>=20 >> Alternatives, in the same vein: >> - ltc (lightweight) >> - etc (extended/express/ebpf/et cetera ;)) >> - tcx (keep the cool X, but put it at the end) > > Hehe, yeah agree, I don't have a strong opinion, but tcx (or just sticking > with tc) is fully okay to me. Either is fine with me; I don't have any strong opinions either, other than "not XTC" ;) >> [...] >>=20 >>> +/* (Simplified) user return codes for tc prog type. >>> + * A valid tc program must return one of these defined values. All oth= er >>> + * return codes are reserved for future use. Must remain compatible wi= th >>> + * their TC_ACT_* counter-parts. For compatibility in behavior, unknown >>> + * return codes are mapped to TC_NEXT. >>> + */ >>> +enum tc_action_base { >>> + TC_NEXT =3D -1, >>> + TC_PASS =3D 0, >>> + TC_DROP =3D 2, >>> + TC_REDIRECT =3D 7, >>> +}; >>=20 >> Looking at things like this, though, I wonder if having a separate name >> (at least if it's too prominent) is not just going to be more confusing >> than not? I.e., we go out of our way to make it compatible with existing >> TC-BPF programs (which is a good thing!), so do we really need a >> separate name? Couldn't it just be an implementation detail that "it's >> faster now"? > > Yep, faster is an implementation detail; and developers can stick to exis= ting > opcodes. I added this here given Andrii suggested to add the action codes= as > enum so they land in vmlinux BTF. My thinking was that if we go this rout= e, > we could also make them more user friendly. This part is 100% optional, > but for new developers it might lower the barrier a bit I was hoping given > it makes it clear which subset of actions BPF supports explicitly and with > less cryptic name. Oh, I didn't mean that we shouldn't define these helpers; that's totally fine, and probably useful. Just that when everything is named 'TC' anyway, having a different name (like TCX) is maybe not that important anyway? >> Oh, and speaking of compatibility should 'tc' (the iproute2 binary) be >> taught how to display these new bpf_link attachments so that users can >> see that they're there? > > Sounds reasonable, I can follow-up with the iproute2 support as well. Cool! -Toke