netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@mellanox.com>
To: Jakub Kicinski <jakub.kicinski@netronome.com>
Cc: Vlad Buslov <vladbu@mellanox.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"jhs@mojatatu.com" <jhs@mojatatu.com>,
	"xiyou.wangcong@gmail.com" <xiyou.wangcong@gmail.com>,
	"jiri@resnulli.us" <jiri@resnulli.us>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"pablo@netfilter.org" <pablo@netfilter.org>
Subject: Re: [PATCH net-next v2 03/10] net: sched: refactor block offloads counter usage
Date: Sat, 24 Aug 2019 14:44:11 +0000	[thread overview]
Message-ID: <vbflfvi8vyg.fsf@mellanox.com> (raw)
In-Reply-To: <20190823172648.7777e2b6@cakuba.netronome.com>


On Sat 24 Aug 2019 at 03:26, Jakub Kicinski <jakub.kicinski@netronome.com> wrote:
> On Fri, 23 Aug 2019 21:50:49 +0300, Vlad Buslov wrote:
>> @@ -1201,14 +1199,11 @@ static int u32_reoffload_knode(struct tcf_proto *tp, struct tc_u_knode *n,
>>  			cls_u32.knode.link_handle = ht->handle;
>>  	}
>>
>> -	err = cb(TC_SETUP_CLSU32, &cls_u32, cb_priv);
>> -	if (err) {
>> -		if (add && tc_skip_sw(n->flags))
>> -			return err;
>> -		return 0;
>> -	}
>> -
>> -	tc_cls_offload_cnt_update(block, &n->in_hw_count, &n->flags, add);
>> +	err = tc_setup_cb_reoffload(block, tp, add, cb, TC_SETUP_CLSU32,
>> +				    &cls_u32, cb_priv, &n->flags,
>> +				    &n->in_hw_count);
>> +	if (err && add && tc_skip_sw(n->flags))
>> +		return err;
>
> Could this be further simplified by adding something along the lines of:
>
> 	if (!add || !tc_skip_sw(*flags))
> 		err = 0;
>
> to tc_setup_cb_reoffload() ?

Indeed, all the users of tc_setup_cb_reoffload() have same error check
that can be moved into the function. I will refactor it in V3.

>
>>
>>  	return 0;
>>  }

  reply	other threads:[~2019-08-24 14:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 18:50 [PATCH net-next v2 00/10] Refactor cls hardware offload API to support rtnl-independent drivers Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 01/10] net: sched: protect block offload-related fields with rw_semaphore Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 02/10] net: sched: change tcf block offload counter type to atomic_t Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 03/10] net: sched: refactor block offloads counter usage Vlad Buslov
2019-08-24  0:26   ` Jakub Kicinski
2019-08-24 14:44     ` Vlad Buslov [this message]
2019-08-23 18:50 ` [PATCH net-next v2 04/10] net: sched: notify classifier on successful offload add/delete Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 05/10] net: sched: add API for registering unlocked offload block callbacks Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 06/10] net: sched: conditionally obtain rtnl lock in cls hw offloads API Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 07/10] net: sched: take rtnl lock in tc_setup_flow_action() Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 08/10] net: sched: take reference to action dev before calling offloads Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 09/10] net: sched: copy tunnel info when setting flow_action entry->tunnel Vlad Buslov
2019-08-23 18:50 ` [PATCH net-next v2 10/10] net: sched: flower: don't take rtnl lock for cls hw offloads API Vlad Buslov

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=vbflfvi8vyg.fsf@mellanox.com \
    --to=vladbu@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=jakub.kicinski@netronome.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).