Linux PCI Non-Transparent Bridge framework and drivers
 help / color / mirror / Atom feed
From: "Allen Hubbe" <Allen.Hubbe@emc.com>
To: 'Dave Jiang' <dave.jiang@intel.com>, jdmason@kudzu.us
Cc: alex@pernixdata.com, linux-ntb@googlegroups.com
Subject: RE: [PATCH] ntb: stop link work when we do not have memory
Date: Tue, 23 Feb 2016 17:25:47 -0500	[thread overview]
Message-ID: <000001d16e89$257f9c30$707ed490$@emc.com> (raw)
In-Reply-To: <20160223211111.196243.73270.stgit@djiang5-desk3.ch.intel.com>

> From: Dave Jiang <dave.jiang@intel.com>
> 
> Instead of keep trying to go through the init routine when we aren't
> able
> to allocate memory, we should just stop and go down.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> Tested-by: Alex Depoutovitch <alex@pernixdata.com>
> ---
>  drivers/ntb/ntb_transport.c |   10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index 06d4e58..50ecbd6 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -829,7 +829,7 @@ static void ntb_transport_link_work(struct
> work_struct *work)
>  	struct pci_dev *pdev = ndev->pdev;
>  	resource_size_t size;
>  	u32 val;
> -	int rc, i, spad;
> +	int rc = 0, i, spad;
> 
>  	/* send the local info, in the opposite order of the way we read it
> */
>  	for (i = 0; i < nt->mw_count; i++) {
> @@ -899,6 +899,14 @@ static void ntb_transport_link_work(struct
> work_struct *work)
>  out1:
>  	for (i = 0; i < nt->mw_count; i++)
>  		ntb_free_mw(nt, i);
> +
> +	/* if there's an actual failure, we should just bail */
> +	if (rc < 0) {
> +		nt->link_is_up = false;

Why not ntb_link_disable()?  As long as we leave the link up, the peer will keep spinning trying to connect.  Should we try again if the peer resets the link, or never again?

> +		ntb_transport_link_cleanup(nt);
> +		return;
> +	}
> +
>  out:
>  	if (ntb_link_is_up(ndev, NULL, NULL) == 1)
>  		schedule_delayed_work(&nt->link_work,



      reply	other threads:[~2016-02-23 22:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-23 21:11 [PATCH] ntb: stop link work when we do not have memory Dave Jiang
2016-02-23 22:25 ` Allen Hubbe [this message]

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='000001d16e89$257f9c30$707ed490$@emc.com' \
    --to=allen.hubbe@emc.com \
    --cc=alex@pernixdata.com \
    --cc=dave.jiang@intel.com \
    --cc=jdmason@kudzu.us \
    --cc=linux-ntb@googlegroups.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