public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Shirley Ma <mashirle@us•ibm.com>
To: Rusty Russell <rusty@rustcorp•com.au>
Cc: "Michael S. Tsirkin" <mst@redhat•com>,
	netdev@vger•kernel.org, Herbert Xu <herbert@gondor•apana.org.au>
Subject: Re: [PATCH RFC] virtio_net: use NAPI for xmit (UNTESTED)
Date: Wed, 31 Mar 2010 00:13:21 -0700	[thread overview]
Message-ID: <1270019601.25337.7.camel@localhost.localdomain> (raw)
In-Reply-To: <201003311429.57793.rusty@rustcorp.com.au>

On Wed, 2010-03-31 at 14:29 +1030, Rusty Russell wrote:
> +static int virtnet_xmit_poll(struct napi_struct *xmit_napi, int
> budget)
> +{
> +       struct virtnet_info *vi =
> +               container_of(xmit_napi, struct virtnet_info,
> xmit_napi);
> +
> +       /* Don't access vq/capacity at same time as start_xmit. */
> +       __netif_tx_lock(netdev_get_tx_queue(vi->dev, 0),
> smp_processor_id());
> +
> +       vi->capacity += free_old_xmit_skbs(vi);
> +       if (vi->capacity >= 2 + MAX_SKB_FRAGS) {
> +               /* Suppress further xmit interrupts. */
> +               vi->svq->vq_ops->disable_cb(vi->svq);
> +               napi_complete(xmit_napi);
> +
> +               /* Don't wake it if link is down. */
> +               if (likely(netif_carrier_ok(vi->vdev)))

This should be if (likely(netif_carrier_ok(vi->dev)))

> +                       netif_wake_queue(vi->dev);
> +       }
> +
> +       __netif_tx_unlock(netdev_get_tx_queue(vi->dev, 0));
> +       return 1;
> +}
> + 

I tested the backport patch with vhost on, the initial netperf test
result showed BW performance decreased 10% with same cpu utilization. I
will look at it tomorrow.

Shirley


      parent reply	other threads:[~2010-03-31  7:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31  3:59 [PATCH RFC] virtio_net: use NAPI for xmit (UNTESTED) Rusty Russell
2010-03-31  5:44 ` Shirley Ma
2010-03-31  5:58   ` Shirley Ma
2010-03-31  7:13 ` Shirley Ma [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=1270019601.25337.7.camel@localhost.localdomain \
    --to=mashirle@us$(echo .)ibm.com \
    --cc=herbert@gondor$(echo .)apana.org.au \
    --cc=mst@redhat$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=rusty@rustcorp$(echo .)com.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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