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=-0.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 4B52AC433E0 for ; Wed, 3 Jun 2020 07:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2687720679 for ; Wed, 3 Jun 2020 07:05:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jLxh9QU8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725855AbgFCHFs (ORCPT ); Wed, 3 Jun 2020 03:05:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725275AbgFCHFr (ORCPT ); Wed, 3 Jun 2020 03:05:47 -0400 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 457B9C05BD43 for ; Wed, 3 Jun 2020 00:05:46 -0700 (PDT) Received: by mail-io1-xd42.google.com with SMTP id s18so1108440ioe.2 for ; Wed, 03 Jun 2020 00:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yzQjFogPAYNv8AHviWr8AcjUPuA1WozjAYYWyYrp1Wc=; b=jLxh9QU8Vg6dgoDIL7o0fcgQ5K8N/ssijFij6Lw1Su0p/qJIAIO1BZkCMX65xqFcBm 4LtHJ5Y3EiAoDv+5mmDsgvvjx38h1QgJxQvdwprllXS+vA46b5zzbkeyX4ry/VYiVh2I rXTDAN5dUvPabGQpLpQCyLh1FrwFWmscJC5mZkvBg+BSombwijjwtJ4ocVqs2YTWoLkp zo/rv64nz68E/NTV0S1F/P+FBRiZ1IWNGA701QNiS9qYVTJiBd6wd7mQKDTdyAiPEd6A zqX5lkV/V1/fC4QTUCrWUD5FYd2crb2shpnFWSWKQtGRV7N9X9vhWOW6phqG4jWwRbRO iGGw== 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=yzQjFogPAYNv8AHviWr8AcjUPuA1WozjAYYWyYrp1Wc=; b=mkb49n6TvA7wmxjx4gvGu96uDzK2jC/eD7wX7qLxdwu1llXp2ktBnNXnI8BgR6mFl0 zF+orbJvjpe2g5GqaLXcmBToKe+kUC2gkRPNVs1TNOh3gTUFbLSkbJ8qJf5vCaA/5YD8 0VKaWzgBvnKwqUpyTBZy0cZzOq3oblWyrDAWN80SOhMcRDEU9r5bj41tb/Ti4wnojFAM WBhvq1zSs1t3BeXYk+ERDKdZKijxB4Y+gSXfQ+kPh6hQAhI/HB+GQQig/RZY3o84drzw /jAJI4KWYCftMwyrzqVGL9/wZqfqofS/A+M3U8mE83dKiKfPK0tEeXXLLG4rFuXrlq3d JRrA== X-Gm-Message-State: AOAM532kPrXAIJmKdznY28fju6SCRBWTLnW1XaKuSEtIryaCXi3smD/8 DHv1Z6Gf8D/i+CDw3djJXuBFodyXpNBdwyZLZmY= X-Google-Smtp-Source: ABdhPJwXKmwe+fGQtY3ok2V3CvY4ejr7ObLD07BzEGhEqPT12MpqjjKwf244CtcgLwYinidJfVeJM9itRLps0AWA+Uw= X-Received: by 2002:a05:6602:2f0a:: with SMTP id q10mr2426742iow.134.1591167944751; Wed, 03 Jun 2020 00:05:44 -0700 (PDT) MIME-Version: 1.0 References: <20200601134023.GQ2282@nanopsycho> <20200602060555.GR2282@nanopsycho> In-Reply-To: <20200602060555.GR2282@nanopsycho> From: Cong Wang Date: Wed, 3 Jun 2020 00:05:33 -0700 Message-ID: Subject: Re: [RFC PATCH net-next 0/3] TC: Introduce qevents To: Jiri Pirko Cc: Petr Machata , Linux Kernel Network Developers , Jakub Kicinski , Eric Dumazet , Jamal Hadi Salim , Jiri Pirko , Ido Schimmel Content-Type: text/plain; charset="UTF-8" Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, Jun 1, 2020 at 11:05 PM Jiri Pirko wrote: > > Mon, Jun 01, 2020 at 09:50:23PM CEST, xiyou.wangcong@gmail.com wrote: > >On Mon, Jun 1, 2020 at 6:40 AM Jiri Pirko wrote: > >> The first command just says "early drop position should be processed by > >> block 10" > >> > >> The second command just adds a filter to the block 10. > > > >This is exactly why it looks odd to me, because it _reads_ like > >'tc qdisc' creates the block to hold tc filters... I think tc filters should > >create whatever placeholder for themselves. > > That is how it is done already today. We have the block object. The > instances are created separatelly (clsact for example), user may specify > the block id to identify the block. Then the user may use this block id > to add/remove filters directly to/from the block. > > What you propose with "position" on the other hand look unnatural for > me. It would slice the exising blocks in some way. Currently, the block > has 1 clearly defined entrypoint. With "positions", all of the sudden > there would be many of them? I can't really imagine how that is supposed > to work :/ I imagine we could introduce multiple blocks for a qdisc. Currently we have: struct some_qdisc_data { struct tcf_block *block; }; Maybe we can extend it to: struct some_qdisc_data { struct tcf_block *blocks[3]; }; #define ENQUEUE 0 #define DEQUEUE 1 #define DROP 2 static struct tcf_block *foo_tcf_block(struct Qdisc *sch, unsigned long cl, struct netlink_ext_ack *extack, int position) { struct some_qdisc_data *q = qdisc_priv(sch); if (cl) return NULL; return q->block[position]; } Just some scratches on my mind. Thanks.