DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] net/ice: track the DCF state of PF
@ 2021-11-22  9:29 dapengx.yu
  2021-11-24  8:12 ` [PATCH v2] " dapengx.yu
  0 siblings, 1 reply; 4+ messages in thread
From: dapengx.yu @ 2021-11-22  9:29 UTC (permalink / raw)
  To: Qiming Yang, Qi Zhang; +Cc: dev, Dapeng Yu, stable

From: Dapeng Yu <dapengx.yu@intel.com>

When VF is reset, PF will change DCF state from ON to other state, if
flow creation, destroy, or redirect command is sent to DCF at this
time, it will fail.

This patch tracks DCF state and returns try-again error to caller when
DCF state is not ON.

Cc: stable@dpdk.org

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
---
 drivers/net/ice/base/ice_common.c   | 14 +++++++++++---
 drivers/net/ice/ice_dcf.c           | 23 +++++++++++++++++------
 drivers/net/ice/ice_dcf.h           |  3 +++
 drivers/net/ice/ice_dcf_parent.c    |  1 +
 drivers/net/ice/ice_generic_flow.c  |  4 +++-
 drivers/net/ice/ice_switch_filter.c | 22 ++++++++++++++++++----
 6 files changed, 53 insertions(+), 14 deletions(-)

diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c
index ae55bebaa2..1626db263c 100644
--- a/drivers/net/ice/base/ice_common.c
+++ b/drivers/net/ice/base/ice_common.c
@@ -1764,12 +1764,14 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf,
 		u16 buf_size, struct ice_sq_cd *cd)
 {
 	if (hw->aq_send_cmd_fn) {
-		enum ice_status status = ICE_ERR_NOT_READY;
+		enum ice_status status;
 		u16 retval = ICE_AQ_RC_OK;
 
 		ice_acquire_lock(&hw->adminq.sq_lock);
-		if (!hw->aq_send_cmd_fn(hw->aq_send_cmd_param, desc,
-					buf, buf_size)) {
+		status = hw->aq_send_cmd_fn(hw->aq_send_cmd_param, desc, buf,
+					    buf_size);
+		switch (status) {
+		case ICE_SUCCESS:
 			retval = LE16_TO_CPU(desc->retval);
 			/* strip off FW internal code */
 			if (retval)
@@ -1778,6 +1780,12 @@ ice_aq_send_cmd(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf,
 				status = ICE_SUCCESS;
 			else
 				status = ICE_ERR_AQ_ERROR;
+			break;
+		case ICE_ERR_NOT_READY:
+			break;
+		default:
+			status = ICE_ERR_AQ_ERROR;
+			break;
 		}
 
 		hw->adminq.sq_last_status = (enum ice_aq_err)retval;
diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
index cca1d7bf46..63c2e547ff 100644
--- a/drivers/net/ice/ice_dcf.c
+++ b/drivers/net/ice/ice_dcf.c
@@ -269,6 +269,8 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)
 	hw->vsi_id = hw->vsi_res->vsi_id;
 	PMD_DRV_LOG(DEBUG, "VSI ID is %u", hw->vsi_id);
 
+	__atomic_store_n(&hw->state_on, true, __ATOMIC_RELAXED);
+
 	return 0;
 }
 
@@ -476,9 +478,12 @@ ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,
 	int err = 0;
 	int i = 0;
 
+	if (!__atomic_load_n(&hw->state_on, __ATOMIC_RELAXED))
+		return ICE_ERR_NOT_READY;
+
 	if ((buf && !buf_size) || (!buf && buf_size) ||
 	    buf_size > ICE_DCF_AQ_BUF_SZ)
-		return -EINVAL;
+		return ICE_ERR_PARAM;
 
 	desc_cmd.v_op = VIRTCHNL_OP_DCF_CMD_DESC;
 	desc_cmd.req_msglen = sizeof(*desc);
@@ -503,7 +508,7 @@ ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,
 
 	if (ice_dcf_vc_cmd_send(hw, &desc_cmd) ||
 	    ice_dcf_vc_cmd_send(hw, &buff_cmd)) {
-		err = -1;
+		err = ICE_ERR_AQ_ERROR;
 		PMD_DRV_LOG(ERR, "fail to send OP_DCF_CMD_DESC/BUFF");
 		goto ret;
 	}
@@ -516,10 +521,15 @@ ice_dcf_send_aq_cmd(void *dcf_hw, struct ice_aq_desc *desc,
 	} while (i++ < ICE_DCF_ARQ_MAX_RETRIES);
 
 	if (desc_cmd.v_ret != IAVF_SUCCESS || buff_cmd.v_ret != IAVF_SUCCESS) {
-		err = -1;
-		PMD_DRV_LOG(ERR,
-			    "No response (%d times) or return failure (desc: %d / buff: %d)",
-			    i, desc_cmd.v_ret, buff_cmd.v_ret);
+		if (!__atomic_load_n(&hw->state_on, __ATOMIC_RELAXED)) {
+			err = ICE_ERR_NOT_READY;
+			PMD_DRV_LOG(ERR, "DCF is not on temporarily");
+		} else {
+			err = ICE_ERR_AQ_ERROR;
+			PMD_DRV_LOG(ERR,
+				    "No response (%d times) or return failure (desc: %d / buff: %d)",
+				    i, desc_cmd.v_ret, buff_cmd.v_ret);
+		}
 	}
 
 ret:
@@ -594,6 +604,7 @@ ice_dcf_init_hw(struct rte_eth_dev *eth_dev, struct ice_dcf_hw *hw)
 	int ret, size;
 
 	hw->resetting = false;
+	__atomic_store_n(&hw->state_on, false, __ATOMIC_RELAXED);
 
 	hw->avf.hw_addr = pci_dev->mem_resource[0].addr;
 	hw->avf.back = hw;
diff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h
index 6ec766ebda..c3a2bb2b03 100644
--- a/drivers/net/ice/ice_dcf.h
+++ b/drivers/net/ice/ice_dcf.h
@@ -113,6 +113,9 @@ struct ice_dcf_hw {
 	uint32_t link_speed;
 
 	bool resetting;
+
+	/* True if DCF state of the associated PF is on */
+	bool state_on;
 };
 
 int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index 1ff2c47172..84c170e79b 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -258,6 +258,7 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE event : VF%u with VSI num %u",
 			    pf_msg->event_data.vf_vsi_map.vf_id,
 			    pf_msg->event_data.vf_vsi_map.vsi_id);
+		__atomic_store_n(&dcf_hw->state_on, false, __ATOMIC_RELAXED);
 		start_vsi_reset_thread(dcf_hw, true,
 				       pf_msg->event_data.vf_vsi_map.vf_id);
 		break;
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index c673feb7a6..406a0a953f 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -2515,7 +2515,9 @@ ice_flow_flush(struct rte_eth_dev *dev,
 		ret = ice_flow_destroy(dev, p_flow, error);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Failed to flush flows");
-			return -EINVAL;
+			if (ret != -EAGAIN)
+				ret = -EINVAL;
+			return ret;
 		}
 	}
 
diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index ed29c00d77..9e35c2d1ea 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -423,7 +423,11 @@ ice_switch_create(struct ice_adapter *ad,
 
 		flow->rule = filter_conf_ptr;
 	} else {
-		rte_flow_error_set(error, EINVAL,
+		if (ret == ICE_ERR_NOT_READY)
+			ret = -EAGAIN;
+		else
+			ret = -EINVAL;
+		rte_flow_error_set(error, -ret,
 			RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 			"switch filter create flow fail");
 		goto error;
@@ -477,7 +481,11 @@ ice_switch_destroy(struct ice_adapter *ad,
 
 	ret = ice_rem_adv_rule_by_id(hw, &filter_conf_ptr->sw_query_data);
 	if (ret) {
-		rte_flow_error_set(error, EINVAL,
+		if (ret == ICE_ERR_NOT_READY)
+			ret = -EAGAIN;
+		else
+			ret = -EINVAL;
+		rte_flow_error_set(error, -ret,
 			RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 			"fail to destroy switch filter rule");
 		return -rte_errno;
@@ -2023,7 +2031,10 @@ ice_switch_redirect(struct ice_adapter *ad,
 			    rdata->rule_id);
 		filter_conf_ptr->fltr_status =
 			ICE_SW_FLTR_RMV_FAILED_ON_RIDRECT;
-		ret = -EINVAL;
+		if (ret == ICE_ERR_NOT_READY)
+			ret = -EAGAIN;
+		else
+			ret = -EINVAL;
 		goto out;
 	}
 
@@ -2038,7 +2049,10 @@ ice_switch_redirect(struct ice_adapter *ad,
 		PMD_DRV_LOG(ERR, "Failed to replay the rule");
 		filter_conf_ptr->fltr_status =
 			ICE_SW_FLTR_ADD_FAILED_ON_RIDRECT;
-		ret = -EINVAL;
+		if (ret == ICE_ERR_NOT_READY)
+			ret = -EAGAIN;
+		else
+			ret = -EINVAL;
 	} else {
 		filter_conf_ptr->sw_query_data = added_rdata;
 		/* Save VSI number for failure recover */
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] net/ice: track the DCF state of PF
  2021-11-22  9:29 [PATCH] net/ice: track the DCF state of PF dapengx.yu
@ 2021-11-24  8:12 ` dapengx.yu
  2021-11-26  3:17   ` Wang, Haiyue
  0 siblings, 1 reply; 4+ messages in thread
From: dapengx.yu @ 2021-11-24  8:12 UTC (permalink / raw)
  To: Qiming Yang, Qi Zhang; +Cc: dev, haiyue.wang, Dapeng Yu, stable

From: Dapeng Yu <dapengx.yu@intel.com>

When VF is reset, PF will change DCF state from ON to other state, if
flow creation, destroy, or redirect command is sent to DCF at this
time, it will fail.

This patch tracks DCF state and returns try-again error to caller when
DCF state is not ON.

Cc: stable@dpdk.org

Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
---
V2:
* Move DCF state flag to another position
---
 drivers/net/ice/ice_dcf_ethdev.c    | 12 ++++++++
 drivers/net/ice/ice_dcf_ethdev.h    |  1 +
 drivers/net/ice/ice_dcf_parent.c    | 16 +++++++---
 drivers/net/ice/ice_ethdev.h        |  2 ++
 drivers/net/ice/ice_generic_flow.c  |  4 ++-
 drivers/net/ice/ice_switch_filter.c | 45 +++++++++++++++++++++++++++--
 6 files changed, 73 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c
index 28f7f7fb72..0701300c25 100644
--- a/drivers/net/ice/ice_dcf_ethdev.c
+++ b/drivers/net/ice/ice_dcf_ethdev.c
@@ -956,6 +956,13 @@ ice_dcf_link_update(struct rte_eth_dev *dev,
 	return rte_eth_linkstatus_set(dev, &new_link);
 }
 
+bool
+ice_dcf_adminq_need_retry(struct ice_adapter *ad)
+{
+	return ad->hw.dcf_enabled &&
+	       !__atomic_load_n(&ad->dcf_state_on, __ATOMIC_RELAXED);
+}
+
 /* Add UDP tunneling port */
 static int
 ice_dcf_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
@@ -1105,6 +1112,7 @@ static int
 ice_dcf_dev_init(struct rte_eth_dev *eth_dev)
 {
 	struct ice_dcf_adapter *adapter = eth_dev->data->dev_private;
+	struct ice_adapter *parent_adapter = &adapter->parent;
 
 	eth_dev->dev_ops = &ice_dcf_eth_dev_ops;
 	eth_dev->rx_pkt_burst = ice_dcf_recv_pkts;
@@ -1116,9 +1124,13 @@ ice_dcf_dev_init(struct rte_eth_dev *eth_dev)
 	adapter->real_hw.vc_event_msg_cb = ice_dcf_handle_pf_event_msg;
 	if (ice_dcf_init_hw(eth_dev, &adapter->real_hw) != 0) {
 		PMD_INIT_LOG(ERR, "Failed to init DCF hardware");
+		__atomic_store_n(&parent_adapter->dcf_state_on, false,
+				 __ATOMIC_RELAXED);
 		return -1;
 	}
 
+	__atomic_store_n(&parent_adapter->dcf_state_on, true, __ATOMIC_RELAXED);
+
 	if (ice_dcf_init_parent_adapter(eth_dev) != 0) {
 		PMD_INIT_LOG(ERR, "Failed to init DCF parent adapter");
 		ice_dcf_uninit_hw(eth_dev, &adapter->real_hw);
diff --git a/drivers/net/ice/ice_dcf_ethdev.h b/drivers/net/ice/ice_dcf_ethdev.h
index 8510e37119..11a1305038 100644
--- a/drivers/net/ice/ice_dcf_ethdev.h
+++ b/drivers/net/ice/ice_dcf_ethdev.h
@@ -64,5 +64,6 @@ int ice_dcf_vf_repr_init(struct rte_eth_dev *vf_rep_eth_dev, void *init_param);
 int ice_dcf_vf_repr_uninit(struct rte_eth_dev *vf_rep_eth_dev);
 int ice_dcf_vf_repr_init_vlan(struct rte_eth_dev *vf_rep_eth_dev);
 void ice_dcf_vf_repr_stop_all(struct ice_dcf_adapter *dcf_adapter);
+bool ice_dcf_adminq_need_retry(struct ice_adapter *ad);
 
 #endif /* _ICE_DCF_ETHDEV_H_ */
diff --git a/drivers/net/ice/ice_dcf_parent.c b/drivers/net/ice/ice_dcf_parent.c
index 1ff2c47172..0c8c2ed6c7 100644
--- a/drivers/net/ice/ice_dcf_parent.c
+++ b/drivers/net/ice/ice_dcf_parent.c
@@ -119,7 +119,9 @@ ice_dcf_vsi_update_service_handler(void *param)
 {
 	struct ice_dcf_reset_event_param *reset_param = param;
 	struct ice_dcf_hw *hw = reset_param->dcf_hw;
-	struct ice_dcf_adapter *adapter;
+	struct ice_dcf_adapter *adapter =
+		container_of(hw, struct ice_dcf_adapter, real_hw);
+	struct ice_adapter *parent_adapter = &adapter->parent;
 
 	pthread_detach(pthread_self());
 
@@ -127,11 +129,12 @@ ice_dcf_vsi_update_service_handler(void *param)
 
 	rte_spinlock_lock(&vsi_update_lock);
 
-	adapter = container_of(hw, struct ice_dcf_adapter, real_hw);
-
-	if (!ice_dcf_handle_vsi_update_event(hw))
+	if (!ice_dcf_handle_vsi_update_event(hw)) {
+		__atomic_store_n(&parent_adapter->dcf_state_on, true,
+				 __ATOMIC_RELAXED);
 		ice_dcf_update_vf_vsi_map(&adapter->parent.hw,
 					  hw->num_vfs, hw->vf_vsi_map);
+	}
 
 	if (reset_param->vfr && adapter->repr_infos) {
 		struct rte_eth_dev *vf_rep_eth_dev =
@@ -224,6 +227,9 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,
 			    uint8_t *msg, uint16_t msglen)
 {
 	struct virtchnl_pf_event *pf_msg = (struct virtchnl_pf_event *)msg;
+	struct ice_dcf_adapter *adapter =
+		container_of(dcf_hw, struct ice_dcf_adapter, real_hw);
+	struct ice_adapter *parent_adapter = &adapter->parent;
 
 	if (msglen < sizeof(struct virtchnl_pf_event)) {
 		PMD_DRV_LOG(DEBUG, "Invalid event message length : %u", msglen);
@@ -258,6 +264,8 @@ ice_dcf_handle_pf_event_msg(struct ice_dcf_hw *dcf_hw,
 		PMD_DRV_LOG(DEBUG, "VIRTCHNL_EVENT_DCF_VSI_MAP_UPDATE event : VF%u with VSI num %u",
 			    pf_msg->event_data.vf_vsi_map.vf_id,
 			    pf_msg->event_data.vf_vsi_map.vsi_id);
+		__atomic_store_n(&parent_adapter->dcf_state_on, false,
+				 __ATOMIC_RELAXED);
 		start_vsi_reset_thread(dcf_hw, true,
 				       pf_msg->event_data.vf_vsi_map.vf_id);
 		break;
diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h
index 11f7eb4352..38b93a953d 100644
--- a/drivers/net/ice/ice_ethdev.h
+++ b/drivers/net/ice/ice_ethdev.h
@@ -531,6 +531,8 @@ struct ice_adapter {
 	uint64_t time_hw;
 	struct ice_fdir_prof_info fdir_prof_info[ICE_MAX_PTGS];
 	struct ice_rss_prof_info rss_prof_info[ICE_MAX_PTGS];
+	/* True if DCF state of the associated PF is on */
+	bool dcf_state_on;
 #ifdef RTE_ARCH_X86
 	bool rx_use_avx2;
 	bool rx_use_avx512;
diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c
index c673feb7a6..406a0a953f 100644
--- a/drivers/net/ice/ice_generic_flow.c
+++ b/drivers/net/ice/ice_generic_flow.c
@@ -2515,7 +2515,9 @@ ice_flow_flush(struct rte_eth_dev *dev,
 		ret = ice_flow_destroy(dev, p_flow, error);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Failed to flush flows");
-			return -EINVAL;
+			if (ret != -EAGAIN)
+				ret = -EINVAL;
+			return ret;
 		}
 	}
 
diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index ed29c00d77..bd805d9606 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -400,6 +400,14 @@ ice_switch_create(struct ice_adapter *ad,
 			"lookup list should not be NULL");
 		goto error;
 	}
+
+	if (ice_dcf_adminq_need_retry(ad)) {
+		rte_flow_error_set(error, EAGAIN,
+			RTE_FLOW_ERROR_TYPE_ITEM, NULL,
+			"DCF is not on");
+		goto error;
+	}
+
 	ret = ice_add_adv_rule(hw, list, lkups_cnt, rule_info, &rule_added);
 	if (!ret) {
 		filter_conf_ptr = rte_zmalloc("ice_switch_filter",
@@ -423,7 +431,12 @@ ice_switch_create(struct ice_adapter *ad,
 
 		flow->rule = filter_conf_ptr;
 	} else {
-		rte_flow_error_set(error, EINVAL,
+		if (ice_dcf_adminq_need_retry(ad))
+			ret = -EAGAIN;
+		else
+			ret = -EINVAL;
+
+		rte_flow_error_set(error, -ret,
 			RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 			"switch filter create flow fail");
 		goto error;
@@ -475,9 +488,21 @@ ice_switch_destroy(struct ice_adapter *ad,
 		return -rte_errno;
 	}
 
+	if (ice_dcf_adminq_need_retry(ad)) {
+		rte_flow_error_set(error, EAGAIN,
+			RTE_FLOW_ERROR_TYPE_ITEM, NULL,
+			"DCF is not on");
+		return -rte_errno;
+	}
+
 	ret = ice_rem_adv_rule_by_id(hw, &filter_conf_ptr->sw_query_data);
 	if (ret) {
-		rte_flow_error_set(error, EINVAL,
+		if (ice_dcf_adminq_need_retry(ad))
+			ret = -EAGAIN;
+		else
+			ret = -EINVAL;
+
+		rte_flow_error_set(error, -ret,
 			RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
 			"fail to destroy switch filter rule");
 		return -rte_errno;
@@ -2016,6 +2041,12 @@ ice_switch_redirect(struct ice_adapter *ad,
 	}
 
 rmv_rule:
+	if (ice_dcf_adminq_need_retry(ad)) {
+		PMD_DRV_LOG(WARNING, "DCF is not on");
+		ret = -EAGAIN;
+		goto out;
+	}
+
 	/* Remove the old rule */
 	ret = ice_rem_adv_rule(hw, lkups_ref, lkups_cnt, &rinfo);
 	if (ret) {
@@ -2028,6 +2059,12 @@ ice_switch_redirect(struct ice_adapter *ad,
 	}
 
 add_rule:
+	if (ice_dcf_adminq_need_retry(ad)) {
+		PMD_DRV_LOG(WARNING, "DCF is not on");
+		ret = -EAGAIN;
+		goto out;
+	}
+
 	/* Update VSI context */
 	hw->vsi_ctx[rd->vsi_handle]->vsi_num = rd->new_vsi_num;
 
@@ -2047,6 +2084,10 @@ ice_switch_redirect(struct ice_adapter *ad,
 	}
 
 out:
+	if (ret == -EINVAL)
+		if (ice_dcf_adminq_need_retry(ad))
+			ret = -EAGAIN;
+
 	ice_free(hw, lkups_dp);
 	return ret;
 }
-- 
2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] net/ice: track the DCF state of PF
  2021-11-24  8:12 ` [PATCH v2] " dapengx.yu
@ 2021-11-26  3:17   ` Wang, Haiyue
  2022-01-02  8:29     ` Zhang, Qi Z
  0 siblings, 1 reply; 4+ messages in thread
From: Wang, Haiyue @ 2021-11-26  3:17 UTC (permalink / raw)
  To: Yu, DapengX, Yang, Qiming, Zhang, Qi Z; +Cc: dev, stable

> -----Original Message-----
> From: Yu, DapengX <dapengx.yu@intel.com>
> Sent: Wednesday, November 24, 2021 16:12
> To: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; Wang, Haiyue <haiyue.wang@intel.com>; Yu, DapengX <dapengx.yu@intel.com>;
> stable@dpdk.org
> Subject: [PATCH v2] net/ice: track the DCF state of PF
> 
> From: Dapeng Yu <dapengx.yu@intel.com>
> 
> When VF is reset, PF will change DCF state from ON to other state, if
> flow creation, destroy, or redirect command is sent to DCF at this
> time, it will fail.
> 
> This patch tracks DCF state and returns try-again error to caller when
> DCF state is not ON.
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> ---
> V2:
> * Move DCF state flag to another position
> ---
>  drivers/net/ice/ice_dcf_ethdev.c    | 12 ++++++++
>  drivers/net/ice/ice_dcf_ethdev.h    |  1 +
>  drivers/net/ice/ice_dcf_parent.c    | 16 +++++++---
>  drivers/net/ice/ice_ethdev.h        |  2 ++
>  drivers/net/ice/ice_generic_flow.c  |  4 ++-
>  drivers/net/ice/ice_switch_filter.c | 45 +++++++++++++++++++++++++++--
>  6 files changed, 73 insertions(+), 7 deletions(-)
> 

LGTM,

Acked-by: Haiyue Wang <haiyue.wang@intel.com>

> --
> 2.27.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH v2] net/ice: track the DCF state of PF
  2021-11-26  3:17   ` Wang, Haiyue
@ 2022-01-02  8:29     ` Zhang, Qi Z
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang, Qi Z @ 2022-01-02  8:29 UTC (permalink / raw)
  To: Wang, Haiyue, Yu, DapengX, Yang, Qiming; +Cc: dev, stable



> -----Original Message-----
> From: Wang, Haiyue <haiyue.wang@intel.com>
> Sent: Friday, November 26, 2021 11:17 AM
> To: Yu, DapengX <dapengx.yu@intel.com>; Yang, Qiming
> <qiming.yang@intel.com>; Zhang, Qi Z <qi.z.zhang@intel.com>
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: RE: [PATCH v2] net/ice: track the DCF state of PF
> 
> > -----Original Message-----
> > From: Yu, DapengX <dapengx.yu@intel.com>
> > Sent: Wednesday, November 24, 2021 16:12
> > To: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>
> > Cc: dev@dpdk.org; Wang, Haiyue <haiyue.wang@intel.com>; Yu, DapengX
> > <dapengx.yu@intel.com>; stable@dpdk.org
> > Subject: [PATCH v2] net/ice: track the DCF state of PF
> >
> > From: Dapeng Yu <dapengx.yu@intel.com>
> >
> > When VF is reset, PF will change DCF state from ON to other state, if
> > flow creation, destroy, or redirect command is sent to DCF at this
> > time, it will fail.
> >
> > This patch tracks DCF state and returns try-again error to caller when
> > DCF state is not ON.
> >
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Dapeng Yu <dapengx.yu@intel.com>
> > ---
> > V2:
> > * Move DCF state flag to another position
> > ---
> >  drivers/net/ice/ice_dcf_ethdev.c    | 12 ++++++++
> >  drivers/net/ice/ice_dcf_ethdev.h    |  1 +
> >  drivers/net/ice/ice_dcf_parent.c    | 16 +++++++---
> >  drivers/net/ice/ice_ethdev.h        |  2 ++
> >  drivers/net/ice/ice_generic_flow.c  |  4 ++-
> > drivers/net/ice/ice_switch_filter.c | 45 +++++++++++++++++++++++++++--
> >  6 files changed, 73 insertions(+), 7 deletions(-)
> >
> 
> LGTM,
> 
> Acked-by: Haiyue Wang <haiyue.wang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
> 
> > --
> > 2.27.0
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-02  8:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-22  9:29 [PATCH] net/ice: track the DCF state of PF dapengx.yu
2021-11-24  8:12 ` [PATCH v2] " dapengx.yu
2021-11-26  3:17   ` Wang, Haiyue
2022-01-02  8:29     ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).