All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Mitch Williams <mitch.a.williams@intel.com>,
	netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
	Catherine Sullivan <catherine.sullivan@intel.com>,
	Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 15/16] i40e/i40evf: Use correct number of VF vectors
Date: Fri, 14 Mar 2014 02:47:25 -0700	[thread overview]
Message-ID: <1394790446-31591-16-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1394790446-31591-1-git-send-email-jeffrey.t.kirsher@intel.com>

From: Mitch Williams <mitch.a.williams@intel.com>

Now that the 2.4 firmware reports the correct number of MSI-X vectors,
use this value correctly when communicating with the VF, and when
setting up the interrupt linked list.

The PF has always reported the correct number of MSI-X vectors, so we
should never increment the value in the vf driver.

Change-ID: Ifeefc631c321390192219ce2af9ada6180c1492f
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 9 +++++----
 drivers/net/ethernet/intel/i40evf/i40evf_main.c    | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
index 42cc6ba..7839343 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c
@@ -69,7 +69,7 @@ static inline bool i40e_vc_isvalid_vector_id(struct i40e_vf *vf, u8 vector_id)
 {
 	struct i40e_pf *pf = vf->pf;
 
-	return vector_id <= pf->hw.func_caps.num_msix_vectors_vf;
+	return vector_id < pf->hw.func_caps.num_msix_vectors_vf;
 }
 
 /***********************vf resource mgmt routines*****************/
@@ -126,8 +126,8 @@ static void i40e_config_irq_link_list(struct i40e_vf *vf, u16 vsi_idx,
 		reg_idx = I40E_VPINT_LNKLST0(vf->vf_id);
 	else
 		reg_idx = I40E_VPINT_LNKLSTN(
-					   (pf->hw.func_caps.num_msix_vectors_vf
-					      * vf->vf_id) + (vector_id - 1));
+		     ((pf->hw.func_caps.num_msix_vectors_vf - 1) * vf->vf_id) +
+		     (vector_id - 1));
 
 	if (vecmap->rxq_map == 0 && vecmap->txq_map == 0) {
 		/* Special case - No queues mapped on this vector */
@@ -506,7 +506,8 @@ static void i40e_free_vf_res(struct i40e_vf *vf)
 		vf->lan_vsi_index = 0;
 		vf->lan_vsi_id = 0;
 	}
-	msix_vf = pf->hw.func_caps.num_msix_vectors_vf + 1;
+	msix_vf = pf->hw.func_caps.num_msix_vectors_vf;
+
 	/* disable interrupts so the VF starts in a known state */
 	for (i = 0; i < msix_vf; i++) {
 		/* format is same for both registers */
diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
index 11d0b61..8daab3a 100644
--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c
+++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c
@@ -1141,7 +1141,7 @@ static int i40evf_set_interrupt_capability(struct i40evf_adapter *adapter)
 	 * (roughly) twice the number of vectors as there are CPU's.
 	 */
 	v_budget = min(pairs, (int)(num_online_cpus() * 2)) + NONQ_VECS;
-	v_budget = min(v_budget, (int)adapter->vf_res->max_vectors + 1);
+	v_budget = min(v_budget, (int)adapter->vf_res->max_vectors);
 
 	/* A failure in MSI-X entry allocation isn't fatal, but it does
 	 * mean we disable MSI-X capabilities of the adapter.
-- 
1.8.3.1

  parent reply	other threads:[~2014-03-14  9:47 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14  9:47 [net-next 00/16][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2014-03-14  9:47 ` [net-next 01/16] ixgbe: add check for netif_carrier_ok in ixgbe_xmit_frame Jeff Kirsher
2014-03-14 18:57   ` David Miller
2014-03-14 20:19     ` Tantilov, Emil S
2014-03-14 21:51       ` David Miller
2014-03-15  0:19         ` Ben Hutchings
2014-03-15  0:24           ` Tantilov, Emil S
2014-03-14  9:47 ` [net-next 02/16] ixgbe: fix spinlock recursion with netpoll and busy poll Jeff Kirsher
2014-03-14 18:58   ` David Miller
2014-03-14 20:40     ` Tantilov, Emil S
2014-03-14 21:53       ` David Miller
2014-03-15  2:08       ` Eric W. Biederman
2014-03-14  9:47 ` [net-next 03/16] igb: Fix code comment Jeff Kirsher
2014-03-14  9:47 ` [net-next 04/16] i40e: delete netdev after deleting napi and vectors Jeff Kirsher
2014-03-14  9:47 ` [net-next 05/16] i40e: Fix a bug in the update logic for FDIR SB filter Jeff Kirsher
2014-03-14  9:47 ` [net-next 06/16] i40e/i40evf: Some flow director HW definition fixes Jeff Kirsher
2014-03-14  9:47 ` [net-next 07/16] i40e: make string references to q be queue Jeff Kirsher
2014-03-14  9:47 ` [net-next 08/16] i40e: cleanup strings Jeff Kirsher
2014-03-14  9:47 ` [net-next 09/16] i40e: simplified init string Jeff Kirsher
2014-03-14  9:47 ` [net-next 10/16] i40e: Fix function comments Jeff Kirsher
2014-03-14  9:47 ` [net-next 11/16] i40e: Define a new state variable to keep track of feature auto disable Jeff Kirsher
2014-03-14  9:47 ` [net-next 12/16] i40e: Add code to handle FD table full condition Jeff Kirsher
2014-03-14  9:47 ` [net-next 13/16] i40e: Bug fix for FDIR replay logic Jeff Kirsher
2014-03-14  9:47 ` [net-next 14/16] i40e: Let MDD events be handled by MDD handler Jeff Kirsher
2014-03-14  9:47 ` Jeff Kirsher [this message]
2014-03-14  9:47 ` [net-next 16/16] i40e/i40evf: Use dma_set_mask_and_coherent Jeff Kirsher

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=1394790446-31591-16-git-send-email-jeffrey.t.kirsher@intel.com \
    --to=jeffrey.t.kirsher@intel.com \
    --cc=catherine.sullivan@intel.com \
    --cc=davem@davemloft.net \
    --cc=gospo@redhat.com \
    --cc=mitch.a.williams@intel.com \
    --cc=netdev@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.