1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2017 Huawei Technologies Co., Ltd
5 #ifndef _HINIC_PMD_TX_H_
6 #define _HINIC_PMD_TX_H_
8 #define HINIC_DEFAULT_TX_FREE_THRESH 32
9 #define HINIC_MAX_TX_FREE_BULK 64
11 #define HINIC_GET_WQ_HEAD(txq) ((txq)->wq->queue_buf_vaddr)
13 #define HINIC_GET_WQ_TAIL(txq) \
14 ((txq)->wq->queue_buf_vaddr + (txq)->wq->wq_buf_size)
16 #define HINIC_TX_CKSUM_OFFLOAD_MASK ( \
21 PKT_TX_OUTER_IP_CKSUM | \
29 struct hinic_tx_offload_info {
48 struct hinic_wqe_info {
57 struct hinic_sq_ctrl {
62 struct hinic_sq_task {
71 struct hinic_sq_bufdesc {
77 /* sq wqe control section */
78 struct hinic_sq_ctrl ctrl;
80 /* sq task control section */
81 struct hinic_sq_task task;
83 /* sq sge section start address, 1~127 sges */
84 struct hinic_sq_bufdesc buf_descs[0];
87 struct hinic_txq_stats {
97 struct hinic_tx_info {
98 struct rte_mbuf *mbuf;
100 struct rte_mbuf *cpy_mbuf;
105 struct hinic_nic_dev *nic_dev;
108 volatile u16 *cons_idx_addr;
109 struct hinic_tx_info *tx_info;
118 struct hinic_txq_stats txq_stats;
123 int hinic_setup_tx_resources(struct hinic_txq *txq);
125 void hinic_free_all_tx_resources(struct rte_eth_dev *eth_dev);
127 void hinic_free_all_tx_mbuf(struct rte_eth_dev *eth_dev);
129 void hinic_free_tx_resources(struct hinic_txq *txq);
131 u16 hinic_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, u16 nb_pkts);
133 void hinic_free_all_tx_skbs(struct hinic_txq *txq);
135 void hinic_txq_get_stats(struct hinic_txq *txq, struct hinic_txq_stats *stats);
137 void hinic_txq_stats_reset(struct hinic_txq *txq);
139 int hinic_create_sq(struct hinic_hwdev *hwdev, u16 q_id, u16 sq_depth);
141 void hinic_destroy_sq(struct hinic_hwdev *hwdev, u16 q_id);
143 #endif /* _HINIC_PMD_TX_H_ */