From: David Miller <davem@davemloft.net>
To: alban.crequy@collabora.co.uk
Cc: eric.dumazet@gmail.com, shemminger@vyatta.com,
gorcunov@openvz.org, adobriyan@gmail.com, lennart@poettering.net,
kay.sievers@vrfy.org, ian.molton@collabora.co.uk,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/9] AF_UNIX: find the recipients for multicast messages
Date: Tue, 23 Nov 2010 10:39:49 -0800 (PST) [thread overview]
Message-ID: <20101123.103949.39186245.davem@davemloft.net> (raw)
In-Reply-To: <20101123174701.1b2f6f16@chocolatine.cbg.collabora.co.uk>
From: Alban Crequy <alban.crequy@collabora.co.uk>
Date: Tue, 23 Nov 2010 17:47:01 +0000
> Le Tue, 23 Nov 2010 17:08:37 +0100,
> Eric Dumazet <eric.dumazet@gmail.com> a écrit :
>> I am not sure if doing 90 clones of skb and filtering them one by one
>> is going to be fast :-(
>
> Yes... I think it can be optimized. Run the socket filter first by
> calling sk_run_filter() directly and then call skb_clone() + pskb_trim()
> only on the few remaining sockets.
BTW, we have and have talked about the same exact problem with
AF_PACKET socket users such as DHCP.
We clone and push the packet down into the AF_PACKET protocol
code from the pt_type callback when %99 of the time the socket
filter doesn't match and thus the clone is completely wasted
work.
If we know the socket, or more specifically the filter, early enough,
we could have a special interface like:
struct sk_buff *skb_filter_or_clone(struct sk_buff *skb, ...)
Which returns a non-NULL cloned SKB if the filter accepts the
packet.
next prev parent reply other threads:[~2010-11-23 18:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-22 18:34 [PATCH 0/9] RFC v2: Multicast and filtering features on AF_UNIX Alban Crequy
2010-11-22 18:36 ` [PATCH 1/9] AF_UNIX: Add constant for Unix socket options level Alban Crequy
2010-11-22 18:36 ` [PATCH 2/9] AF_UNIX: add setsockopt on Unix sockets Alban Crequy
2010-11-22 18:36 ` [PATCH 3/9] AF_UNIX: create, join and leave multicast groups with setsockopt Alban Crequy
2010-11-22 19:00 ` David Miller
2010-11-22 18:36 ` [PATCH 4/9] AF_UNIX: find the recipients for multicast messages Alban Crequy
2010-11-22 19:05 ` David Miller
2010-11-23 15:03 ` Alban Crequy
2010-11-23 16:08 ` Eric Dumazet
2010-11-23 16:56 ` Eric Dumazet
2010-11-23 17:47 ` Alban Crequy
2010-11-23 18:39 ` David Miller [this message]
2010-11-22 20:14 ` Andi Kleen
2010-11-22 18:36 ` [PATCH 5/9] AF_UNIX: Deliver message to several recipients in case of multicast Alban Crequy
2010-11-22 18:36 ` [PATCH 6/9] AF_UNIX: Apply Linux Socket Filtering to Unix sockets Alban Crequy
2010-11-22 18:36 ` [PATCH 7/9] AF_UNIX: Documentation on multicast Unix Sockets Alban Crequy
2010-11-22 19:07 ` Rémi Denis-Courmont
2010-11-22 20:09 ` Alban Crequy
2010-11-22 18:36 ` [PATCH 8/9] AF_UNIX: add options on multicast connected socket Alban Crequy
2010-11-22 18:36 ` [PATCH 9/9] AF_UNIX: implement poll(POLLOUT) for multicast sockets Alban Crequy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101123.103949.39186245.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=adobriyan@gmail.com \
--cc=alban.crequy@collabora.co.uk \
--cc=eric.dumazet@gmail.com \
--cc=gorcunov@openvz.org \
--cc=ian.molton@collabora.co.uk \
--cc=kay.sievers@vrfy.org \
--cc=lennart@poettering.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).