Received: by 10.192.165.156 with SMTP id m28csp56578imm; Tue, 10 Apr 2018 16:18:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx48bB3IuWg5+hXI2WYoK0JBNfQULBmhEqPB+NfgtGtl6jpPMMLdos/gQ5urdUNWVVtKMhOPE X-Received: by 2002:a17:902:6949:: with SMTP id k9-v6mr2452722plt.185.1523402296788; Tue, 10 Apr 2018 16:18:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523402296; cv=none; d=google.com; s=arc-20160816; b=yWLsxI2JPi8M5uVf6I2Yi86BoCMzn0FrWTEGnuRx3G6hGKUftXdHt4FibEe2Zw3DPl ORU+0cxI8Yu7Ioa9Pcd1rhVTltv0vhqYeA6SJGTfBFOxPWK8mcW/3TM+40xntX0d8bGk NJTpTlyyGlo23V0Qg6PgFOWHqSlwroJ97VBp+XHMshWo7la3kpULb+/5ywZ9UD2+63l/ Cn77K8NYC37XHPFGhZDe/sKPYDTsG3t1E9pJnYfOXK84G6v/1D1dWQwpI5I1Vt8zMwSR yExQiljZ1aQbL5z2yvaQX2bJBkPYI8XXaNBSS4GbDL35J/Bto7EYPVeJVPcbH3X9WUwi +1LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=+Mdf/SxS/1t7DXAVkuuNVS87YeaGCNqfDkBFnWT+isE=; b=ytiqt7E3kOhlqOKgpzEffgfIrKjqhHbE7yT2g/6dXD5TZs5U9EXfKzw748cczfYidi x9fNiPSCJbsbljzcu1qdbYz8z/rNsRwfyPUSqM1hpbNgOVFOAb3Wtl9cjiF8X4dELrG/ /dPrpPsqsFgOP86l/I6cQ0jU2a7CsnDZuD6tQRme2n4XTc7j/z41LC5KSqT27X7QORak +5bZVbOcGik1A8zLzLHALmi+49qh+cp3OG0/XZatwLLaGyv8N+9zCb7QraQBvo5YGKP7 BtfRNoDefDDj8Iyg58nzexAeE+FnOhPwGN3B8No2akYeQ1dlwPGQTgsGV9L0PMvgU/Dn 872A== ARC-Authentication-Results: i=1; mx.google.com; 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 r1si2839758pfb.247.2018.04.10.16.17.39; Tue, 10 Apr 2018 16:18:16 -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; 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 S1755041AbeDJWce (ORCPT + 99 others); Tue, 10 Apr 2018 18:32:34 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40950 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754993AbeDJWca (ORCPT ); Tue, 10 Apr 2018 18:32:30 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 0E3A1A47; Tue, 10 Apr 2018 22:32:29 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tal Gilboa , Saeed Mahameed , "David S. Miller" Subject: [PATCH 4.15 149/168] net/mlx5e: Set EQE based as default TX interrupt moderation mode Date: Wed, 11 Apr 2018 00:24:51 +0200 Message-Id: <20180410212807.416276367@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180410212800.144079021@linuxfoundation.org> References: <20180410212800.144079021@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tal Gilboa [ Upstream commit 48bfc39791b8b4a25f165e711f18b9c1617cefbc ] The default TX moderation mode was mistakenly set to CQE based. The intention was to add a control ability in order to improve some specific use-cases. In general, we prefer to use EQE based moderation as it gives much better numbers for the common cases. CQE based causes a degradation in the common case since it resets the moderation timer on CQE generation. This causes an issue when TSO is well utilized (large TSO sessions). The timer is set to 16us so traffic of ~64KB TSO sessions per second would mean timer reset (CQE per TSO session -> long time between CQEs). In this case we quickly reach the tcp_limit_output_bytes (256KB by default) and cause a halt in TX traffic. By setting EQE based moderation we make sure timer would expire after 16us regardless of the packet rate. This fixes an up to 40% packet rate and up to 23% bandwidth degradtions. Fixes: 0088cbbc4b66 ("net/mlx5e: Enable CQE based moderation on TX CQ") Signed-off-by: Tal Gilboa Signed-off-by: Saeed Mahameed Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/mellanox/mlx5/core/en_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_main.c @@ -4075,7 +4075,7 @@ void mlx5e_build_nic_params(struct mlx5_ struct mlx5e_params *params, u16 max_channels) { - u8 cq_period_mode = 0; + u8 rx_cq_period_mode; u32 link_speed = 0; u32 pci_bw = 0; @@ -4111,12 +4111,12 @@ void mlx5e_build_nic_params(struct mlx5_ params->lro_timeout = mlx5e_choose_lro_timeout(mdev, MLX5E_DEFAULT_LRO_TIMEOUT); /* CQ moderation params */ - cq_period_mode = MLX5_CAP_GEN(mdev, cq_period_start_from_cqe) ? + rx_cq_period_mode = MLX5_CAP_GEN(mdev, cq_period_start_from_cqe) ? MLX5_CQ_PERIOD_MODE_START_FROM_CQE : MLX5_CQ_PERIOD_MODE_START_FROM_EQE; params->rx_am_enabled = MLX5_CAP_GEN(mdev, cq_moderation); - mlx5e_set_rx_cq_mode_params(params, cq_period_mode); - mlx5e_set_tx_cq_mode_params(params, cq_period_mode); + mlx5e_set_rx_cq_mode_params(params, rx_cq_period_mode); + mlx5e_set_tx_cq_mode_params(params, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); /* TX inline */ params->tx_max_inline = mlx5e_get_max_inline_cap(mdev);