Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp402060ybi; Fri, 26 Jul 2019 11:41:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9VqLzB8oFsP3VMp2CHtNL3Tcf3z9jFzfjGS11N6Ilf8jAck/1EsTtYnK6GWP+BUcSmltH X-Received: by 2002:aa7:9a01:: with SMTP id w1mr22921263pfj.262.1564166486665; Fri, 26 Jul 2019 11:41:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564166486; cv=none; d=google.com; s=arc-20160816; b=zW/y3pCOkGsErkdyYg5bJd/Hoqu2RjdiMVg0Rk0ItWr308Rurd18eXBFqeI5q/X4EH j1OZ3l+pjooXFn1s3assbpuVLrhXz3mulJZxvgS8BRN9/2hGI01ckwa83Ea6hAp1A+P1 8AqPRwf6RxW6oMhZ+9D38PANxsEBNqJqmVHFUKRWwh5LTp++oi14cL5QNw/ubDAKLgZ1 e5xzRtJ/EEUGIwDWEOGM+gESHNJxvdpno8b/cjGO5w+4UolVdVLhVktYFO73cmlvfDux ciNYf9qiQDVPMLpArP7pC5uVA1jBg6XrFPTal81UCw7PUiD1139F29sGBoQ1FEWIKPW2 RMFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PXB3e51qvz38f8VzS2nNP1rxpDARUG4nzoiePreXqoI=; b=wEJxt9xZ7zvM6zy2CE9+1DgtzS2+ypMLwFb4yV8iXa1GoiN6dVjC4ZOvOdaehzUwMn 9X2nlqrxOZEdVpteDJzR47nADWKJaltIWm/PgWDibNl0/inuW2VOgTrWst1qE3JDP65T 3ATwu/4BWFWXFmG0tsXE+JGIMZ8+vIukRKZrTlbaqn+dILcFhk4vWhoDKmdcyCThcCtm tddDAHC3UHp6OHULRcxOa+6OyU2aCsYx3ajZ2KTS9ES0wmzYDR1rNkn/qg5fhKD696V7 J4roB0WxxcQTFs4oa/nXOhMlM/i9UmjNcD8dHbMrMFUV5Oih/oy0JSUTVJcBOB/uzFHe klsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tAnMyIFU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h98si18807604plb.206.2019.07.26.11.41.11; Fri, 26 Jul 2019 11:41:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=tAnMyIFU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389089AbfGZPaa (ORCPT + 99 others); Fri, 26 Jul 2019 11:30:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:45298 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388303AbfGZPaY (ORCPT ); Fri, 26 Jul 2019 11:30:24 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A1140205F4; Fri, 26 Jul 2019 15:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564155024; bh=8Or4AWLAlexKIw/bjsBgwyYHaKuQtxtf6ga710lI3V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tAnMyIFUZT61fRBSxzHY4h0Ek0PsARHI1L09EXlhJchujRUlw+t3C/jT9e49rK0kY +JDCSpK3fiQHzhnIjsxc6HVLfY0WSWH4+RRAN/xU8qec1Jmap5AwOH3Fu21Eliyifz 6zOS2fBNloYRLceelDy5GCZbsOiUGChbZ3M2mVro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eli Britstein , Saeed Mahameed Subject: [PATCH 5.1 39/62] net/mlx5e: Fix port tunnel GRE entropy control Date: Fri, 26 Jul 2019 17:24:51 +0200 Message-Id: <20190726152306.072675599@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190726152301.720139286@linuxfoundation.org> References: <20190726152301.720139286@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eli Britstein [ Upstream commit 914adbb1bcf89478ac138318d28b302704564d59 ] GRE entropy calculation is a single bit per card, and not per port. Force disable GRE entropy calculation upon the first GRE encap rule, and release the force at the last GRE encap rule removal. This is done per port. Fixes: 97417f6182f8 ("net/mlx5e: Fix GRE key by controlling port tunnel entropy calculation") Signed-off-by: Eli Britstein Signed-off-by: Saeed Mahameed Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c | 23 ++--------------- 1 file changed, 4 insertions(+), 19 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/port_tun.c @@ -100,27 +100,12 @@ static int mlx5_set_entropy(struct mlx5_ */ if (entropy_flags.gre_calc_supported && reformat_type == MLX5_REFORMAT_TYPE_L2_TO_NVGRE) { - /* Other applications may change the global FW entropy - * calculations settings. Check that the current entropy value - * is the negative of the updated value. - */ - if (entropy_flags.force_enabled && - enable == entropy_flags.gre_calc_enabled) { - mlx5_core_warn(tun_entropy->mdev, - "Unexpected GRE entropy calc setting - expected %d", - !entropy_flags.gre_calc_enabled); - return -EOPNOTSUPP; - } - err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, enable, - entropy_flags.force_supported); + if (!entropy_flags.force_supported) + return 0; + err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, + enable, !enable); if (err) return err; - /* if we turn on the entropy we don't need to force it anymore */ - if (entropy_flags.force_supported && enable) { - err = mlx5_set_port_gre_tun_entropy_calc(tun_entropy->mdev, 1, 0); - if (err) - return err; - } } else if (entropy_flags.calc_supported) { /* Other applications may change the global FW entropy * calculations settings. Check that the current entropy value