netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: johnathanx.mantey@intel.com
Cc: netdev@vger.kernel.org, sam@mendozajonas.com
Subject: Re: [PATCH] Propagate NCSI channel carrier loss/gain events to the kernel
Date: Sat, 11 Jan 2020 15:31:34 -0800 (PST)	[thread overview]
Message-ID: <20200111.153134.978765596460592103.davem@davemloft.net> (raw)
In-Reply-To: <b2ef76f2-cf4e-3d14-7436-8c66e63776ba@intel.com>

From: Johnathan Mantey <johnathanx.mantey@intel.com>
Date: Fri, 10 Jan 2020 14:02:23 -0800


Please format your Subject line as:

Subject: $SUBSYSTEM_PREFIX: Summary.

Here, $SUBSYSTEM_PREFIX would be "ncsi: "

> Problem statement:
> Insertion or removal of a network cable attached to a NCSI controlled
> network channel does not notify the kernel of the loss/gain of the
> network link.
> 
> The expectation is that /sys/class/net/eth(x)/carrier will change
> state after a pull/insertion event. In addition the carrier_up_count
> and carrier_down_count files should increment.
> 
> Change statement:
> Use the NCSI Asynchronous Event Notification handler to detect a
> change in a NCSI link.
> Add code to propagate carrier on/off state to the network interface.
> The on/off state is only modified after the existing code identifies
> if the network device HAD or HAS a link state change.

Please remove this "Problem statement:" and "Change statement:", we know
what you are talking about.

> @@ -89,6 +89,12 @@ static int ncsi_aen_handler_lsc(struct ncsi_dev_priv
> *ndp,
>      if ((had_link == has_link) || chained)
>          return 0;
>  
> +    if (had_link) {
> +        netif_carrier_off(ndp->ndev.dev);
> +    } else {
> +        netif_carrier_on(ndp->ndev.dev);
> +    }

As per coding style, single line basic blocks should not get curly
braces around them in this situation.

Thank you.

  reply	other threads:[~2020-01-11 23:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-10 22:02 [PATCH] Propagate NCSI channel carrier loss/gain events to the kernel Johnathan Mantey
2020-01-11 23:31 ` David Miller [this message]
2020-01-14  0:43 ` samjonas
2020-01-14 16:47   ` Johnathan Mantey
2020-01-15  1:24     ` samjonas
2020-01-15  1:40       ` samjonas

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=20200111.153134.978765596460592103.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=johnathanx.mantey@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=sam@mendozajonas.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).