From: Tony Nguyen <anthony.l.nguyen@intel.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: Mateusz Palczewski <mateusz.palczewski@intel.com>,
netdev@vger.kernel.org, anthony.l.nguyen@intel.com,
sassmann@redhat.com,
Grzegorz Szczurek <grzegorzx.szczurek@intel.com>,
Konrad Jankowski <konrad0.jankowski@intel.com>
Subject: [PATCH net 01/10] iavf: Fix return of set the new channel count
Date: Mon, 15 Nov 2021 15:59:25 -0800 [thread overview]
Message-ID: <20211115235934.880882-2-anthony.l.nguyen@intel.com> (raw)
In-Reply-To: <20211115235934.880882-1-anthony.l.nguyen@intel.com>
From: Mateusz Palczewski <mateusz.palczewski@intel.com>
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: 5520deb15326 ("iavf: Enable support for up to 16 queues")
Signed-off-by: Grzegorz Szczurek <grzegorzx.szczurek@intel.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
drivers/net/ethernet/intel/iavf/iavf_ethtool.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
index 5a359a0a20ec..136c801f5584 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_ethtool.c
@@ -1776,6 +1776,7 @@ static int iavf_set_channels(struct net_device *netdev,
{
struct iavf_adapter *adapter = netdev_priv(netdev);
u32 num_req = ch->combined_count;
+ int i;
if ((adapter->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_ADQ) &&
adapter->num_tc) {
@@ -1798,6 +1799,20 @@ static int iavf_set_channels(struct net_device *netdev,
adapter->num_req_queues = num_req;
adapter->flags |= IAVF_FLAG_REINIT_ITR_NEEDED;
iavf_schedule_reset(adapter);
+
+ /* wait for the reset is done */
+ for (i = 0; i < IAVF_RESET_WAIT_COMPLETE_COUNT; i++) {
+ msleep(IAVF_RESET_WAIT_MS);
+ if (adapter->flags & IAVF_FLAG_RESET_PENDING)
+ continue;
+ break;
+ }
+ if (i == IAVF_RESET_WAIT_COMPLETE_COUNT) {
+ adapter->flags &= ~IAVF_FLAG_REINIT_ITR_NEEDED;
+ adapter->num_active_queues = num_req;
+ return -EOPNOTSUPP;
+ }
+
return 0;
}
--
2.31.1
next prev parent reply other threads:[~2021-11-16 0:06 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-15 23:59 [PATCH net 00/10][pull request] Intel Wired LAN Driver Updates 2021-11-15 Tony Nguyen
2021-11-15 23:59 ` Tony Nguyen [this message]
2021-11-16 7:07 ` [PATCH net 01/10] iavf: Fix return of set the new channel count Stefan Assmann
2021-11-15 23:59 ` [PATCH net 02/10] iavf: check for null in iavf_fix_features Tony Nguyen
2021-11-15 23:59 ` [PATCH net 03/10] iavf: free q_vectors before queues in iavf_disable_vf Tony Nguyen
2021-11-15 23:59 ` [PATCH net 04/10] iavf: don't clear a lock we don't hold Tony Nguyen
2021-11-15 23:59 ` [PATCH net 05/10] iavf: Fix failure to exit out from last all-multicast mode Tony Nguyen
2021-11-15 23:59 ` [PATCH net 06/10] iavf: prevent accidental free of filter structure Tony Nguyen
2021-11-16 7:24 ` Stefan Assmann
2021-11-16 20:18 ` Keller, Jacob E
2021-11-17 6:37 ` Stefan Assmann
2021-11-15 23:59 ` [PATCH net 07/10] iavf: validate pointers Tony Nguyen
2021-11-15 23:59 ` [PATCH net 08/10] iavf: Fix for the false positive ASQ/ARQ errors while issuing VF reset Tony Nguyen
2021-11-15 23:59 ` [PATCH net 09/10] iavf: Fix for setting queues to 0 Tony Nguyen
2021-11-15 23:59 ` [PATCH net 10/10] iavf: Restore VLAN filters after link down Tony Nguyen
2021-11-16 13:40 ` [PATCH net 00/10][pull request] Intel Wired LAN Driver Updates 2021-11-15 patchwork-bot+netdevbpf
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=20211115235934.880882-2-anthony.l.nguyen@intel.com \
--to=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=grzegorzx.szczurek@intel.com \
--cc=konrad0.jankowski@intel.com \
--cc=kuba@kernel.org \
--cc=mateusz.palczewski@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox