Subject: Re: [patch net-next v2 0/9] net: sched: introduce chain templates support with offloading to mlxsw

From: Jiri Pirko <[email-masked]>
Date: Sat, 30 Jun 2018 12:12:18 +0200

Sat, Jun 30, 2018 at 12:18:02AM CEST, [email-masked] wrote:
>On Fri, Jun 29, 2018 at 10:06 AM Samudrala, Sridhar
><[email-masked]> wrote:
>>
>> So instead of introducing 'chaintemplate' object in the kernel, can't we add 'chain'
>> object in the kernel that takes the 'template' as an attribute?
>
>This is exactly what I mean above. Making the chain a standalone object
>in kernel would benefit:
>
>1. Align with 'tc chain' in iproute2, add/del an object is natural
>
>2. Template is an attribute of this object when creating it:
># tc chain add template ....
># tc chain add ... # non-template chain

Okay. So that would allow either create a chain or "chain with
template". Once that is done, there would be no means to manipulate the
template. One can only remove the chain.

What about refounting? I think it would make sense that this implicit
chain addition would take one reference. That means if later on the last
filter is removed, the chain would stay there until user removes it by
hand.

Okay. Sounds good to me. Will do.

Thanks!

>
>3. Easier for sharing by qdiscs:
># tc chain add X block Y ...
># tc filter add ... chain X block Y ...
># tc qdisc add dev eth0 block Y ...
>
>The current 'ingress_block 22 ingress' syntax is ugly.