Skip to content

Commit 4e5e6b5

Browse files
mpalczew96anguy11
authored andcommitted
iavf: Fix return of set the new channel count
Fixed return correct code from set the new channel count. Implemented by check if reset is done in appropriate time. This solution give a extra time to pf for reset vf in case when user want set new channel count for all vfs. Without this patch it is possible to return misleading output code to user and vf reset not to be correctly performed by pf. Fixes: 5520deb ("iavf: Enable support for up to 16 queues") Signed-off-by: Grzegorz Szczurek <[email protected]> Signed-off-by: Mateusz Palczewski <[email protected]> Tested-by: Konrad Jankowski <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent cf4f553 commit 4e5e6b5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

drivers/net/ethernet/intel/iavf/iavf_ethtool.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,6 +1776,7 @@ static int iavf_set_channels(struct net_device *netdev,
17761776
{
17771777
struct iavf_adapter *adapter = netdev_priv(netdev);
17781778
u32 num_req = ch->combined_count;
1779+
int i;
17791780

17801781
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
17811782
adapter->num_tc) {
@@ -1798,6 +1799,20 @@ static int iavf_set_channels(struct net_device *netdev,
17981799
adapter->num_req_queues = num_req;
17991800
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
18001801
iavf_schedule_reset(adapter);
1802+
1803+
/* wait for the reset is done */
1804+
for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
1805+
msleep(IAVF_RESET_WAIT_MS);
1806+
if (adapter->flags & IAVF_FLAG_RESET_PENDING)
1807+
continue;
1808+
break;
1809+
}
1810+
if (i == IAVF_RESET_WAIT_COMPLETE_COUNT) {
1811+
adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
1812+
adapter->num_active_queues = num_req;
1813+
return -EOPNOTSUPP;
1814+
}
1815+
18011816
return 0;
18021817
}
18031818

0 commit comments

Comments
 (0)