[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <416d12ac27914bb98baa1891509d641c@DFM-DB3MBX15-06.exchange.corp.microsoft.com>
Date: Thu, 8 May 2014 20:41:32 +0000
From: Haiyang Zhang <haiyangz@...rosoft.com>
To: Greg KH <greg@...ah.com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"olaf@...fle.de" <olaf@...fle.de>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"driverdev-devel@...uxdriverproject.org"
<driverdev-devel@...uxdriverproject.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH net-next, v2] Add support for netvsc build without
CONFIG_SYSFS flag
> -----Original Message-----
> From: Greg KH [mailto:greg@...ah.com]
> Sent: Thursday, May 8, 2014 4:04 PM
> To: Haiyang Zhang
> Cc: davem@...emloft.net; netdev@...r.kernel.org; olaf@...fle.de;
> jasowang@...hat.com; driverdev-devel@...uxdriverproject.org; linux-
> kernel@...r.kernel.org
> Subject: Re: [PATCH net-next, v2] Add support for netvsc build without
> CONFIG_SYSFS flag
>
> On Thu, May 08, 2014 at 01:41:33PM -0700, Haiyang Zhang wrote:
> > This change ensures the driver can be built successfully without the
> > CONFIG_SYSFS flag.
> > MS-TFS: 182270
> >
> > Signed-off-by: Haiyang Zhang <haiyangz@...rosoft.com>
> > Reviewed-by: K. Y. Srinivasan <kys@...rosoft.com>
> > ---
> > drivers/net/hyperv/hyperv_net.h | 28 ++++++++++++++++++++++++++++
> > drivers/net/hyperv/netvsc_drv.c | 13 +++++++------
> > drivers/net/hyperv/rndis_filter.c | 4 ++--
> > 3 files changed, 37 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/net/hyperv/hyperv_net.h
> > b/drivers/net/hyperv/hyperv_net.h index 4b7df5a..02358cb 100644
> > --- a/drivers/net/hyperv/hyperv_net.h
> > +++ b/drivers/net/hyperv/hyperv_net.h
> > @@ -87,6 +87,8 @@ struct ndis_recv_scale_cap { /*
> > NDIS_RECEIVE_SCALE_CAPABILITIES */ #define HASH_KEYLEN
> > NDIS_RSS_HASH_SECRET_KEY_MAX_SIZE_REVISION_2
> > extern u8 netvsc_hash_key[];
> >
> > +extern unsigned int netvsc_num_queue;
> > +
> > struct ndis_recv_scale_param { /* NDIS_RECEIVE_SCALE_PARAMETERS */
> > struct ndis_obj_header hdr;
> >
> > @@ -178,6 +180,32 @@ struct rndis_device {
> > unsigned char hw_mac_adr[ETH_ALEN];
> > };
> >
> > +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
>
> Really? Do all other wireless drivers have this type of #ifdef needed?
>
> > +}
> > +
> > +static inline void netvsc_show_num_queue(struct device *dev,
> > + struct net_device *ndev)
> > +{
> > +#ifdef CONFIG_SYSFS
> > + dev_info(dev, "real num tx,rx queues:%u, %u\n",
> > + ndev->real_num_tx_queues, ndev->real_num_rx_queues);
> #endif
>
> Do network drivers really spam the kernel log with this type of thing?
> If you have sysfs, why is this needed in the kernel log?
>
> > +}
> > +
> > +static inline void netvsc_set_num_queue(unsigned int *nq) { #ifdef
> > +CONFIG_SYSFS
> > + *nq = num_online_cpus();
> > +#endif
> > +}
>
> I really feel that something is odd here...
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.
Also, the dev_info can be removed.
Thanks,
- Haiyang
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists