Commit 9ebeea0c authored by Jian Shen's avatar Jian Shen Committed by Hao Chen
Browse files

net: hns3: add support to query tc map info of VF queues

driver inclusion
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/IALRBN


CVE: NA

--------------------------------------------------------

Modified hclge_tm_get_q_to_tc to support the query of
TC map info of VF queues.

Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarHao Lan <lanhao@huawei.com>
parent 3c914c6a
Loading
Loading
Loading
Loading
+17 −1
Original line number Diff line number Diff line
@@ -2039,7 +2039,23 @@ int hclge_tm_get_q_to_tc(struct hclge_dev *hdev, u16 q_id, u8 *tc_id)

	tc = (struct hclge_tqp_tx_queue_tc_cmd *)desc.data;
	hclge_cmd_setup_basic_desc(&desc, HCLGE_OPC_TQP_TX_QUEUE_TC, true);
	if (hnae3_ae_dev_vf_multi_tcs_supported(hdev)) {
		struct hnae3_queue *tqp = &hdev->htqp[q_id].q;
		struct hclge_vport *vport;

		if (!hdev->htqp[q_id].alloced) {
			dev_err(&hdev->pdev->dev,
				"q_id %u is not alloced\n", q_id);
			return -EINVAL;
		}
		vport = container_of(tqp->handle, struct hclge_vport, nic);
		tc->queue_id = cpu_to_le16(tqp->tqp_index);
		tc->func_id = (u8)vport->vport_id;
	} else {
		tc->queue_id = cpu_to_le16(q_id);
		tc->func_id = 0;
	}

	ret = hclge_cmd_send(&hdev->hw, &desc, 1);
	if (ret) {
		dev_err(&hdev->pdev->dev,
+3 −2
Original line number Diff line number Diff line
@@ -65,9 +65,10 @@ struct hclge_nq_to_qs_link_cmd {

struct hclge_tqp_tx_queue_tc_cmd {
	__le16 queue_id;
	__le16 rsvd;
	u8 func_id;
	u8 rsvd1;
	u8 tc_id;
	u8 rev[3];
	u8 rsvd2[3];
};

struct hclge_pg_weight_cmd {