From: David Miller <davem@davemloft.net>
To: vyasevic@redhat.com
Cc: mst@redhat.com, netdev@vger.kernel.org
Subject: Re: [RFC net-next PATCH] macvtap: Add packet capture support
Date: Wed, 20 Nov 2013 15:20:29 -0500 (EST) [thread overview]
Message-ID: <20131120.152029.1712178262809565940.davem@davemloft.net> (raw)
In-Reply-To: <528D173F.2060102@redhat.com>
From: Vlad Yasevich <vyasevic@redhat.com>
Date: Wed, 20 Nov 2013 15:10:39 -0500
> I don't know if "better" is what I'd say here. With the current code,
> if no-one is capturing, the cost is that of "if list_empty". If
> I switch to rx_handler approach, the cost goes up on every packet even
> if no-one is capture. The call stack ends up beeing really silly:
> _netif_receive_skb_core()
> macvlan_handle_frame()
> macvtap_receive()
> return RX_HANDLER_ANOTHER;
> macvtap_handle_frame()
> consume.
>
> Yes, this approach seems to fit in better with the architecture of the
> stack, but boy, it looks inefficient.
It is cheaper than:
> macvlan_handle_frame()
> macvtap_receive()
> netif_receive_skb()
> ....
> reprocess software interrupt
etc. etc.
With the rx_handler approach we're just iterating to a function call
which consumes the SKB, that whole code path is pretty much guarenteed
to be in the CPUs I-cache the second time.
I look forward to seeing your perf data :)
prev parent reply other threads:[~2013-11-20 20:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 18:04 [RFC net-next PATCH] macvtap: Add packet capture support Vlad Yasevich
2013-11-20 18:19 ` Michael S. Tsirkin
2013-11-20 19:36 ` Vlad Yasevich
2013-11-20 20:06 ` Michael S. Tsirkin
2013-11-20 20:19 ` Vlad Yasevich
2013-11-20 20:30 ` Michael S. Tsirkin
2013-11-20 20:35 ` Vlad Yasevich
2013-11-20 21:12 ` Michael S. Tsirkin
2013-11-20 22:01 ` Vlad Yasevich
2013-11-20 19:52 ` David Miller
2013-11-20 20:10 ` Vlad Yasevich
2013-11-20 20:20 ` David Miller [this message]
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=20131120.152029.1712178262809565940.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=vyasevic@redhat.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).