netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: haiyangz@microsoft.com
Cc: olaf@aepfle.de, netdev@vger.kernel.org, jasowang@redhat.com,
	driverdev-devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next,v3] hyperv: Add support for virtual Receive Side Scaling (vRSS)
Date: Wed, 19 Mar 2014 16:40:05 -0400 (EDT)	[thread overview]
Message-ID: <20140319.164005.1815461875771862691.davem@davemloft.net> (raw)
In-Reply-To: <1395180922-2776-1-git-send-email-haiyangz@microsoft.com>

From: Haiyang Zhang <haiyangz@microsoft.com>
Date: Tue, 18 Mar 2014 15:15:22 -0700

> +struct ndis_obj_header {
> +	u8 type;
> +	u8 rev;
> +	u16 size;
> +} __packed;
> +
> +
> +/* ndis_recv_scale_cap/cap_flag */

One empty line is sufficient, we don't need two of them here.

> +extern u8 netvsc_hash_key[];

We no longer use extern in header file function declarations.

> +	u32 processor_masks_offset;
> +	u32 num_processor_masks;
> +	u32 processor_masks_entry_size;
> +};
> +
> +
>  /* Fwd declaration */

Again, one empty line is enough.

> @@ -120,6 +217,7 @@ void netvsc_linkstatus_callback(struct hv_device *device_obj,
>  int netvsc_recv_callback(struct hv_device *device_obj,
>  			struct hv_netvsc_packet *packet,
>  			struct ndis_tcp_ip_checksum_info *csum_info);
> +extern void netvsc_channel_cb(void *context);

Again, please remove this extern in function declarations.

> +		if (netif_tx_queue_stopped(netdev_get_tx_queue(ndev, q_idx)) &&
> +			!net_device->start_remove &&
> +			(hv_ringbuf_avail_percent(&channel->outbound) >
> +			RING_AVAIL_PERCENT_HIWATER || queue_sends < 1))

For the second time, this is not properly indented.  Multi-line
conditionals should be formatted like this:

	if (CONDITION1 OPERATOR
	    CONDITION2 OPERATOR
	    ...)

etc.  For example, this specifically should be:

		if (netif_tx_queue_stopped(netdev_get_tx_queue(ndev, q_idx)) &&
		    !net_device->start_remove &&
		    (hv_ringbuf_avail_percent(&channel->outbound) >
		     RING_AVAIL_PERCENT_HIWATER || queue_sends < 1))

Generally speaking, if you are only using TAB characters to indent,
you are probably doing it wrong.

You should use the appropriate number of TAB _and_ SPACE characters
necessary to start the line at exactly the first column after the
openning parenthesis of the appropriate construct.

> @@ -668,9 +756,11 @@ static int netvsc_probe(struct hv_device *dev,
>  	struct net_device *net = NULL;
>  	struct net_device_context *net_device_ctx;
>  	struct netvsc_device_info device_info;
> +	struct netvsc_device *nvdev;
>  	int ret;
>  
> -	net = alloc_etherdev(sizeof(struct net_device_context));
> +	net = alloc_etherdev_mq(sizeof(struct net_device_context),
> +				num_online_cpus());
>  	if (!net)
>  		return -ENOMEM;
>  

num_online_cpus() can change, will your driver accomodate this?

> +}
> +
> +
>  static int rndis_filter_query_device_link_status(struct rndis_device *dev)

One empty line is sufficient.

>  }
>  
> +
> +static void netvsc_sc_open(struct vmbus_channel *new_sc)

Likewise.

> +	ret = vmbus_open(new_sc, nvscdev->ring_size * PAGE_SIZE,
> +		nvscdev->ring_size * PAGE_SIZE, NULL, 0,
> +		netvsc_channel_cb, new_sc);

When function arguments span multiple lines the function call
shall be indented as:

	func(A, B, C,
	     D, E, F);

That is, the second and subsequent lines are indented, using
the appropriate number of TAB _and_ SPACE characters, necessary
to reach exactly the first column after the openning parenthesis.

There are several other cases of this, please audit your entire
submission for this problem.

If proper indentation causes lines to significantly exceed 80
columns, consider helper functions or local variables to
allieve the problem.

> +	ret = rndis_filter_query_device(rndis_device,
> +		OID_GEN_RECEIVE_SCALE_CAPABILITIES, &rsscap, &rsscap_size);

Same problem.

  reply	other threads:[~2014-03-19 20:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-18 22:15 [PATCH net-next, v3] hyperv: Add support for virtual Receive Side Scaling (vRSS) Haiyang Zhang
2014-03-19 20:40 ` David Miller [this message]
2014-03-19 21:36   ` [PATCH net-next,v3] " Haiyang Zhang
2014-03-19 21:56   ` Sergei Shtylyov
2014-03-19 21:00     ` Stephen Rothwell
2014-03-20  3:41     ` David Miller

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=20140319.164005.1815461875771862691.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=haiyangz@microsoft.com \
    --cc=jasowang@redhat.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;
as well as URLs for NNTP newsgroup(s).