|
|
@@ -2974,6 +2974,28 @@ static void hns3_init_ring_hw(struct hns3_enet_ring *ring)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+static void hns3_init_tx_ring_tc(struct hns3_nic_priv *priv)
|
|
|
+{
|
|
|
+ struct hnae3_knic_private_info *kinfo = &priv->ae_handle->kinfo;
|
|
|
+ int i;
|
|
|
+
|
|
|
+ for (i = 0; i < HNAE3_MAX_TC; i++) {
|
|
|
+ struct hnae3_tc_info *tc_info = &kinfo->tc_info[i];
|
|
|
+ int j;
|
|
|
+
|
|
|
+ if (!tc_info->enable)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ for (j = 0; j < tc_info->tqp_count; j++) {
|
|
|
+ struct hnae3_queue *q;
|
|
|
+
|
|
|
+ q = priv->ring_data[tc_info->tqp_offset + j].ring->tqp;
|
|
|
+ hns3_write_dev(q, HNS3_RING_TX_RING_TC_REG,
|
|
|
+ tc_info->tc);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
int hns3_init_all_ring(struct hns3_nic_priv *priv)
|
|
|
{
|
|
|
struct hnae3_handle *h = priv->ae_handle;
|
|
|
@@ -3385,6 +3407,8 @@ int hns3_nic_reset_all_ring(struct hnae3_handle *h)
|
|
|
rx_ring->next_to_use = 0;
|
|
|
}
|
|
|
|
|
|
+ hns3_init_tx_ring_tc(priv);
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
|