netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jamal Hadi Salim <jhs@mojatatu.com>
To: Cong Wang <xiyou.wangcong@gmail.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Subject: Re: [Patch net-next] net_sched: act: use tcf_hash_release() in net/sched/act_police.c
Date: Thu, 16 Jan 2014 08:25:57 -0500	[thread overview]
Message-ID: <52D7DDE5.4000305@mojatatu.com> (raw)
In-Reply-To: <1389828206-9467-1-git-send-email-xiyou.wangcong@gmail.com>

On 01/15/14 18:23, Cong Wang wrote:
> Cc: Jamal Hadi Salim <jhs@mojatatu.com>
> Cc: David S. Miller <davem@davemloft.net>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>

Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>

cheers,
jamal

> ---
>   net/sched/act_police.c | 30 +++---------------------------
>   1 file changed, 3 insertions(+), 27 deletions(-)
>
> diff --git a/net/sched/act_police.c b/net/sched/act_police.c
> index a719fdf..5ba467b 100644
> --- a/net/sched/act_police.c
> +++ b/net/sched/act_police.c
> @@ -104,20 +104,6 @@ nla_put_failure:
>   	goto done;
>   }
>
> -static void tcf_police_destroy(struct tcf_police *p)
> -{
> -	spin_lock_bh(&police_hash_info.lock);
> -	hlist_del(&p->tcf_head);
> -	spin_unlock_bh(&police_hash_info.lock);
> -	gen_kill_estimator(&p->tcf_bstats,
> -			   &p->tcf_rate_est);
> -	/*
> -	 * gen_estimator est_timer() might access p->tcf_lock
> -	 * or bstats, wait a RCU grace period before freeing p
> -	 */
> -	kfree_rcu(p, tcf_rcu);
> -}
> -
>   static const struct nla_policy police_policy[TCA_POLICE_MAX + 1] = {
>   	[TCA_POLICE_RATE]	= { .len = TC_RTAB_SIZE },
>   	[TCA_POLICE_PEAKRATE]	= { .len = TC_RTAB_SIZE },
> @@ -272,19 +258,9 @@ failure:
>   static int tcf_act_police_cleanup(struct tc_action *a, int bind)
>   {
>   	struct tcf_police *p = a->priv;
> -	int ret = 0;
> -
> -	if (p != NULL) {
> -		if (bind)
> -			p->tcf_bindcnt--;
> -
> -		p->tcf_refcnt--;
> -		if (p->tcf_refcnt <= 0 && !p->tcf_bindcnt) {
> -			tcf_police_destroy(p);
> -			ret = 1;
> -		}
> -	}
> -	return ret;
> +	if (p)
> +		return tcf_hash_release(&p->common, bind, &police_hash_info);
> +	return 0;
>   }
>
>   static int tcf_act_police(struct sk_buff *skb, const struct tc_action *a,
>

  reply	other threads:[~2014-01-16 13:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-15 23:23 [Patch net-next] net_sched: act: use tcf_hash_release() in net/sched/act_police.c Cong Wang
2014-01-16 13:25 ` Jamal Hadi Salim [this message]
2014-01-17  1:22 ` David Miller

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=52D7DDE5.4000305@mojatatu.com \
    --to=jhs@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.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).