From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Pirko Subject: Re: [PATCH net-next v2 3/7] net: sched: cls_flower: implement offload tcf_proto_op Date: Mon, 25 Jun 2018 23:36:20 +0200 Message-ID: <20180625213620.GM2161@nanopsycho> References: <20180625213010.13266-1-jakub.kicinski@netronome.com> <20180625213010.13266-4-jakub.kicinski@netronome.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: davem@davemloft.net, xiyou.wangcong@gmail.com, jhs@mojatatu.com, gerlitz.or@gmail.com, netdev@vger.kernel.org, oss-drivers@netronome.com, John Hurley To: Jakub Kicinski Return-path: Received: from mail-wr0-f194.google.com ([209.85.128.194]:39774 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752219AbeFYVhl (ORCPT ); Mon, 25 Jun 2018 17:37:41 -0400 Received: by mail-wr0-f194.google.com with SMTP id b8-v6so9664264wro.6 for ; Mon, 25 Jun 2018 14:37:40 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180625213010.13266-4-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: Mon, Jun 25, 2018 at 11:30:06PM CEST, jakub.kicinski@netronome.com wrote: >From: John Hurley > >Add the reoffload tcf_proto_op in flower to generate an offload message >for each filter in the given tcf_proto. Call the specified callback with >this new offload message. The function only returns an error if the >callback rejects adding a 'hardware only' rule. > >A filter contains a flag to indicate if it is in hardware or not. To >ensure the reoffload function properly maintains this flag, keep a >reference counter for the number of instances of the filter that are in >hardware. Only update the flag when this counter changes from or to 0. Add >a generic helper function to implement this behaviour. > >Signed-off-by: John Hurley >Signed-off-by: Jakub Kicinski Acked-by: Jiri Pirko