patches for DPDK stable branches
 help / color / Atom feed
From: Gaëtan Rivet <grive@u256.net>
To: Long Li <longli@linuxonhyperv.com>
Cc: dev@dpdk.org, Long Li <longli@microsoft.com>, stable@dpdk.org
Subject: Re: [dpdk-stable] [PATCH] net/failsafe: check correct error code while handling sub-device add
Date: Mon, 5 Oct 2020 11:42:15 +0200
Message-ID: <20201005094215.u4kt64ycbk35kbeg@u256.net> (raw)
In-Reply-To: <1601683308-18738-1-git-send-email-longli@linuxonhyperv.com>

Hi,

On 02/10/20 17:01 -0700, Long Li wrote:
> From: Long Li <longli@microsoft.com>
> 
> When adding a sub-device, it's possible that the sub-device is configured
> successfully but later fails to start. This error should not be masked.

Some of those errors are meant to be masked: -EIO, when the device is
marked as removed at the ethdev level (see eth_err() in rte_ethdev.c:819).

> The driver needs to check the error status to prevent endless loop of
> trying to start the sub-device.

If the ethdev layer error is due to the device being removed, and
failsafe loops on trying to sync the eth device to its own state, then
an RMV event should have been emitted but wasn't or it was missed by
failsafe.

If the ethdev layer error is *not* due to the device being removed, the
error should be != -EIO, and sdev->remove should not be set, so fs_err()
should not mask it and it should be seen by the app.

Can you provide the following details:

 * What is the return code of rte_eth_dev_start() that is masked in your
   start loop?

 * Is the device marked as removed in failsafe?

 * Is the device marked as removed in ethdev?

 * Was there an RMV event generated for the device? Whether yes or no,
   is it correct?

Thanks,

> 
> fixes (ae80146c5a1b net/failsafe: fix removed device handling)
> 
> cc: stable@dpdk.org
> Signed-off-by: Long Li <longli@microsoft.com>
> ---
>  drivers/net/failsafe/failsafe_private.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
> index 651578a..c58c0de 100644
> --- a/drivers/net/failsafe/failsafe_private.h
> +++ b/drivers/net/failsafe/failsafe_private.h
> @@ -497,7 +497,7 @@ int failsafe_eth_new_event_callback(uint16_t port_id,
>  fs_err(struct sub_device *sdev, int err)
>  {
>  	/* A device removal shouldn't be reported as an error. */
> -	if (sdev->remove == 1 || err == -EIO)
> +	if (sdev->remove == 1 && err == -EIO)
>  		return rte_errno = 0;
>  	return err;
>  }
> -- 
> 1.8.3.1
> 

-- 
Gaëtan

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03  0:01 Long Li
2020-10-05  9:42 ` Gaëtan Rivet [this message]
2020-10-09 16:20   ` [dpdk-stable] [dpdk-dev] " Gaëtan Rivet
2020-10-09 20:30     ` Long Li
2020-10-12 14:22       ` Gaëtan Rivet
2020-10-13 17:14         ` Long Li
2020-10-15 10:11 ` [dpdk-stable] " Gaëtan Rivet

Reply instructions:

You may reply publically 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=20201005094215.u4kt64ycbk35kbeg@u256.net \
    --to=grive@u256.net \
    --cc=dev@dpdk.org \
    --cc=longli@linuxonhyperv.com \
    --cc=longli@microsoft.com \
    --cc=stable@dpdk.org \
    /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

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox