On Sat, 4 May 2019 15:16:54 +0200, Jiri Pirko wrote: > Sat, May 04, 2019 at 01:46:25PM CEST, jakub.kicin...@netronome.com wrote: > >From: Pieter Jansen van Vuuren <pieter.jansenvanvuu...@netronome.com> > > > >Some actions like the police action are stateful and could share state > >between devices. This is incompatible with offloading to multiple devices > >and drivers might want to test for shared blocks when offloading. > >Store a pointer to the tcf_block structure in the tc_cls_common_offload > >structure to allow drivers to determine when offloads apply to a shared > >block. > > I don't this this is good idea. If your driver supports shared blocks, > you should register the callback accordingly. See: > mlxsw_sp_setup_tc_block_flower_bind() where tcf_block_cb_lookup() and > __tcf_block_cb_register() are used to achieve that.
Right, in some ways. Unfortunately we don't support shared blocks fully, i.e. we register multiple callbacks and get the rules replicated. It's a FW limitation, but I don't think we have shared blocks on the roadmap, since rule storage is not an issue for our HW. But even if we did support sharing blocks, we'd have to teach TC that some rules can only be offloaded if there is only a single callback registered, right? In case the block is shared between different ASICs.