Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3725306imm; Mon, 18 Jun 2018 03:02:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLqs2J7KvrabhFQ5BxaQLzH3nXYVpP9zdwFObX0jFd2U6oDUkLnLYyrItMMVc7vZNK3PBU0 X-Received: by 2002:a65:4bcd:: with SMTP id p13-v6mr10448901pgr.114.1529316152413; Mon, 18 Jun 2018 03:02:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529316152; cv=none; d=google.com; s=arc-20160816; b=B+muEMU5d04gwRp0usvAVtdI2xS8KGp27I3T2OCuDDFZt6CuycfVeNVmN++o5i1Awa htuUWE9N6SDHr6t51cRzy/xKCgne68pteo808SZ9wIA5SyFJi57wiKwNkG1K6B24XW6G CICW2gfyeWVvn6hiUiFiO4lCHEk8IRYBk+WIvrQjRWlasmHuOGuPzsZU25gSf1XC4y+7 Oc8xDaTYofV6C6iCksKvmn62Sup+J4byXCvYfGapcV6j3NPHUpYNMPaZBkd/hptkz2Od PYCiEJnhJ3UppLyZebdOG6aa3pVFEUN2JWjM0BexaKYsH2+3JbbDpA8Hl2/TWarRiTYf sfxA== 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=bW7fvBJCx/sckpXs2Y48o9EFGCcVh/IARAuPRsgGlLw=; b=bOhn6U6iYboQd/4gR5B351V+ufT6NZw93kbagDvXgHFuzJqmVlV0h2mbjSbgwtZ/iY OqH/1hiNue/6J43P2EPk9hg4QNLJPepiq0QN3f3tpX4pwfRMG62PYuPWPOqIeM0brCrn o4iy/bWMcCE3EAWrmeJnOmNCIVS/045bSufkHr65wQSJChtv+4XKOxWYj0jsu0NgSOLG Dw10h2Us9wuhEpOXI/bv6ZgH2/WnNTJ7BTvnafS+CAylFIltXRKGUsDLBRJVr4nLRIys xygaHhdbGC8CRPxtsgaTi0TDvAPgx4ybznN1iGlm50ZIqphLaQDJVk2oY0LtAocy2FYd FxTQ== 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 z23-v6si13550196pfe.296.2018.06.18.03.02.19; Mon, 18 Jun 2018 03:02:32 -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 S935374AbeFRITH (ORCPT + 99 others); Mon, 18 Jun 2018 04:19:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54792 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935350AbeFRITE (ORCPT ); Mon, 18 Jun 2018 04:19:04 -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 31C59BAD; Mon, 18 Jun 2018 08:19:04 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinicius Costa Gomes , Aaron Brown , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.16 089/279] igb: Fix the transmission mode of queue 0 for Qav mode Date: Mon, 18 Jun 2018 10:11:14 +0200 Message-Id: <20180618080612.487787478@linuxfoundation.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618080608.851973560@linuxfoundation.org> References: <20180618080608.851973560@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.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Vinicius Costa Gomes [ Upstream commit 2707df9773cd2cb8b0f35b8592431b301da9d352 ] When Qav mode is enabled, queue 0 should be kept on Stream Reservation mode. From the i210 datasheet, section 8.12.19: "Note: Queue0 QueueMode must be set to 1b when TransmitMode is set to Qav." ("QueueMode 1b" represents the Stream Reservation mode) The solution is to give queue 0 the all the credits it might need, so it has priority over queue 1. A situation where this can happen is when cbs is "installed" only on queue 1, leaving queue 0 alone. For example: $ tc qdisc replace dev enp2s0 handle 100: parent root mqprio num_tc 3 \ map 2 2 1 0 2 2 2 2 2 2 2 2 2 2 2 2 queues 1@0 1@1 2@2 hw 0 $ tc qdisc replace dev enp2s0 parent 100:2 cbs locredit -1470 \ hicredit 30 sendslope -980000 idleslope 20000 offload 1 Signed-off-by: Vinicius Costa Gomes Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/igb/igb_main.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c @@ -1698,7 +1698,22 @@ static void igb_configure_cbs(struct igb WARN_ON(hw->mac.type != e1000_i210); WARN_ON(queue < 0 || queue > 1); - if (enable) { + if (enable || queue == 0) { + /* i210 does not allow the queue 0 to be in the Strict + * Priority mode while the Qav mode is enabled, so, + * instead of disabling strict priority mode, we give + * queue 0 the maximum of credits possible. + * + * See section 8.12.19 of the i210 datasheet, "Note: + * Queue0 QueueMode must be set to 1b when + * TransmitMode is set to Qav." + */ + if (queue == 0 && !enable) { + /* max "linkspeed" idleslope in kbps */ + idleslope = 1000000; + hicredit = ETH_FRAME_LEN; + } + set_tx_desc_fetch_prio(hw, queue, TX_QUEUE_PRIO_HIGH); set_queue_mode(hw, queue, QUEUE_MODE_STREAM_RESERVATION);