[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53CD02CD.7050300@open-mesh.com>
Date: Mon, 21 Jul 2014 14:08:45 +0200
From: Antonio Quartulli <antonio@...n-mesh.com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
davem@...emloft.net
CC: netdev@...r.kernel.org, Jamal Hadi Salim <jhs@...atatu.com>
Subject: Re: [PATCH] skbedit: allow the user to specify bitmask for mark
On 21/07/14 14:04, Sergei Shtylyov wrote:
>> diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c
>> index fcfeeaf..5fca32b 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 = skb->mark & ~d->mask;
>
> Why not 'skb->mark &= ~d->mask;'?
No real reason :) Shall we always use the compressed version of this
operator when possible ?
--
Antonio Quartulli
Download attachment "signature.asc" of type "application/pgp-signature" (885 bytes)
Powered by blists - more mailing lists