]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - net/sched/act_ife.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[karo-tx-linux.git] / net / sched / act_ife.c
index ea4a2fef1b71c506a89ca668c115db367aaa79a6..845ab5119c05a19947a05f13b888b3a31c18ccbd 100644 (file)
@@ -428,7 +428,8 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
        u16 ife_type = 0;
        u8 *daddr = NULL;
        u8 *saddr = NULL;
-       int ret = 0, exists = 0;
+       bool exists = false;
+       int ret = 0;
        int err;
 
        err = nla_parse_nested(tb, TCA_IFE_MAX, nla, ife_policy);
@@ -562,9 +563,7 @@ static int tcf_ife_dump(struct sk_buff *skb, struct tc_action *a, int bind,
        if (nla_put(skb, TCA_IFE_PARMS, sizeof(opt), &opt))
                goto nla_put_failure;
 
-       t.install = jiffies_to_clock_t(jiffies - ife->tcf_tm.install);
-       t.lastuse = jiffies_to_clock_t(jiffies - ife->tcf_tm.lastuse);
-       t.expires = jiffies_to_clock_t(ife->tcf_tm.expires);
+       tcf_tm_dump(&t, &ife->tcf_tm);
        if (nla_put_64bit(skb, TCA_IFE_TM, sizeof(t), &t, TCA_IFE_PAD))
                goto nla_put_failure;
 
@@ -632,7 +631,7 @@ static int tcf_ife_decode(struct sk_buff *skb, const struct tc_action *a,
 
        spin_lock(&ife->tcf_lock);
        bstats_update(&ife->tcf_bstats, skb);
-       ife->tcf_tm.lastuse = jiffies;
+       tcf_lastuse_update(&ife->tcf_tm);
        spin_unlock(&ife->tcf_lock);
 
        ifehdrln = ntohs(ifehdrln);
@@ -720,7 +719,7 @@ static int tcf_ife_encode(struct sk_buff *skb, const struct tc_action *a,
 
        spin_lock(&ife->tcf_lock);
        bstats_update(&ife->tcf_bstats, skb);
-       ife->tcf_tm.lastuse = jiffies;
+       tcf_lastuse_update(&ife->tcf_tm);
 
        if (!metalen) {         /* no metadata to send */
                /* abuse overlimits to count when we allow packet
@@ -811,7 +810,7 @@ static int tcf_ife_act(struct sk_buff *skb, const struct tc_action *a,
        pr_info_ratelimited("unknown failure(policy neither de/encode\n");
        spin_lock(&ife->tcf_lock);
        bstats_update(&ife->tcf_bstats, skb);
-       ife->tcf_tm.lastuse = jiffies;
+       tcf_lastuse_update(&ife->tcf_tm);
        ife->tcf_qstats.drops++;
        spin_unlock(&ife->tcf_lock);