Skip to content

Commit b8cdc85

Browse files
net/iavf: delay VF reset command
Commit 0f9ec0c ("net/iavf: fix VF reset when using DCF"), introduced a VF-reset adminq call into the reset sequence for iavf. However, that call was very early in the sequence before other adminq commands had been sent. To delay the VF reset, we can put the message sending in the "dev_close" function, right before the adminq is shut down, and thereby guaranteeing that we won't have any subsequent issues with adminq messages. In the process of making this change, we can also use the iavf_vf_reset function from common/iavf, rather than hard-coding the message sending lower-level calls in the net driver. Fixes: e74e1bb ("net/iavf: enable port reset") Fixes: 0f9ec0c ("net/iavf: fix VF reset when using DCF") Cc: [email protected] Cc: [email protected] Signed-off-by: Bruce Richardson <[email protected]> Reviewed-by: David Marchand <[email protected]> Tested-by: Hongbo Li <[email protected]>
1 parent 9195fa2 commit b8cdc85

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

drivers/common/iavf/iavf_prototype.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ STATIC INLINE struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
7979
__rte_internal
8080
void iavf_vf_parse_hw_config(struct iavf_hw *hw,
8181
struct virtchnl_vf_resource *msg);
82+
__rte_internal
8283
enum iavf_status iavf_vf_reset(struct iavf_hw *hw);
8384
__rte_internal
8485
enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,

drivers/common/iavf/version.map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ INTERNAL {
77
iavf_set_mac_type;
88
iavf_shutdown_adminq;
99
iavf_vf_parse_hw_config;
10+
iavf_vf_reset;
1011

1112
local: *;
1213
};

drivers/net/iavf/iavf_ethdev.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2962,6 +2962,7 @@ iavf_dev_close(struct rte_eth_dev *dev)
29622962
if (vf->promisc_unicast_enabled || vf->promisc_multicast_enabled)
29632963
iavf_config_promisc(adapter, false, false);
29642964

2965+
iavf_vf_reset(hw);
29652966
iavf_shutdown_adminq(hw);
29662967
if (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_WB_ON_ITR) {
29672968
/* disable uio intr before callback unregister */
@@ -3041,17 +3042,6 @@ iavf_dev_reset(struct rte_eth_dev *dev)
30413042
struct iavf_adapter *adapter =
30423043
IAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
30433044
struct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);
3044-
struct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
3045-
3046-
if (!vf->in_reset_recovery) {
3047-
ret = iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF,
3048-
IAVF_SUCCESS, NULL, 0, NULL);
3049-
if (ret) {
3050-
PMD_DRV_LOG(ERR, "fail to send cmd VIRTCHNL_OP_RESET_VF");
3051-
return ret;
3052-
}
3053-
}
3054-
30553045
/*
30563046
* Check whether the VF reset has been done and inform application,
30573047
* to avoid calling the virtual channel command, which may cause

0 commit comments

Comments
 (0)