aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorAnjali Singhai Jain <anjali.singhai@intel.com>2015-02-24 01:58:44 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2015-03-03 04:07:25 -0500
commit9a3bd2f1e38e5f668200b5e720b4d87023f394d2 (patch)
tree38455240bf7d314e4482633d9043aaf11f9b0ff3 /drivers/net/ethernet
parent8f400824345969d18f8d10a0c5b681aa04211842 (diff)
i40e: Enable more than 64 qps for the Main VSI
When running in a single TC mode the HW can be configured to enable more than max RSS qps for the Main VSI. This patch makes it possible to enable as many as num_online_cpus(). ethtool -L can still be used to reconfigure number of qps to a smaller value. Change-ID: I3e2df085276982603d86dfd79477c0ada8d30b8f Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e.h1
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_ethtool.c4
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_main.c25
3 files changed, 21 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h
index 5fa4eab779d2..e4e963af28b5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e.h
+++ b/drivers/net/ethernet/intel/i40e/i40e.h
@@ -488,6 +488,7 @@ struct i40e_vsi {
488 488
489 u16 base_queue; /* vsi's first queue in hw array */ 489 u16 base_queue; /* vsi's first queue in hw array */
490 u16 alloc_queue_pairs; /* Allocated Tx/Rx queues */ 490 u16 alloc_queue_pairs; /* Allocated Tx/Rx queues */
491 u16 req_queue_pairs; /* User requested queue pairs */
491 u16 num_queue_pairs; /* Used tx and rx pairs */ 492 u16 num_queue_pairs; /* Used tx and rx pairs */
492 u16 num_desc; 493 u16 num_desc;
493 enum i40e_vsi_type type; /* VSI type, e.g., LAN, FCoE, etc */ 494 enum i40e_vsi_type type; /* VSI type, e.g., LAN, FCoE, etc */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index 8a9d6a256305..7413b0e429c8 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2348,10 +2348,6 @@ static int i40e_set_channels(struct net_device *dev,
2348 /* update feature limits from largest to smallest supported values */ 2348 /* update feature limits from largest to smallest supported values */
2349 /* TODO: Flow director limit, DCB etc */ 2349 /* TODO: Flow director limit, DCB etc */
2350 2350
2351 /* cap RSS limit */
2352 if (count > pf->rss_size_max)
2353 count = pf->rss_size_max;
2354
2355 /* use rss_reconfig to rebuild with new queue count and update traffic 2351 /* use rss_reconfig to rebuild with new queue count and update traffic
2356 * class queue mapping 2352 * class queue mapping
2357 */ 2353 */
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 2757926f7805..849fec7fa7db 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -1566,6 +1566,12 @@ static void i40e_vsi_setup_queue_map(struct i40e_vsi *vsi,
1566 1566
1567 /* Set actual Tx/Rx queue pairs */ 1567 /* Set actual Tx/Rx queue pairs */
1568 vsi->num_queue_pairs = offset; 1568 vsi->num_queue_pairs = offset;
1569 if ((vsi->type == I40E_VSI_MAIN) && (numtc == 1)) {
1570 if (vsi->req_queue_pairs > 0)
1571 vsi->num_queue_pairs = vsi->req_queue_pairs;
1572 else
1573 vsi->num_queue_pairs = pf->num_lan_msix;
1574 }
1569 1575
1570 /* Scheduler section valid can only be set for ADD VSI */ 1576 /* Scheduler section valid can only be set for ADD VSI */
1571 if (is_add) { 1577 if (is_add) {
@@ -6921,7 +6927,8 @@ static int i40e_init_msix(struct i40e_pf *pf)
6921 * If we can't get what we want, we'll simplify to nearly nothing 6927 * If we can't get what we want, we'll simplify to nearly nothing
6922 * and try again. If that still fails, we punt. 6928 * and try again. If that still fails, we punt.
6923 */ 6929 */
6924 pf->num_lan_msix = pf->num_lan_qps - (pf->rss_size_max - pf->rss_size); 6930 pf->num_lan_msix = min_t(int, num_online_cpus(),
6931 hw->func_caps.num_msix_vectors);
6925 pf->num_vmdq_msix = pf->num_vmdq_qps; 6932 pf->num_vmdq_msix = pf->num_vmdq_qps;
6926 other_vecs = 1; 6933 other_vecs = 1;
6927 other_vecs += (pf->num_vmdq_vsis * pf->num_vmdq_msix); 6934 other_vecs += (pf->num_vmdq_vsis * pf->num_vmdq_msix);
@@ -7251,15 +7258,19 @@ static int i40e_config_rss(struct i40e_pf *pf)
7251 **/ 7258 **/
7252int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count) 7259int i40e_reconfig_rss_queues(struct i40e_pf *pf, int queue_count)
7253{ 7260{
7261 struct i40e_vsi *vsi = pf->vsi[pf->lan_vsi];
7262 int new_rss_size;
7263
7254 if (!(pf->flags & I40E_FLAG_RSS_ENABLED)) 7264 if (!(pf->flags & I40E_FLAG_RSS_ENABLED))
7255 return 0; 7265 return 0;
7256 7266
7257 queue_count = min_t(int, queue_count, pf->rss_size_max); 7267 new_rss_size = min_t(int, queue_count, pf->rss_size_max);
7258 7268
7259 if (queue_count != pf->rss_size) { 7269 if (queue_count != vsi->num_queue_pairs) {
7270 vsi->req_queue_pairs = queue_count;
7260 i40e_prep_for_reset(pf); 7271 i40e_prep_for_reset(pf);
7261 7272
7262 pf->rss_size = queue_count; 7273 pf->rss_size = new_rss_size;
7263 7274
7264 i40e_reset_and_rebuild(pf, true); 7275 i40e_reset_and_rebuild(pf, true);
7265 i40e_config_rss(pf); 7276 i40e_config_rss(pf);
@@ -9258,7 +9269,11 @@ static void i40e_determine_queue_usage(struct i40e_pf *pf)
9258 pf->flags &= ~I40E_FLAG_DCB_CAPABLE; 9269 pf->flags &= ~I40E_FLAG_DCB_CAPABLE;
9259 dev_info(&pf->pdev->dev, "not enough queues for DCB. DCB is disabled.\n"); 9270 dev_info(&pf->pdev->dev, "not enough queues for DCB. DCB is disabled.\n");
9260 } 9271 }
9261 pf->num_lan_qps = pf->rss_size_max; 9272 pf->num_lan_qps = max_t(int, pf->rss_size_max,
9273 num_online_cpus());
9274 pf->num_lan_qps = min_t(int, pf->num_lan_qps,
9275 pf->hw.func_caps.num_tx_qp);
9276
9262 queues_left -= pf->num_lan_qps; 9277 queues_left -= pf->num_lan_qps;
9263 } 9278 }
9264 9279