[dpdk-dev] [PATCH v1 09/12] net/ice: add queue start and stop for DCF

Ye Xiaolong xiaolong.ye at intel.com
Sun Jun 7 14:28:56 CEST 2020


On 06/05, Ting Xu wrote:
>From: Qi Zhang <qi.z.zhang at intel.com>
>
>Add queue start and stop in DCF. Support queue enable and disable
>through virtual channel. Add support for Rx queue mbufs allocation
>and queue reset.

There is one i40e patch [1] from qiming to correct the queue behavior as "when
one queue fails to start, all following queues start action should be skipped
and previous started queues should be cleaned, and for queue stop case, one
queue stop failure shouldn't skip following queues stop action", I think it
applies to this patch as well, add Qiming for more comments.


[1] https://patches.dpdk.org/patch/70362/

>
>Signed-off-by: Qi Zhang <qi.z.zhang at intel.com>
>---
> drivers/net/ice/ice_dcf.c        |  57 ++++++
> drivers/net/ice/ice_dcf.h        |   3 +-
> drivers/net/ice/ice_dcf_ethdev.c | 309 +++++++++++++++++++++++++++++++
> 3 files changed, 368 insertions(+), 1 deletion(-)
>
>diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c
>index d864ae894..56b8c0d25 100644
>--- a/drivers/net/ice/ice_dcf.c
>+++ b/drivers/net/ice/ice_dcf.c
>@@ -940,3 +940,60 @@ ice_dcf_config_irq_map(struct ice_dcf_hw *hw)
> 	rte_free(map_info);
> 	return err;
> }
>+
>+int
>+ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on)
>+{
>+	struct virtchnl_queue_select queue_select;
>+	struct dcf_virtchnl_cmd args;
>+	int err;
>+
>+	memset(&queue_select, 0, sizeof(queue_select));
>+	queue_select.vsi_id = hw->vsi_res->vsi_id;
>+	if (rx)
>+		queue_select.rx_queues |= 1 << qid;
>+	else
>+		queue_select.tx_queues |= 1 << qid;
>+
>+	memset(&args, 0, sizeof(args));
>+	if (on)
>+		args.v_op = VIRTCHNL_OP_ENABLE_QUEUES;
>+	else
>+		args.v_op = VIRTCHNL_OP_DISABLE_QUEUES;
>+
>+	args.req_msg = (u8 *)&queue_select;
>+	args.req_msglen = sizeof(queue_select);
>+
>+	err = ice_dcf_execute_virtchnl_cmd(hw, &args);
>+	if (err)
>+		PMD_DRV_LOG(ERR, "Failed to execute command of %s",
>+			    on ? "OP_ENABLE_QUEUES" : "OP_DISABLE_QUEUES");
>+	return err;
>+}
>+
>+int
>+ice_dcf_disable_queues(struct ice_dcf_hw *hw)
>+{
>+	struct virtchnl_queue_select queue_select;
>+	struct dcf_virtchnl_cmd args;
>+	int err;
>+
>+	memset(&queue_select, 0, sizeof(queue_select));
>+	queue_select.vsi_id = hw->vsi_res->vsi_id;
>+
>+	queue_select.rx_queues = BIT(hw->eth_dev->data->nb_rx_queues) - 1;
>+	queue_select.tx_queues = BIT(hw->eth_dev->data->nb_tx_queues) - 1;
>+
>+	memset(&args, 0, sizeof(args));
>+	args.v_op = VIRTCHNL_OP_DISABLE_QUEUES;
>+	args.req_msg = (u8 *)&queue_select;
>+	args.req_msglen = sizeof(queue_select);
>+
>+	err = ice_dcf_execute_virtchnl_cmd(hw, &args);
>+	if (err) {
>+		PMD_DRV_LOG(ERR,
>+			    "Failed to execute command of OP_DISABLE_QUEUES");
>+		return err;
>+	}
>+	return 0;

Better to align with above ice_dcf_switch_queue, one 'return err' in the end
is enough.

Thanks,
Xiaolong



More information about the dev mailing list