Re: [PATCH 14/14] nfnetlink: add support for memory mapped netlink

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nishit Shah <nsshah.82@xxxxxxxxx> wrote:
> On Wed, Apr 17, 2013 at 10:17 PM, Patrick McHardy <kaber@xxxxxxxxx> wrote:
> >
> > Signed-off-by: Patrick McHardy <kaber@xxxxxxxxx>
[..]
> > diff --git a/net/netfilter/nfnetlink_queue_core.c b/net/netfilter/nfnetlink_queue_core.c
> > index 5e280b3..ef3cdb4 100644
> > --- a/net/netfilter/nfnetlink_queue_core.c
> > +++ b/net/netfilter/nfnetlink_queue_core.c
> > @@ -339,7 +339,8 @@ nfqnl_build_packet_message(struct nfqnl_instance *queue,
> >         if (queue->flags & NFQA_CFG_F_CONNTRACK)
> >                 ct = nfqnl_ct_get(entskb, &size, &ctinfo);
> >
> > -       skb = alloc_skb(size, GFP_ATOMIC);
> > +       skb = nfnetlink_alloc_skb(&init_net, size, queue->peer_portid,
> > +                                 GFP_ATOMIC);
> >         if (!skb)
> >                 return NULL;
> >
> 
> does this mean that we have a true zero copy support with Eric D's
> patch (nfnetlink_queue: zero-copy support) and this patch ?

No.  In both socket and mmap case there is one copy involved.

Before Erics patch, there were two:
first copy: skb_copy_bits() that copies to packet payload into the
netlink message
second copy: copy to userspace when recv() is called

Patricks mmap patch removes the second copy; as the netlink
message is already allocated in userspace memory (the mmap ring).

Erics patch avoids the first copy by only copying fragments'
addresses instead of the payload.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux