[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHA+R7MvxaWpybUJFZd4W0kEJE4nOMD_ApmSb0KgBkNugbttQA@mail.gmail.com>
Date: Wed, 23 Jul 2014 10:16:56 -0700
From: Cong Wang <cwang@...pensource.com>
To: Antonio Quartulli <antonio@...hcoding.com>
Cc: David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>,
sergei.shtylyov@...entembedded.com,
Eric Dumazet <eric.dumazet@...il.com>,
Antonio Quartulli <antonio@...n-mesh.com>,
Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [PATCHv2] skbedit: allow the user to specify bitmask for mark
On Wed, Jul 23, 2014 at 1:03 AM, Antonio Quartulli
<antonio@...hcoding.com> wrote:
> #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1)
> diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
> index fcfeeaf..6111b06 100644
> --- a/net/sched/act_skbedit.c
> +++ b/net/sched/act_skbedit.c
> @@ -43,8 +43,12 @@ static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a,
> if (d->flags & SKBEDIT_F_QUEUE_MAPPING &&
> skb->dev->real_num_tx_queues > d->queue_mapping)
> skb_set_queue_mapping(skb, d->queue_mapping);
> - if (d->flags & SKBEDIT_F_MARK)
> - skb->mark = d->mark;
> + if (d->flags & SKBEDIT_F_MARK) {
> + /* unset all the bits in the mask */
> + skb->mark &= ~d->mask;
> + /* assign the mark value for the masked bit only */
> + skb->mark |= d->mark & d->mask;
The comments are useless, code is already clear.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists