netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.duyck@gmail.com>
To: Nicholas Krause <xerofoify@gmail.com>, jeffrey.t.kirsher@intel.com
Cc: linux-kernel@vger.kernel.org, intel-wired-lan@lists.osuosl.org,
	netdev@vger.kernel.org
Subject: Re: [Intel-wired-lan] [PATCH] fm10k:Fix error handling in the function fm10k_probe
Date: Fri, 23 Oct 2015 23:28:20 -0700	[thread overview]
Message-ID: <562B2504.1030409@gmail.com> (raw)
In-Reply-To: <1445024551-21281-1-git-send-email-xerofoify@gmail.com>

On 10/16/2015 12:42 PM, Nicholas Krause wrote:
> This fixes error handling in the function fm10k_probe to properly
> if the call to the function fm10k_iov_configure has failed by
> returning a error code before jumping to a new goto label,
> fm10k_iov_configure to clean up previously allocated resources
> between this goto label and the previous goto label before finally
> returning the error code to the callers of the function fm10k_probe
>
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>   drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> index ce53ff2..3d7374e 100644
> --- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> +++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
> @@ -1844,13 +1844,17 @@ static int fm10k_probe(struct pci_dev *pdev,
>   	fm10k_slot_warn(interface);
>   
>   	/* enable SR-IOV after registering netdev to enforce PF/VF ordering */
> -	fm10k_iov_configure(pdev, 0);
> +	err = fm10k_iov_configure(pdev, 0);
> +	if (err)
> +		goto err_iov_configure;
>   
>   	/* clear the service task disable bit to allow service task to start */
>   	clear_bit(__FM10K_SERVICE_DISABLE, &interface->state);
>   
>   	return 0;
> -
> +err_iov_configure:
> +	fm10k_ptp_unregister(interface);
> +	unregister_netdev(netdev);
>   err_register:
>   	fm10k_mbx_free_irq(interface);
>   err_mbx_interrupt:

Failing to enable SR-IOV is not grounds for not brining up the 
interface.  The NIC is still usable, it just cannot do SR-IOV.

The only reason fm10k_iov_configure has a return value is because it is 
also passed through the PCI interface to allow the sysfs control.  If it 
returns an error there then it is much more important as the user 
actually requested it be enabled.

If you would like you could display a message there but this shouldn't 
be a hard error.

- Alex

           reply	other threads:[~2015-10-24  6:28 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <1445024551-21281-1-git-send-email-xerofoify@gmail.com>]

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=562B2504.1030409@gmail.com \
    --to=alexander.duyck@gmail.com \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=xerofoify@gmail.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).