DPDK patches and discussions
 help / color / Atom feed
From: Gaëtan Rivet <gaetan.rivet@6wind.com>
To: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: dev@dpdk.org, Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Subject: Re: [dpdk-dev] [PATCH 2/7] net/failsafe: check code of allmulticast mode switch
Date: Mon, 9 Sep 2019 14:56:56 +0200
Message-ID: <20190909125656.fxkbfvxja2z62bzv@bidouze.vm.6wind.com> (raw)
In-Reply-To: <1568031190-16510-3-git-send-email-arybchenko@solarflare.com>

On Mon, Sep 09, 2019 at 01:13:04PM +0100, Andrew Rybchenko wrote:
> From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> 
> rte_eth_allmulticast_enable()/rte_eth_allmulticast_disable() return
> value was changed from void to int, so this patch modify usage
> of these functions across net/failsafe according to new return type.
> 
> Try to keep all-multicast mode consistent across all active
> devices in the case of failure.
> 
> Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>

A small nit below, but otherwise
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

> ---
>  drivers/net/failsafe/failsafe_ether.c |  8 +++--
>  drivers/net/failsafe/failsafe_ops.c   | 44 ++++++++++++++++++++++++---
>  2 files changed, 46 insertions(+), 6 deletions(-)
> 
[...]
> diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c
> index fee783ad07..b90fa8676c 100644
> --- a/drivers/net/failsafe/failsafe_ops.c
> +++ b/drivers/net/failsafe/failsafe_ops.c
> @@ -723,10 +723,28 @@ fs_allmulticast_enable(struct rte_eth_dev *dev)
>  {
>  	struct sub_device *sdev;
>  	uint8_t i;
> +	int ret = 0;
>  
>  	fs_lock(dev, 0);
> -	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE)
> -		rte_eth_allmulticast_enable(PORT_ID(sdev));
> +	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
> +		ret = rte_eth_allmulticast_enable(PORT_ID(sdev));
> +		ret = fs_err(sdev, ret);
> +		if (ret != 0) {
> +			ERROR("All-multicast mode enable failed for subdevice %d",
> +				PORT_ID(sdev));
> +			break;
> +		}
> +	}
> +	if (ret != 0) {
> +		/* Rollback in the case of failure */
> +		FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
> +			ret = rte_eth_allmulticast_disable(PORT_ID(sdev));
> +			ret = fs_err(sdev, ret);
> +			if (ret != 0)
> +				ERROR("All-multicast mode disable to rollback failed for subdevice %d",

I'd formulate the error as such:

"All-multicast mode disable during rollback failed for subdevice %d"

That may not be the best either, but the current format seems a little
off? I could be wrong.

> +					PORT_ID(sdev));
> +		}
> +	}
>  	fs_unlock(dev, 0);
>  }
>  
> @@ -735,10 +753,28 @@ fs_allmulticast_disable(struct rte_eth_dev *dev)
>  {
>  	struct sub_device *sdev;
>  	uint8_t i;
> +	int ret = 0;
>  
>  	fs_lock(dev, 0);
> -	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE)
> -		rte_eth_allmulticast_disable(PORT_ID(sdev));
> +	FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
> +		ret = rte_eth_allmulticast_disable(PORT_ID(sdev));
> +		ret = fs_err(sdev, ret);
> +		if (ret != 0) {
> +			ERROR("All-multicast mode disable failed for subdevice %d",
> +				PORT_ID(sdev));
> +			break;
> +		}
> +	}
> +	if (ret != 0) {
> +		/* Rollback in the case of failure */
> +		FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) {
> +			ret = rte_eth_allmulticast_enable(PORT_ID(sdev));
> +			ret = fs_err(sdev, ret);
> +			if (ret != 0)
> +				ERROR("All-multicast mode enable to rollback failed for subdevice %d",

Same as above.

> +					PORT_ID(sdev));
> +		}
> +	}
>  	fs_unlock(dev, 0);
>  }
>  
> -- 
> 2.17.1
> 

-- 
Gaëtan Rivet
6WIND

  reply index

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-09 12:13 [dpdk-dev] [PATCH 0/7] ethdev: change allmulticast controls to return status Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 1/7] ethdev: change allmulticast mode controllers to return errors Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 2/7] net/failsafe: check code of allmulticast mode switch Andrew Rybchenko
2019-09-09 12:56   ` Gaëtan Rivet [this message]
2019-09-13 21:04     ` Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 3/7] net/bonding: " Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 4/7] ethdev: change allmulticast callbacks to return status Andrew Rybchenko
2019-09-16  7:03   ` Hyong Youb Kim (hyonkim)
2019-09-16  7:29     ` Andrew Rybchenko
2019-09-24  8:27   ` Ferruh Yigit
2019-09-24 12:14     ` Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 5/7] ethdev: do nothing if all-multicast mode is applied again Andrew Rybchenko
2019-09-24  8:36   ` Ferruh Yigit
2019-09-24  8:54     ` Andrew Rybchenko
2019-09-24 11:03       ` Ferruh Yigit
2019-09-24 11:50         ` Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 6/7] app/testpmd: check code of allmulticast mode switch Andrew Rybchenko
2019-09-09 12:13 ` [dpdk-dev] [PATCH 7/7] examples/ipv4_multicast: check allmulticast enable status Andrew Rybchenko

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=20190909125656.fxkbfvxja2z62bzv@bidouze.vm.6wind.com \
    --to=gaetan.rivet@6wind.com \
    --cc=Ivan.Ilchenko@oktetlabs.ru \
    --cc=arybchenko@solarflare.com \
    --cc=dev@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

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/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 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


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


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