Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3488666imu; Sun, 11 Nov 2018 16:14:27 -0800 (PST) X-Google-Smtp-Source: AJdET5dau3ngVjH+Fy5OJ5TXiiQOqOYW33mOjM0b++epA4TQyrKSyVJMz2XPiF313b3zJs0aG3bW X-Received: by 2002:a63:c503:: with SMTP id f3mr8149996pgd.431.1541981666993; Sun, 11 Nov 2018 16:14:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981666; cv=none; d=google.com; s=arc-20160816; b=fw73Pns3POzdTAKATKw+fgjeCvJqXBSIy9+XbYIVtp/PPvg23OASpgcp+BwsCdzh30 O0I87ol4LFrjeE2Q15owKh7uWszFmL0hWZ+U+8/PXGd6y1p3U1KVJpgMcypiHoOqPn+2 apj/u6VLOx2c2L0HO1lao3ZQmLst/ORpC/dDXcCIigJ6HOa8LIPTQonFkAJNrJ0KLGZ0 ggYjnN3aZUCOFDxspZry97wTWz5Q4jBQdggkhtJstU1R5vaBJYwfGFvZnxg4DQr7DEmR G/EfHIKeFcsZuFU1yI+meUtU3Hqa28CVzF5r3anWFMwmpx1hBi9y8GUgBsf97CQ03gNg J5FA== 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=rg4zjwl/UiHoTE8J6Che0sYgpkA1+bVIFUiwfXuOF+0=; b=Qm/1JIutChJCACuIbhibkEtWD4GQSRfkIvvbZnEhT/LCeHGspqFfIMYDsgM5gIoSCg g4ZhrBM94gXEMFoFTItjeNQf/uGSBlPFDM8590FhaI6Dy0HpkfV3FDgL5hMxn2DlIRth t1Q+7MtzUk/Knoqk1C0TJIls8k5KDIBVeL4d1ddiSI1hCnYZzkRuO2sBN3tBypQdPHi+ qzk9+13x1xvjxsvszNAY6lGvl7IoP5ta/XchZ7tsBNdAEd6tuXG5iiV3Qsd5JYmSZFiw C/+x51FqltnSTcxliGmxPuZiRsHM1tbzNM6fUAb2J4WHIKJqnMilzNllRkTLNErI0eaE 7G+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="FVPm9C/d"; 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 z14si14897034pgj.73.2018.11.11.16.14.11; Sun, 11 Nov 2018 16:14:26 -0800 (PST) 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="FVPm9C/d"; 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 S1730974AbeKLKDH (ORCPT + 99 others); Mon, 12 Nov 2018 05:03:07 -0500 Received: from mail.kernel.org ([198.145.29.99]:60238 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730573AbeKLIRR (ORCPT ); Mon, 12 Nov 2018 03:17:17 -0500 Received: from localhost (unknown [206.108.79.134]) (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 393BC21508; Sun, 11 Nov 2018 22:27:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975242; bh=+VtGXGDZV3xoe/yne6S9XJyv4WoM5IhkwCUQkRCl3iw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FVPm9C/dLHu7XjJdQ5DpIT07FxmvsiJrEd+OvPj6WJUA+bp491B4muM31Lqc749zj zKpOLdk456IZLjpSUqmD705xux26b+pj6unibXyzN+FufTW+2DmVXxqFXO53zwVd/N JerGH1RfRYoVg5pbL3cCvxGR6WYvFlwvRsXbaoGs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bruce Allan , Anirudh Venkataramanan , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.19 088/361] ice: fix changing of ring descriptor size (ethtool -G) Date: Sun, 11 Nov 2018 14:17:15 -0800 Message-Id: <20181111221632.144443197@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bruce Allan [ Upstream commit f934bb9b8b6136edd261b2dc2c9ad4dbc39ffc66 ] rx_mini_pending was set to an incorrect value. This was causing EINVAL to always be returned to 'ethtool -G'. The driver does not support mini or jumbo rings so the respective settings should be zero. Also, change the valid range of the number of descriptors in the rings to make the code simpler and easier for users to understand (this removes the valid settings of 8 and 16). Add a system log message indicating when the number is rounded-up from what the user specifies with the 'ethtool -G' command (i.e. when it is not a multiple of 32), and update the log message when a user-provided value is out of range to also indicate the stride. Signed-off-by: Bruce Allan Signed-off-by: Anirudh Venkataramanan Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ice/ice.h | 4 ++-- drivers/net/ethernet/intel/ice/ice_ethtool.c | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -39,9 +39,9 @@ extern const char ice_drv_ver[]; #define ICE_BAR0 0 #define ICE_DFLT_NUM_DESC 128 -#define ICE_MIN_NUM_DESC 8 -#define ICE_MAX_NUM_DESC 8160 #define ICE_REQ_DESC_MULTIPLE 32 +#define ICE_MIN_NUM_DESC ICE_REQ_DESC_MULTIPLE +#define ICE_MAX_NUM_DESC 8160 #define ICE_DFLT_TRAFFIC_CLASS BIT(0) #define ICE_INT_NAME_STR_LEN (IFNAMSIZ + 16) #define ICE_ETHTOOL_FWVER_LEN 32 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -478,9 +478,11 @@ ice_get_ringparam(struct net_device *net ring->tx_max_pending = ICE_MAX_NUM_DESC; ring->rx_pending = vsi->rx_rings[0]->count; ring->tx_pending = vsi->tx_rings[0]->count; - ring->rx_mini_pending = ICE_MIN_NUM_DESC; + + /* Rx mini and jumbo rings are not supported */ ring->rx_mini_max_pending = 0; ring->rx_jumbo_max_pending = 0; + ring->rx_mini_pending = 0; ring->rx_jumbo_pending = 0; } @@ -498,14 +500,23 @@ ice_set_ringparam(struct net_device *net ring->tx_pending < ICE_MIN_NUM_DESC || ring->rx_pending > ICE_MAX_NUM_DESC || ring->rx_pending < ICE_MIN_NUM_DESC) { - netdev_err(netdev, "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d]\n", + netdev_err(netdev, "Descriptors requested (Tx: %d / Rx: %d) out of range [%d-%d] (increment %d)\n", ring->tx_pending, ring->rx_pending, - ICE_MIN_NUM_DESC, ICE_MAX_NUM_DESC); + ICE_MIN_NUM_DESC, ICE_MAX_NUM_DESC, + ICE_REQ_DESC_MULTIPLE); return -EINVAL; } new_tx_cnt = ALIGN(ring->tx_pending, ICE_REQ_DESC_MULTIPLE); + if (new_tx_cnt != ring->tx_pending) + netdev_info(netdev, + "Requested Tx descriptor count rounded up to %d\n", + new_tx_cnt); new_rx_cnt = ALIGN(ring->rx_pending, ICE_REQ_DESC_MULTIPLE); + if (new_rx_cnt != ring->rx_pending) + netdev_info(netdev, + "Requested Rx descriptor count rounded up to %d\n", + new_rx_cnt); /* if nothing to do return success */ if (new_tx_cnt == vsi->tx_rings[0]->count &&