Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: netanel@amazon.com
Cc: netdev@vger.kernel.org, dwmw@amazon.com, zorik@amazon.com,
	matua@amazon.com, saeedb@amazon.com, msw@amazon.com,
	aliguori@amazon.com, nafea@amazon.com, evgenys@amazon.com,
	gtzalik@amazon.com
Subject: Re: [PATCH net 3/3] eet: ena: invoke netif_carrier_off() only after netdev registered
Date: Tue, 02 Jan 2018 14:08:04 -0500 (EST)	[thread overview]
Message-ID: <20180102.140804.982695913961893372.davem@davemloft.net> (raw)
In-Reply-To: <1514496620-69953-4-git-send-email-netanel@amazon.com>

From: <netanel@amazon.com>
Date: Thu, 28 Dec 2017 21:30:20 +0000

> From: Netanel Belgazal <netanel@amazon.com>
> 
> netif_carrier_off() should be called only after register netdev.
> Move the function's call after the registration.
> 
> Signed-off-by: Netanel Belgazal <netanel@amazon.com>
> ---
>  drivers/net/ethernet/amazon/ena/ena_netdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> index fbe21a817bd8..ee50c56765a4 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
> @@ -3276,14 +3276,14 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
>  
>  	memcpy(adapter->netdev->perm_addr, adapter->mac_addr, netdev->addr_len);
>  
> -	netif_carrier_off(netdev);
> -
>  	rc = register_netdev(netdev);
>  	if (rc) {
>  		dev_err(&pdev->dev, "Cannot register net device\n");
>  		goto err_rss;
>  	}
>  
> +	netif_carrier_off(netdev);
> +

You cannot invoke this after register_netdev(), asynchronous activity can cause this
call to lose information and lose a link up event.

  parent reply	other threads:[~2018-01-02 19:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-28 21:30 [PATCH net 0/3] bug fixes for ENA Ethernet driver netanel
2017-12-28 21:30 ` [PATCH net 1/3] net: ena: unmask MSI-X only after device initialization is completed netanel
2017-12-28 21:30 ` [PATCH net 2/3] net: ena: fix error handling in ena_down() sequence netanel
2017-12-28 21:30 ` [PATCH net 3/3] eet: ena: invoke netif_carrier_off() only after netdev registered netanel
2017-12-29  7:46   ` Jakub Kicinski
2017-12-29  8:00     ` Belgazal, Netanel
2017-12-29  8:09       ` Jakub Kicinski
2018-01-02 19:08   ` David Miller [this message]
2018-01-02 20:38     ` Belgazal, Netanel

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=20180102.140804.982695913961893372.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=aliguori@amazon.com \
    --cc=dwmw@amazon.com \
    --cc=evgenys@amazon.com \
    --cc=gtzalik@amazon.com \
    --cc=matua@amazon.com \
    --cc=msw@amazon.com \
    --cc=nafea@amazon.com \
    --cc=netanel@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedb@amazon.com \
    --cc=zorik@amazon.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