[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110703192326.GU16021@Chamillionaire.breakpoint.cc>
Date: Sun, 3 Jul 2011 21:23:26 +0200
From: Florian Westphal <fw@...len.de>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: Florian Westphal <fw@...len.de>, Patrick McHardy <kaber@...sh.net>,
netfilter-devel@...r.kernel.org,
Pablo Neira Ayuso <pablo@...filter.org>,
netdev <netdev@...r.kernel.org>, Eric Leblond <eric@...it.org>
Subject: Re: [PATCH next] netfilter: nfqueue: batch verdict support
Eric Dumazet <eric.dumazet@...il.com> wrote:
> > Introduces a new nfnetlink type that applies a given
> > verdict to all queued packets with an id <= the id in the verdict
> > message.
> >
> > If a mark is provided it is applied to all matched packets.
> >
> > This reduces the number of verdicts that have to be sent.
> > Applications that make use of this feature need to maintain
> > a timeout to send a batchverdict periodically to avoid starvation.
> >
> > Signed-off-by: Florian Westphal <fw@...len.de>
>
> The real question hidden here is : "Should packet ids be monotonic" in
> current implementation and all future ones ?
>
> Before we accept this patch, we should make sure packets id are
> monotonic, and I am afraid its not the case right now.
You're right, good catch.
I was fooled by atomic_inc being monotonically increasing, but since
packet building is not protected by the queue spin lock
reordering can indeed happen.
> [PATCH] netfilter: nfqueue: assert monotonic packet ids
>
> Packet identifier is currently setup in nfqnl_build_packet_message(),
> using one atomic_inc_return().
>
> Problem is that since several cpus might concurrently call
> nfqnl_enqueue_packet() for the same queue, we can deliver packets to
> consumer in non monotonic way (packet N+1 being delivered after packet
> N)
I would actually consider your patch a bug fix...
Thanks a lot for spending time on this!
--
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