linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Amir Levy <amir.jer.levy@intel.com>
Cc: andreas.noever@gmail.com, gregkh@linuxfoundation.org,
	bhelgaas@google.com, corbet@lwn.net,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	netdev@vger.kernel.org, linux-doc@vger.kernel.org,
	thunderbolt-linux@intel.com, mika.westerberg@intel.com,
	tomas.winkler@intel.com
Subject: Re: [PATCH v5 5/8] thunderbolt: Networking state machine
Date: Thu, 28 Jul 2016 13:35:50 +0200	[thread overview]
Message-ID: <20160728113550.GA1701@wunner.de> (raw)
In-Reply-To: <1469693721-5641-6-git-send-email-amir.jer.levy@intel.com>

On Thu, Jul 28, 2016 at 11:15:18AM +0300, Amir Levy wrote:
> +static void nhi_handle_notification_msg(struct tbt_nhi_ctxt *nhi_ctxt,
> +					const u8 *msg)
> +{
> +	struct port_net_dev *port;
> +	u8 port_num;
> +
> +#define INTER_DOMAIN_LINK_SHIFT 0
> +#define INTER_DOMAIN_LINK_MASK	GENMASK(2, INTER_DOMAIN_LINK_SHIFT)
> +	switch (msg[3]) {
> +
> +	case NC_INTER_DOMAIN_CONNECTED:
> +		port_num = PORT_NUM_FROM_MSG(msg[5]);
> +#define INTER_DOMAIN_APPROVED BIT(3)
> +		if (likely(port_num < nhi_ctxt->num_ports)) {
> +			if (!(msg[5] & INTER_DOMAIN_APPROVED))

I find these interspersed #defines make the code hard to read,
but maybe that's just me.


> +				nhi_ctxt->net_devices[
> +					port_num].medium_sts =

Looks like a carriage return slipped in here.

In patch [4/8], I've found it a bit puzzling that FW->SW responses and
FW->SW notifications are defined in icm_nhi.c, whereas SW->FW commands
are defined in net.h. It would perhaps be more logical to have them
all in the header file. The FW->SW responses and SW->FW commands are
almost identical, there are odd spelling differences (CONNEXION vs.
CONNECTION).

It would probably be good to explain the PDF acronym somewhere.

I've skimmed over all patches in the series, too superficial to provide
a Reviewed-by, it's just too much code to review thoroughly and I also
lack the hardware to test it, but broadly this LGTM.

Thanks,

Lukas

  reply	other threads:[~2016-07-28 11:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-28  8:15 [PATCH v5 0/8] thunderbolt: Introducing Thunderbolt(TM) networking Amir Levy
2016-07-28  8:15 ` [PATCH v5 1/8] thunderbolt: Macro rename Amir Levy
2016-07-28  8:15 ` [PATCH v5 2/8] thunderbolt: Updating the register definitions Amir Levy
2016-07-28  8:15 ` [PATCH v5 3/8] thunderbolt: Kconfig for Thunderbolt(TM) networking Amir Levy
2016-07-28  8:15 ` [PATCH v5 4/8] thunderbolt: Communication with the ICM (firmware) Amir Levy
2016-07-29 21:02   ` Stephen Hemminger
2016-07-29 21:48     ` Greg KH
2016-07-31 10:18       ` Levy, Amir (Jer)
2016-07-29 21:03   ` Stephen Hemminger
2016-07-31 12:07     ` Levy, Amir (Jer)
2016-07-28  8:15 ` [PATCH v5 5/8] thunderbolt: Networking state machine Amir Levy
2016-07-28 11:35   ` Lukas Wunner [this message]
2016-07-31 11:58     ` Levy, Amir (Jer)
2016-07-28  8:15 ` [PATCH v5 6/8] thunderbolt: Networking transmit and receive Amir Levy
2016-07-29 21:07   ` Stephen Hemminger
2016-07-31 10:15     ` Levy, Amir (Jer)
2016-07-31 18:45       ` David Miller
2016-08-01  4:30         ` Levy, Amir (Jer)
2016-07-28  8:15 ` [PATCH v5 7/8] thunderbolt: Networking doc Amir Levy
2016-07-28  8:15 ` [PATCH v5 8/8] thunderbolt: Adding maintainer entry Amir Levy

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=20160728113550.GA1701@wunner.de \
    --to=lukas@wunner.de \
    --cc=amir.jer.levy@intel.com \
    --cc=andreas.noever@gmail.com \
    --cc=bhelgaas@google.com \
    --cc=corbet@lwn.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mika.westerberg@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=thunderbolt-linux@intel.com \
    --cc=tomas.winkler@intel.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).