netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Brett Creeley <brett.creeley@intel.com>,
	netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
	Andrew Bowers <andrewx.bowers@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next v2 07/15] ice: Fix setting coalesce to handle DCB configuration
Date: Fri, 22 Nov 2019 14:28:57 -0800	[thread overview]
Message-ID: <20191122222905.670858-8-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20191122222905.670858-1-jeffrey.t.kirsher@intel.com>

From: Brett Creeley <brett.creeley@intel.com>

Currently there can be a case where a DCB map is applied and there are
more interrupt vectors (vsi->num_q_vectors) than Rx queues (vsi->num_rxq)
and Tx queues (vsi->num_txq). If we try to set coalesce settings in this
case it will report a false failure. Fix this by checking if vector index
is valid with respect to the number of Tx and Rx queues configured.

Signed-off-by: Brett Creeley <brett.creeley@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_ethtool.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c
index 1f00091f7906..6c796c5c8edf 100644
--- a/drivers/net/ethernet/intel/ice/ice_ethtool.c
+++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c
@@ -3420,10 +3420,17 @@ __ice_set_coalesce(struct net_device *netdev, struct ethtool_coalesce *ec,
 	struct ice_vsi *vsi = np->vsi;
 
 	if (q_num < 0) {
-		int i;
+		int v_idx;
+
+		ice_for_each_q_vector(vsi, v_idx) {
+			/* In some cases if DCB is configured the num_[rx|tx]q
+			 * can be less than vsi->num_q_vectors. This check
+			 * accounts for that so we don't report a false failure
+			 */
+			if (v_idx >= vsi->num_rxq && v_idx >= vsi->num_txq)
+				goto set_complete;
 
-		ice_for_each_q_vector(vsi, i) {
-			if (ice_set_q_coalesce(vsi, ec, i))
+			if (ice_set_q_coalesce(vsi, ec, v_idx))
 				return -EINVAL;
 		}
 		goto set_complete;
-- 
2.23.0


  parent reply	other threads:[~2019-11-22 22:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 22:28 [net-next v2 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2019-11-22 Jeff Kirsher
2019-11-22 22:28 ` [net-next v2 01/15] ice: Store number of functions for the device Jeff Kirsher
2019-11-22 22:28 ` [net-next v2 02/15] ice: Correct capabilities reporting of max TCs Jeff Kirsher
2019-11-22 22:28 ` [net-next v2 03/15] ice: Disallow VF VLAN opcodes if VLAN offloads disabled Jeff Kirsher
2019-11-22 22:28 ` [net-next v2 04/15] ice: Don't modify stripping for add/del VLANs on VF Jeff Kirsher
2019-11-22 22:28 ` [net-next v2 05/15] ice: fix stack leakage Jeff Kirsher
2019-11-22 22:28 ` [net-next v2 06/15] ice: Only disable VF state when freeing each VF resources Jeff Kirsher
2019-11-22 22:28 ` Jeff Kirsher [this message]
2019-11-22 22:28 ` [net-next v2 08/15] ice: Refactor removal of VLAN promiscuous rules Jeff Kirsher
2019-11-22 22:28 ` [net-next v2 09/15] ice: Do not use devm* functions for local uses Jeff Kirsher
2019-11-22 22:29 ` [net-next v2 10/15] ice: Add ice_pf_to_dev(pf) macro Jeff Kirsher
2019-11-22 22:29 ` [net-next v2 11/15] ice: add helpers for virtchnl Jeff Kirsher
2019-11-22 22:29 ` [net-next v2 12/15] ice: implement VF stats NDO Jeff Kirsher
2019-11-22 22:29 ` [net-next v2 13/15] ice: Implement ethtool ops for channels Jeff Kirsher
2019-11-22 22:29 ` [net-next v2 14/15] ice: remove pointless NULL check of port_info Jeff Kirsher
2019-11-22 22:29 ` [net-next v2 15/15] ice: Update FW API minor version Jeff Kirsher
2019-11-23  1:08 ` [net-next v2 00/15][pull request] 100GbE Intel Wired LAN Driver Updates 2019-11-22 Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122222905.670858-8-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=andrewx.bowers@intel.com \
    --cc=brett.creeley@intel.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@redhat.com \
    --cc=sassmann@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).