Skip to content

Commit 5e97ce6

Browse files
Avinash DayanandJeff Kirsher
authored andcommitted
i40evf: Alloc queues for ADq on VF
This patch allocates number of queues requested by the user as a part of TC command when ADq is enabled on a VF. In order to be consistent in design with PF implementation of ADq, don't allow to set channels via ethtool from VF when ADq is already enabled. This means the users will not be able to change the number of queues/channels via ethtool for a VF when ADq is ON. In order to be able to use set channels, users will be required to disable ADq first and then try setting the channels again. When ADq is enabled on VF, it goes through a reset during which VSIs and queues are re-configured. Meanwhile if we receive link status message from PF even before the queues are re-configured, just ignore this link up message. Signed-off-by: Avinash Dayanand <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent c27eac4 commit 5e97ce6

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

drivers/net/ethernet/intel/i40evf/i40evf_ethtool.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,12 @@ static int i40evf_set_channels(struct net_device *netdev,
695695
return -EINVAL;
696696
}
697697

698+
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
699+
adapter->num_tc) {
700+
dev_info(&adapter->pdev->dev, "Cannot set channels since ADq is enabled.\n");
701+
return -EINVAL;
702+
}
703+
698704
/* All of these should have already been checked by ethtool before this
699705
* even gets to us, but just to be sure.
700706
*/

drivers/net/ethernet/intel/i40evf/i40evf_main.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,9 @@ static int i40evf_alloc_queues(struct i40evf_adapter *adapter)
11641164
*/
11651165
if (adapter->num_req_queues)
11661166
num_active_queues = adapter->num_req_queues;
1167+
else if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
1168+
adapter->num_tc)
1169+
num_active_queues = adapter->ch_config.total_qps;
11671170
else
11681171
num_active_queues = min_t(int,
11691172
adapter->vsi_res->num_queue_pairs,
@@ -1491,6 +1494,16 @@ int i40evf_init_interrupt_scheme(struct i40evf_adapter *adapter)
14911494
goto err_alloc_q_vectors;
14921495
}
14931496

1497+
/* If we've made it so far while ADq flag being ON, then we haven't
1498+
* bailed out anywhere in middle. And ADq isn't just enabled but actual
1499+
* resources have been allocated in the reset path.
1500+
* Now we can truly claim that ADq is enabled.
1501+
*/
1502+
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
1503+
adapter->num_tc)
1504+
dev_info(&adapter->pdev->dev, "ADq Enabled, %u TCs created",
1505+
adapter->num_tc);
1506+
14941507
dev_info(&adapter->pdev->dev, "Multiqueue %s: Queue pair count = %u",
14951508
(adapter->num_active_queues > 1) ? "Enabled" : "Disabled",
14961509
adapter->num_active_queues);
@@ -3263,6 +3276,7 @@ static void i40evf_remove(struct pci_dev *pdev)
32633276
/* Shut down all the garbage mashers on the detention level */
32643277
adapter->state = __I40EVF_REMOVE;
32653278
adapter->aq_required = 0;
3279+
adapter->flags &= ~I40EVF_FLAG_REINIT_ITR_NEEDED;
32663280
i40evf_request_reset(adapter);
32673281
msleep(50);
32683282
/* If the FW isn't responding, kick it once, but only once. */

0 commit comments

Comments
 (0)