Netdev List
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Saeed Mahameed <saeedm@mellanox.com>,
	"David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Aviv Heller <avivh@mellanox.com>
Subject: Re: [net 02/14] net/mlx5: Consider tx_enabled in all modes on remap
Date: Thu, 27 Jul 2017 14:55:23 +0300	[thread overview]
Message-ID: <a88eb0e5-9164-1d7a-5077-eb90848e129b@cogentembedded.com> (raw)
In-Reply-To: <20170727102532.2317-3-saeedm@mellanox.com>

Hello!

On 07/27/2017 01:25 PM, Saeed Mahameed wrote:

> From: Aviv Heller <avivh@mellanox.com>
>
> The tx_enabled lag event field is used to determine whether a slave is
> active.
> Current logic uses this value only if the mode is active-backup.
>
> However, LACP mode, although considered a load balancing mode, can mark
> a slave as inactive in certain situations (e.g., LACP timeout).
>
> This fix takes the tx_enabled value into account when remapping, with
> no respect to the LAG mode (this should not affect the behavior in XOR
> mode, since in this mode both slaves are marked as active).
>
> Fixes: 7907f23adc18 (net/mlx5: Implement RoCE LAG feature)
> Signed-off-by: Aviv Heller <avivh@mellanox.com>
> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
> ---
>  drivers/net/ethernet/mellanox/mlx5/core/lag.c | 26 +++++++++++---------------
>  1 file changed, 11 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lag.c b/drivers/net/ethernet/mellanox/mlx5/core/lag.c
> index a3a836bdcfd2..654b02e7d1aa 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/lag.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/lag.c
> @@ -162,21 +162,17 @@ static bool mlx5_lag_is_bonded(struct mlx5_lag *ldev)
>  static void mlx5_infer_tx_affinity_mapping(struct lag_tracker *tracker,
>  					   u8 *port1, u8 *port2)
>  {
> -	if (tracker->tx_type == NETDEV_LAG_TX_TYPE_ACTIVEBACKUP) {
> -		if (tracker->netdev_state[0].tx_enabled) {
> -			*port1 = 1;
> -			*port2 = 1;
> -		} else {
> -			*port1 = 2;
> -			*port2 = 2;
> -		}
> -	} else {
> -		*port1 = 1;
> -		*port2 = 2;
> -		if (!tracker->netdev_state[0].link_up)
> -			*port1 = 2;
> -		else if (!tracker->netdev_state[1].link_up)
> -			*port2 = 1;
> +	*port1 = 1;
> +	*port2 = 2;
> +	if (!tracker->netdev_state[0].tx_enabled ||
> +	    !tracker->netdev_state[0].link_up) {
> +		*port1 = 2;
> +		return;
> +	}
> +
> +	if (!tracker->netdev_state[1].tx_enabled ||
> +	    !tracker->netdev_state[1].link_up) {
> +		*port2 = 1;
>  	}

    {} not needed here.

[...]

MBR, Sergei

  reply	other threads:[~2017-07-27 11:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 10:25 [pull request][net 00/14] Mellanox, mlx5 fixes 2017-07-27 Saeed Mahameed
2017-07-27 10:25 ` [net 01/14] net/mlx5: Clean SRIOV eswitch resources upon VF creation failure Saeed Mahameed
2017-07-27 10:25 ` [net 02/14] net/mlx5: Consider tx_enabled in all modes on remap Saeed Mahameed
2017-07-27 11:55   ` Sergei Shtylyov [this message]
2017-07-27 13:33     ` Saeed Mahameed
2017-07-27 10:25 ` [net 03/14] net/mlx5: Fix command completion after timeout access invalid structure Saeed Mahameed
2017-07-27 10:25 ` [net 04/14] net/mlx5: Fix command bad flow on command entry allocation failure Saeed Mahameed
2017-07-27 10:25 ` [net 05/14] net/mlx5e: IPoIB, Modify add/remove underlay QPN flows Saeed Mahameed
2017-07-27 10:25 ` [net 06/14] net/mlx5e: Fix outer_header_zero() check size Saeed Mahameed
2017-07-27 10:25 ` [net 07/14] net/mlx5: Fix mlx5_ifc_mtpps_reg_bits structure size Saeed Mahameed
2017-07-27 10:25 ` [net 08/14] net/mlx5e: Add field select to MTPPS register Saeed Mahameed
2017-07-27 10:25 ` [net 09/14] net/mlx5e: Fix broken disable 1PPS flow Saeed Mahameed
2017-07-27 10:25 ` [net 10/14] net/mlx5e: Change 1PPS out scheme Saeed Mahameed
2017-07-27 10:25 ` [net 11/14] net/mlx5e: Add missing support for PTP_CLK_REQ_PPS request Saeed Mahameed
2017-07-27 10:25 ` [net 12/14] net/mlx5e: Fix wrong delay calculation for overflow check scheduling Saeed Mahameed
2017-07-27 10:25 ` [net 13/14] net/mlx5e: Schedule overflow check work to mlx5e workqueue Saeed Mahameed
2017-07-27 10:25 ` [net 14/14] net/mlx5: Fix mlx5_add_flow_rules call with correct num of dests Saeed Mahameed

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=a88eb0e5-9164-1d7a-5077-eb90848e129b@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=avivh@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.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