public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: David Miller <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,v2] Add support for netvsc build without CONFIG_SYSFS flag
Date: Sun, 11 May 2014 14:07:05 +0100	[thread overview]
Message-ID: <1399813625.11946.138.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <b641d25465f44cae8c7c9a680a31594d@DFM-DB3MBX15-06.exchange.corp.microsoft.com>

[-- Attachment #1: Type: text/plain, Size: 1859 bytes --]

On Thu, 2014-05-08 at 20:50 +0000, Haiyang Zhang wrote:
> 
> > -----Original Message-----
> > From: David Miller [mailto:davem@davemloft.net]
> > Sent: Thursday, May 8, 2014 4:45 PM
> > To: Haiyang Zhang
> > Cc: 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,v2] Add support for netvsc build without
> > CONFIG_SYSFS flag
> > 
> > From: Haiyang Zhang <haiyangz@microsoft.com>
> > Date: Thu,  8 May 2014 13:41:33 -0700
> > 
> > > +static inline void netvsc_record_rx_queue(struct sk_buff *skb,
> > > +					  struct hv_netvsc_packet *packet,
> > > +					  struct net_device *ndev)
> > > +{
> > > +#ifdef CONFIG_SYSFS
> > > +	skb_record_rx_queue(skb, packet->channel->
> > > +			    offermsg.offer.sub_channel_index %
> > > +			    ndev->real_num_rx_queues);
> > > +#endif
> > > +}
> > 
> > This is still fantastically gross, what is so unique about your driver that it needs
> > hacks like this?  No other driver to my knowledge does.
> > 
> > Figure out what it is that makes your driver so unique, and try to make it
> > conform to how other drivers handle these features without SYSFS ifdef'ery
> > instead.
> > 
> 
> I looked around the other drivers, and the netif_set_real_num_rx_queues() function. 
> It's already switched to no-op without CONFIG_SYSFS flag. So I will rely on this, and 
> don't have to handle the flag in my code. 

I think most other drivers have a 1-1 mapping between hardware RX queues
and the RX queue indices reported to Linux.  It appears that in this
case sub_channel_index is the 'hardware' queue number, but you think
there is not a 1-1 mapping.  Why is that?

Ben.

-- 
Ben Hutchings
Sturgeon's Law: Ninety percent of everything is crap.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2014-05-11 13:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 20:41 [PATCH net-next, v2] Add support for netvsc build without CONFIG_SYSFS flag Haiyang Zhang
2014-05-08 20:03 ` Greg KH
2014-05-08 20:41   ` Haiyang Zhang
2014-05-08 20:44 ` [PATCH net-next,v2] " David Miller
2014-05-08 20:50   ` Haiyang Zhang
2014-05-11 13:07     ` Ben Hutchings [this message]
2014-05-11 22:35       ` Haiyang Zhang

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=1399813625.11946.138.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --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