linux-hyperv.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Haiyang Zhang <haiyangz@microsoft.com>
Cc: sashal@kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, kys@microsoft.com,
	sthemmin@microsoft.com, olaf@aepfle.de, vkuznets@redhat.com,
	davem@davemloft.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next, 1/3] Drivers: hv: vmbus: Add a dev_num variable based on channel offer sequence
Date: Sat, 28 Dec 2019 16:20:02 -0800	[thread overview]
Message-ID: <20191228162002.3a603c8b@hermes.lan> (raw)
In-Reply-To: <1577576793-113222-2-git-send-email-haiyangz@microsoft.com>

On Sat, 28 Dec 2019 15:46:31 -0800
Haiyang Zhang <haiyangz@microsoft.com> wrote:

> +
> +next:
> +	found = false;
> +
> +	list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) {
> +		if (i == channel->dev_num &&
> +		    guid_equal(&channel->offermsg.offer.if_type,
> +			       &newchannel->offermsg.offer.if_type)) {
> +			found = true;
> +			break;
> +		}
> +	}
> +
> +	if (found) {
> +		i++;
> +		goto next;
> +	}
> +

Overall, keeping track of dev_num is a good solution.

I prefer not having a loop coded with goto's. Why not
a nested loop. Also, there already is a search of the channel
list in vmbus_process_offer() so why is another lookup needed?

  reply	other threads:[~2019-12-29  0:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-28 23:46 [PATCH net-next, 0/3] Add vmbus dev_num and enable netvsc async probing Haiyang Zhang
2019-12-28 23:46 ` [PATCH net-next, 1/3] Drivers: hv: vmbus: Add a dev_num variable based on channel offer sequence Haiyang Zhang
2019-12-29  0:20   ` Stephen Hemminger [this message]
2019-12-29  1:06     ` Haiyang Zhang
2019-12-28 23:46 ` [PATCH net-next, 2/3] Drivers: hv: vmbus: Add dev_num to sysfs Haiyang Zhang
2019-12-28 23:46 ` [PATCH net-next, 3/3] hv_netvsc: Name NICs based on vmbus offer sequence and use async probe Haiyang Zhang
2019-12-29  0:13   ` Stephen Hemminger
2019-12-29  1:23     ` 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=20191228162002.3a603c8b@hermes.lan \
    --to=stephen@networkplumber.org \
    --cc=davem@davemloft.net \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olaf@aepfle.de \
    --cc=sashal@kernel.org \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.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).