From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
mlxsw@mellanox.com, andrew@lunn.ch,
vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com,
michael.chan@broadcom.com, ganeshgr@chelsio.com,
saeedm@mellanox.com, matanb@mellanox.com, leonro@mellanox.com,
idosch@mellanox.com, jakub.kicinski@netronome.com,
simon.horman@netronome.com, pieter.jansenvanvuuren@netronome.com,
john.hurley@netronome.com, alexander.h.duyck@intel.com,
ogerlitz@mellanox.com, john.fastabend@gmail.com,
daniel@iogearbox.net, dsahern@gmail.com
Subject: Re: [patch net-next v6 06/11] net: sched: use block index as a handle instead of qdisc when block is shared
Date: Sat, 6 Jan 2018 21:43:12 +0100 [thread overview]
Message-ID: <20180106204312.GF2099@nanopsycho> (raw)
In-Reply-To: <20180105230929.5645-7-jiri@resnulli.us>
Sat, Jan 06, 2018 at 12:09:24AM CET, jiri@resnulli.us wrote:
>From: Jiri Pirko <jiri@mellanox.com>
>
>As the tcm_ifindex 0 is invalid ifindex, reuse it to indicate that we
>work with block, instead of qdisc. So if tcm_ifindex is 0, tcm_parent is
>used to carry block_index.
>
>If the block is set to be shared between at least 2 qdiscs, it is
>forbidden to use the qdisc handle to add/delete filters. In that case,
>userspace has to pass block_index.
>
>Also, for dump of the filters, in case the block is shared in between at
>least 2 qdiscs, the each filter is dumped with tcm_ifindex 0 and
>tcm_parent set to block_index. That gives the user clear indication,
>that the filter belongs to a shared block and not only to one qdisc
>under which it is dumped.
>
>Suggested-by: David Ahern <dsahern@gmail.com>
>Signed-off-by: Jiri Pirko <jiri@mellanox.com>
>---
[...]
>@@ -886,8 +887,13 @@ static int tcf_fill_node(struct net *net, struct sk_buff *skb,
> tcm->tcm_family = AF_UNSPEC;
> tcm->tcm__pad1 = 0;
> tcm->tcm__pad2 = 0;
>- tcm->tcm_ifindex = qdisc_dev(q)->ifindex;
>- tcm->tcm_parent = parent;
>+ if (q) {
>+ tcm->tcm_ifindex = qdisc_dev(q)->ifindex;
>+ tcm->tcm_parent = parent;
>+ } else {
>+ tcm->tcm_ifindex = 0; /* block index is stored in parent */
>+ tcm->tcm_parent = block->index;
>+ }
Please guys, please look at this reuse (also on clt side). I would like
you to double-check this reuse of existing API for balock_index carrying
purpose. I believe it's UAPI safe. But please, check it out carefully.
next prev parent reply other threads:[~2018-01-06 20:43 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-05 23:09 [patch net-next v6 00/11] net: sched: allow qdiscs to share filter block instances Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 01/11] net: sched: introduce support for multiple filter chain pointers registration Jiri Pirko
2018-01-06 17:11 ` Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 02/11] net: sched: avoid usage of tp->q in tcf_classify Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 03/11] net: sched: introduce block mechanism to handle netif_keep_dst calls Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 04/11] net: sched: remove classid and q fields from tcf_proto Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 05/11] net: sched: keep track of offloaded filters and check tc offload feature Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 06/11] net: sched: use block index as a handle instead of qdisc when block is shared Jiri Pirko
2018-01-06 20:43 ` Jiri Pirko [this message]
2018-01-07 13:11 ` Jamal Hadi Salim
2018-01-07 13:46 ` Jiri Pirko
2018-01-07 14:28 ` Jamal Hadi Salim
2018-01-07 14:51 ` Jamal Hadi Salim
2018-01-05 23:09 ` [patch net-next v6 07/11] net: sched: allow ingress and clsact qdiscs to share filter blocks Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 08/11] mlxsw: spectrum_acl: Reshuffle code around mlxsw_sp_acl_ruleset_create/destroy Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 09/11] mlxsw: spectrum_acl: Don't store netdev and ingress for ruleset unbind Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 10/11] mlxsw: spectrum_acl: Implement TC block sharing Jiri Pirko
2018-01-05 23:09 ` [patch net-next v6 11/11] mlxsw: spectrum_acl: Pass mlxsw_sp_port down to ruleset bind/unbind ops Jiri Pirko
2018-01-05 23:12 ` [iproute2 net-next 1/2] tc: implement filter block sharing to ingress and clsact qdiscs Jiri Pirko
2018-01-05 23:12 ` [iproute2 net-next 2/2] tc: introduce support for block-handle for filter operations Jiri Pirko
2018-01-06 3:57 ` [patch net-next v6 00/11] net: sched: allow qdiscs to share filter block instances David Ahern
2018-01-06 8:07 ` Jiri Pirko
2018-01-06 9:48 ` Jiri Pirko
2018-01-06 18:02 ` Jamal Hadi Salim
2018-01-06 18:31 ` Jamal Hadi Salim
2018-01-06 19:29 ` David Ahern
2018-01-06 17:41 ` David Ahern
2018-01-06 18:16 ` Jamal Hadi Salim
2018-01-06 20:38 ` Jiri Pirko
2018-01-06 20:37 ` Jiri Pirko
2018-01-08 15:23 ` Marcelo Ricardo Leitner
2018-01-08 15:42 ` Jiri Pirko
2018-01-08 17:20 ` Marcelo Ricardo Leitner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180106204312.GF2099@nanopsycho \
--to=jiri@resnulli.us \
--cc=alexander.h.duyck@intel.com \
--cc=andrew@lunn.ch \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=ganeshgr@chelsio.com \
--cc=idosch@mellanox.com \
--cc=jakub.kicinski@netronome.com \
--cc=jhs@mojatatu.com \
--cc=john.fastabend@gmail.com \
--cc=john.hurley@netronome.com \
--cc=leonro@mellanox.com \
--cc=matanb@mellanox.com \
--cc=michael.chan@broadcom.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=pieter.jansenvanvuuren@netronome.com \
--cc=saeedm@mellanox.com \
--cc=simon.horman@netronome.com \
--cc=vivien.didelot@savoirfairelinux.com \
--cc=xiyou.wangcong@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.