From patchwork Fri May 31 13:47:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 165522 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp776973ili; Fri, 31 May 2019 06:47:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqz71krleV+I5oWz0EGJuhqOwHWU8LKAhduRbFu6JiO9EjppkZhYAZvoelFG3jGsmngKmgzM X-Received: by 2002:a17:90a:de0e:: with SMTP id m14mr9420261pjv.36.1559310453590; Fri, 31 May 2019 06:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559310453; cv=none; d=google.com; s=arc-20160816; b=iSZfSk+JQIPc9hXByYSkKl1DFE8FgTE3RlpIk5u31sngezuB/cnbgfmppov6vpaHe0 H6xzp6YXSXSMo/zpD650KQr7i8f2hnctStL5wnMard3eEGQxu8AdPu4soaopy7Gg9mnj Z3cWeFn4G+rwEGckCOTYDDZFY1wSeyc78bi0SQt0diivnbKlH5SV2/zDIOvsrxrHrWcM 8MSWBX0DYvi0tR4TUZculzvXLdXXThKSmfOCXVMIBuCylVEP8OQQtoeGBE1dLK5+Dbyy GghaOgESCHiptyVQwewDdt99aQrwv/UlRmQsJ5AyWF0dNOMzxitu9rzIvcHhb9nS3eE4 X02Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=DiLJ6JnRCJJ3neCk5RdmZrESJ3I9QLujeCJngur/rJE=; b=ycLiwuPB+2P2Oguh2k29/cOJUdw2HsIfC7hFDFf52us/junSSNFMjPST7PQgNjF5cN ypwQxFTc3+GWfFOBxALCl9r92tI5OjD9kilg9hphvOXPpXxVlkWYN5Mx/eaiuV8l1L+K iIcYHhy9kOhFoDxJhH3DLs07f9edHHijuEIGC8rcK0vHldmK5miDTk8TSfA7WLtrddQV UOhBVcwnrwrzNzVJJD6+qQdJEeh+74LeFpSXayAh8YyX0vVfY3Td8Ds5hw5zTRuD1lZp AmRxoYCeRXEasRLa99DMIjqc9HmBiBrkWreYVzwqzbmQPRncGiGcOuucgQwCzkeijSE0 qZlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=sHCqvooD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h96si6316152plb.281.2019.05.31.06.47.33; Fri, 31 May 2019 06:47:33 -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=@linaro.org header.s=google header.b=sHCqvooD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726784AbfEaNrc (ORCPT + 30 others); Fri, 31 May 2019 09:47:32 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:41564 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfEaNrb (ORCPT ); Fri, 31 May 2019 09:47:31 -0400 Received: by mail-lf1-f67.google.com with SMTP id 136so7944234lfa.8 for ; Fri, 31 May 2019 06:47:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=DiLJ6JnRCJJ3neCk5RdmZrESJ3I9QLujeCJngur/rJE=; b=sHCqvooDv0728QzeNQ1TedqmihQUeuFTkHyBB6ZslHvYDAeqSvTbKX7zsghL88Sz5r CXmKtLjoM+fsXBob4SGzSK9wKa9V9mo1gY3Bemb2T3r2q3zubXW18qQRRE1lH5rl5jRT IWSk7/hkb/UgSvczaG4qG1J70uBFM/w4kXU+WM6kNN+yvAjNV+N/S9GyGuaH4bihmDU1 uzA/0uI9Qkk6lCTUJA1tEg3ocjLfox5qpAhXMhzcJqjCFCEflgCK0DJrjavwTkE/IQx7 IlaIDGkNutbTyTrzLklrfkYdcF1+vAmuCv+hSoAF9ezEr0XR5cGr8rpvOX7RwlaN5ucV 1YqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DiLJ6JnRCJJ3neCk5RdmZrESJ3I9QLujeCJngur/rJE=; b=FDFv/bKMmLgTKkBZ4yLpel47m82Bi5Fn/2rh0Mvve6mM0qIRRevJH2JlHCimhEiEvE zag8Jpl9Ku1P3tE4XClVbKELuA0EjMQ1IA4QY3ic2s8UeKMfdXq91897b/TCOFHNMnrD KJqM2FosZ2ZL80PvMenByidpWRB1wSp/Nt/uN2WN5Zpp61XlQviAg99m8zNWI8WnjJfX kjXg7B9PknuTaoTREqm9jAYlV3LicnlPI9cSCl9OFpOEnTSksZGDLw9aypH3x+tkeUCZ dKNE5TpNnFr7ulAyvg24s2QR1aQl5WgU2/ByAW1Ior3WhZKEB5Rt5lbC3vwOS0Wqhx3Q 8zpg== X-Gm-Message-State: APjAAAVfGrcuWiniHPAe9BFXJJyR9h6pBt/8AMeGtQ8IvljwCKELeepZ 3cMikPY/PiVEx3WGBSJLIOb/mA== X-Received: by 2002:a19:3f16:: with SMTP id m22mr5601760lfa.104.1559310449908; Fri, 31 May 2019 06:47:29 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id s20sm763312lfb.95.2019.05.31.06.47.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 May 2019 06:47:29 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, davem@davemloft.net Cc: linux-omap@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH v2] net: ethernet: ti: cpsw_ethtool: fix ethtool ring param set Date: Fri, 31 May 2019 16:47:25 +0300 Message-Id: <20190531134725.2054-1-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix ability to set RX descriptor number, the reason - initially "tx_max_pending" was set incorrectly, but the issue appears after adding sanity check, so fix is for "sanity" patch. Fixes: 37e2d99b59c476 ("ethtool: Ensure new ring parameters are within bounds during SRINGPARAM") Signed-off-by: Ivan Khoronzhuk --- Based on net/master drivers/net/ethernet/ti/cpsw_ethtool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/cpsw_ethtool.c b/drivers/net/ethernet/ti/cpsw_ethtool.c index a4a7ec0d2531..6d1c9ebae7cc 100644 --- a/drivers/net/ethernet/ti/cpsw_ethtool.c +++ b/drivers/net/ethernet/ti/cpsw_ethtool.c @@ -643,7 +643,7 @@ void cpsw_get_ringparam(struct net_device *ndev, struct cpsw_common *cpsw = priv->cpsw; /* not supported */ - ering->tx_max_pending = 0; + ering->tx_max_pending = cpsw->descs_pool_size - CPSW_MAX_QUEUES; ering->tx_pending = cpdma_get_num_tx_descs(cpsw->dma); ering->rx_max_pending = cpsw->descs_pool_size - CPSW_MAX_QUEUES; ering->rx_pending = cpdma_get_num_rx_descs(cpsw->dma);