From: Alexander Duyck <alexander.duyck@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>,
davem@davemloft.net,
Jesse Brandeburg <jesse.brandeburg@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com
Subject: Re: [net-next 04/17] drivers/net/intel: use napi_complete_done()
Date: Fri, 13 Nov 2015 10:49:54 -0800 [thread overview]
Message-ID: <564630D2.4020307@gmail.com> (raw)
In-Reply-To: <1447433362.22599.43.camel@edumazet-glaptop2.roam.corp.google.com>
On 11/13/2015 08:49 AM, Eric Dumazet wrote:
> On Fri, 2015-11-13 at 08:06 -0800, Alexander Duyck wrote:
>
>> Yes, I'm pretty certain you cannot use this napi_complete_done with
>> anything that support busy poll sockets. The problem is you need to
>> flush any existing lists before yielding to the socket polling in order
>> to avoid packet ordering issues between the NAPI polling routine and the
>> socket polling routine.
> My plan is to make busy poll independent of GRO / RPS / RFS, and generic
> if possible, for all NAPI drivers. (No need to absolutely provide
> ndo_busy_poll()
>
> I really do not see GRO being a problem for low latency : RPC messages
> are terminated by PSH flag that take care of flushing GRO engine.
Right. I wasn't thinking so much about GRO delaying the frames as the
fact that ixgbe will call netif_receive_skb if busy polling instead of
napi_gro_receive. So you might have frames left in the GRO list that
would get bypassed if pulled out during busy polling.
> For mixed use, (low latency and other kind of flows), GRO is a win.
Agreed.
> With the following sk_busy_loop() , we :
>
> - allow tunneling traffic to use busy poll as well as native traffic.
> - allow RFS/RPS being used (sending IPI to other cpus if needed)
> - use the 'lets burn cpu cycles' to do useful work (like TX completions, RCU callbacks...)
> - Implement busy poll for all NAPI drivers.
>
> rcu_read_lock();
> napi = napi_by_id(sk->sk_napi_id);
> if (!napi)
> goto out;
> ops = napi->dev->netdev_ops;
>
> for (;;) {
> local_bh_disable();
> rc = 0;
> if (ops->ndo_busy_poll) {
> rc = ops->ndo_busy_poll(napi);
> } else if (napi_schedule_prep(napi)) {
> rc = napi->poll(napi, 4);
> if (rc == 4) {
> napi_complete_done(napi, rc);
> napi_schedule(napi);
> }
> }
> if (rc > 0)
> NET_ADD_STATS_BH(sock_net(sk),
> LINUX_MIB_BUSYPOLLRXPACKETS, rc);
> local_bh_enable();
>
> if (rc == LL_FLUSH_FAILED ||
> nonblock ||
> !skb_queue_empty(&sk->sk_receive_queue) ||
> need_resched() ||
> busy_loop_timeout(end_time))
> break;
>
> cpu_relax();
> }
> rcu_read_unlock();
Sounds good.
- Alex
next prev parent reply other threads:[~2015-11-13 18:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 21:43 [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2015-10-15 Jeff Kirsher
2015-10-15 21:43 ` [net-next 01/17] i40e/i40evf: Fix handling of napi budget Jeff Kirsher
2015-10-15 21:43 ` [net-next 02/17] i40e/i40evf: Drop useless "IN_NETPOLL" flag Jeff Kirsher
2015-10-15 21:43 ` [net-next 03/17] i40evf: Add support for netpoll Jeff Kirsher
2015-10-15 22:10 ` Sergei Shtylyov
2015-10-15 21:43 ` [net-next 04/17] drivers/net/intel: use napi_complete_done() Jeff Kirsher
2015-11-13 5:18 ` Eric Dumazet
2015-11-13 16:06 ` Alexander Duyck
2015-11-13 16:49 ` Eric Dumazet
2015-11-13 18:49 ` Alexander Duyck [this message]
2015-10-15 21:43 ` [net-next 05/17] i40e: generate fewer startup messages Jeff Kirsher
2015-10-15 21:43 ` [net-next 06/17] i40e/i40evf: Fix compile issue related to const string Jeff Kirsher
2015-10-15 21:43 ` [net-next 07/17] i40e: remove read/write failed messages from nvmupdate Jeff Kirsher
2015-10-15 21:43 ` [net-next 08/17] i40e: Removed unused defines Jeff Kirsher
2015-10-15 21:43 ` [net-next 09/17] i40e: priv flag for controlling VEB stats Jeff Kirsher
2015-10-15 21:43 ` [net-next 10/17] i40e: Add support for non-willing Apps Jeff Kirsher
2015-10-15 21:43 ` [net-next 11/17] i40e/i40evf: moderate interrupts differently Jeff Kirsher
2015-10-15 21:43 ` [net-next 12/17] i40e: reset the invalid msg counter in vf when a valid msg is received Jeff Kirsher
2015-10-15 21:43 ` [net-next 13/17] i40evf: correctly populate vlan_features Jeff Kirsher
2015-10-15 21:43 ` [net-next 14/17] i40e: Recognize 1000Base_T_Optical phy type when link is up Jeff Kirsher
2015-10-15 21:43 ` [net-next 15/17] i40evf: relax and stagger init timing a bit Jeff Kirsher
2015-10-15 21:43 ` [net-next 16/17] i40e: increase AQ work limit Jeff Kirsher
2015-10-15 21:43 ` [net-next 17/17] i40e/i40evf: Bump i40e to 1.3.34 and i40evf to 1.3.21 Jeff Kirsher
2015-10-16 7:32 ` [net-next 00/17][pull request] Intel Wired LAN Driver Updates 2015-10-15 David Miller
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=564630D2.4020307@gmail.com \
--to=alexander.duyck@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=jeffrey.t.kirsher@intel.com \
--cc=jesse.brandeburg@intel.com \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.