Subject: Re: [PATCH net-next V3 4/4] net/sched: Introduce act_tunnel_key

From: Shmulik Ladkani <[email-masked]>
Date: Thu, 25 Aug 2016 19:52:56 +0300

Hi,

On Thu, 25 Aug 2016 19:13:47 +0300 Hadar Hen Zion <[email-masked]> wrote:
> +static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a,
> +			  struct tcf_result *res)
> +{
> +	struct tcf_tunnel_key *t = to_tunnel_key(a);
> +	int action;
> +
> +	spin_lock(&t->tcf_lock);
> +	tcf_lastuse_update(&t->tcf_tm);
> +	bstats_update(&t->tcf_bstats, skb);
> +	action = t->tcf_action;
> +
> +	switch (t->tcft_action) {
> +	case TCA_TUNNEL_KEY_ACT_RELEASE:
> +		skb_dst_set_noref(skb, NULL);
> +		break;
> +	case TCA_TUNNEL_KEY_ACT_SET:
> +		skb_dst_set_noref(skb, &t->tcft_enc_metadata->dst);
> +		break;

Two additional questions:
 - No need to perform a 'skb_dst_drop(skb)' prior the dst set calls?
 - Why there's no need to take a reference on tcft_enc_metadata->dst?

Besides that,

Reviewed-by: Shmulik Ladkani <[email-masked]>

Thanks!