mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Haiyang Zhang <haiyangz@microsoft.com>
To: Ben Hutchings <bhutchings@solarflare.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	KY Srinivasan <kys@microsoft.com>,
	"olaf@aepfle.de" <olaf@aepfle.de>,
	"jasowang@redhat.com" <jasowang@redhat.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"driverdev-devel@linuxdriverproject.org" 
	<driverdev-devel@linuxdriverproject.org>
Subject: RE: [PATCH net-next] hyperv: Add support for Virtual Receive Side Scaling (vRSS)
Date: Thu, 19 Dec 2013 18:36:27 +0000	[thread overview]
Message-ID: <ff7f7541d0164d408b3a4278569c593a@DFM-DB3MBX15-06.exchange.corp.microsoft.com> (raw)
In-Reply-To: <1387475178.1876.29.camel@bwh-desktop.uk.level5networks.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 2623 bytes --]



> -----Original Message-----
> From: Ben Hutchings [mailto:bhutchings@solarflare.com]
> Sent: Thursday, December 19, 2013 12:46 PM
> To: Haiyang Zhang
> Cc: davem@davemloft.net; netdev@vger.kernel.org; KY Srinivasan;
> olaf@aepfle.de; jasowang@redhat.com; linux-kernel@vger.kernel.org;
> driverdev-devel@linuxdriverproject.org
> Subject: Re: [PATCH net-next] hyperv: Add support for Virtual Receive Side
> Scaling (vRSS)
> 
> On Wed, 2013-12-18 at 14:21 -0800, Haiyang Zhang wrote:
> > This feature allows multiple channels to be used by each virtual NIC.
> > It is available on Hyper-V host 2012 R2.
> >  	} else if (ret == -EAGAIN) {
> > -		netif_stop_queue(ndev);
> > +		netif_tx_stop_all_queues(ndev);
> >  		if (atomic_read(&net_device->num_outstanding_sends) < 1) {
> > -			netif_wake_queue(ndev);
> > +			netif_tx_wake_all_queues(ndev);
> >  			ret = -ENOSPC;
> >  		}
> >  	} else {
> 
> This doesn't makes any sense to me.  How can you safely share the same
> channels between all TX queues?
> 
> I think you need to associate TX queues and channels 1-1.  If you are required to
> map packets to TX queues using the Toeplitz hash, you should implement
> ndo_select_queue and do the mapping there.  Then in
> netvsc_send() you would use the queue number from the skb to find which
> channel to use and which queue may need to be stopped/woken.
> 
> [...]
> > --- a/drivers/net/hyperv/netvsc_drv.c
> > +++ b/drivers/net/hyperv/netvsc_drv.c
> [...]
> > +/* Toeplitz hash function
> > + * data: network byte order
> > + * return: host byte order
> > + */
> 
> This looks incredibly slow.  I've seen software implementations that are likely to
> be more efficient, e.g.
> <http://thread.gmane.org/gmane.linux.network/284612/>
> 
> [...]
> > int netvsc_probe(struct hv_device *dev,
> >  		return ret;
> >  	}
> >  	memcpy(net->dev_addr, device_info.mac_adr, ETH_ALEN);
> > +	nvdev = hv_get_drvdata(dev);
> > +	rtnl_lock();
> > +	netif_set_real_num_tx_queues(net, nvdev->num_chn);
> > +	netif_set_real_num_rx_queues(net, nvdev->num_chn);
> [...]
> 
> These functions can fail if called after registering the net device, so you should
> either call them with the final values earlier or handle failure here.
> 
> Also, I notice that dev_addr is only set after registering; that should be fixed.
> 

Thank you for the suggestions! I will re-write the send queue selection, enhance
the hash calculation, also fix the initialization sequence.

Thanks,
- Haiyang

ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

  reply	other threads:[~2013-12-19 18:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-18 22:21 Haiyang Zhang
2013-12-19 17:46 ` Ben Hutchings
2013-12-19 18:36   ` Haiyang Zhang [this message]
2013-12-19 18:45     ` Daniel Borkmann
2013-12-19 19:21       ` Haiyang Zhang
2013-12-19 19:58         ` Tom Herbert
2013-12-19 20:49           ` Haiyang Zhang
2013-12-19 21:43             ` Tom Herbert
2013-12-19 22:05               ` Ben Hutchings
2013-12-19 23:00               ` David Miller
2013-12-19 23:15               ` Haiyang Zhang
2013-12-19 23:30                 ` Tom Herbert

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=ff7f7541d0164d408b3a4278569c593a@DFM-DB3MBX15-06.exchange.corp.microsoft.com \
    --to=haiyangz@microsoft.com \
    --cc=bhutchings@solarflare.com \
    --cc=davem@davemloft.net \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=jasowang@redhat.com \
    --cc=kys@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olaf@aepfle.de \
    /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

all inboxes | Powered by JetHome®