From: Ben Hutchings <ben@decadent.org.uk>
To: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCHv2 net-next 2/2] sunvnet: Use one Tx queue per vnet_port
Date: Thu, 06 Nov 2014 16:19:33 +0000 [thread overview]
Message-ID: <1415290773.3398.61.camel@decadent.org.uk> (raw)
In-Reply-To: <20141030164609.GG650@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 1673 bytes --]
On Thu, 2014-10-30 at 12:46 -0400, Sowmini Varadhan wrote:
> Use multple Tx netdev queues for sunvnet by supporting a one-to-one
> mapping between vnet_port and Tx queue. Provide a ndo_select_queue
> indirection (vnet_select_queue()) which selects the queue based
> on the peer that would be selected in vnet_start_xmit()
>
> Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
[...]
> +static void maybe_tx_wakeup(struct vnet_port *port)
> {
> - struct net_device *dev = vp->dev;
> + struct netdev_queue *txq;
>
> - netif_tx_lock(dev);
> - if (likely(netif_queue_stopped(dev))) {
> - struct vnet_port *port;
> - int wake = 1;
> -
> - rcu_read_lock();
> - list_for_each_entry_rcu(port, &vp->port_list, list) {
> - struct vio_dring_state *dr;
> -
> - dr = &port->vio.drings[VIO_DRIVER_TX_RING];
> - if (vnet_tx_dring_avail(dr) <
> - VNET_TX_WAKEUP_THRESH(dr)) {
> - wake = 0;
> - break;
> - }
> - }
> - rcu_read_unlock();
> - if (wake)
> - netif_wake_queue(dev);
> + txq = netdev_get_tx_queue(port->vp->dev, port->q_index);
> + __netif_tx_lock(txq, smp_processor_id());
> + if (likely(netif_tx_queue_stopped(txq))) {
> + struct vio_dring_state *dr;
> +
> + dr = &port->vio.drings[VIO_DRIVER_TX_RING];
You seem to have dropped the condition for the netif_tx_wake_queue(),
which I would guess based on the old code should be:
if (vnet_tx_dring_avail(dr) >= VNET_TX_WAKEUP_THRESH(dr))
> + netif_tx_wake_queue(txq);
> }
> - netif_tx_unlock(dev);
> + __netif_tx_unlock(txq);
> }
[...]
--
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]
next prev parent reply other threads:[~2014-11-06 16:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-30 16:46 [PATCHv2 net-next 2/2] sunvnet: Use one Tx queue per vnet_port Sowmini Varadhan
2014-11-06 16:19 ` Ben Hutchings [this message]
2014-11-06 16:28 ` Sowmini Varadhan
2014-11-06 16:32 ` Ben Hutchings
2014-11-06 16:46 ` Sowmini Varadhan
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=1415290773.3398.61.camel@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=sowmini.varadhan@oracle.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).