+ /* threshold for free tx buffer if available BDs less than this value */
+ uint16_t tx_free_thresh;
+
+ /*
+ * The minimum length of the packet supported by hardware in the Tx
+ * direction.
+ */
+ uint8_t min_tx_pkt_len;
+
+ uint8_t max_non_tso_bd_num; /* max BD number of one non-TSO packet */
+
+ /*
+ * tso mode.
+ * value range:
+ * HNS3_TSO_SW_CAL_PSEUDO_H_CSUM/HNS3_TSO_HW_CAL_PSEUDO_H_CSUM
+ *
+ * - HNS3_TSO_SW_CAL_PSEUDO_H_CSUM
+ * In this mode, because of the hardware constraint, network driver
+ * software need erase the L4 len value of the TCP pseudo header
+ * and recalculate the TCP pseudo header checksum of packets that
+ * need TSO.
+ *
+ * - HNS3_TSO_HW_CAL_PSEUDO_H_CSUM
+ * In this mode, hardware support recalculate the TCP pseudo header
+ * checksum of packets that need TSO, so network driver software
+ * not need to recalculate it.
+ */
+ uint16_t tso_mode:1;
+ /*
+ * udp checksum mode.
+ * value range:
+ * HNS3_SPECIAL_PORT_HW_CKSUM_MODE/HNS3_SPECIAL_PORT_SW_CKSUM_MODE
+ *
+ * - HNS3_SPECIAL_PORT_SW_CKSUM_MODE
+ * In this mode, HW can not do checksum for special UDP port like
+ * 4789, 4790, 6081 for non-tunnel UDP packets and UDP tunnel
+ * packets without the PKT_TX_TUNEL_MASK in the mbuf. So, PMD need
+ * do the checksum for these packets to avoid a checksum error.
+ *
+ * - HNS3_SPECIAL_PORT_HW_CKSUM_MODE
+ * In this mode, HW does not have the preceding problems and can
+ * directly calculate the checksum of these UDP packets.
+ */
+ uint16_t udp_cksum_mode:1;
+
+ uint16_t simple_bd_enable:1;
+ uint16_t tx_push_enable:1; /* check whether the tx push is enabled */
+ /*
+ * Indicate whether add the vlan_tci of the mbuf to the inner VLAN field
+ * of Tx BD. Because the outer VLAN will always be the PVID when the
+ * PVID is set and for some version of hardware network engine whose
+ * vlan mode is HNS3_SW_SHIFT_AND_DISCARD_MODE, such as kunpeng 920, the
+ * PVID will overwrite the outer VLAN field of Tx BD. For the hardware
+ * network engine whose vlan mode is HNS3_HW_SHIFT_AND_DISCARD_MODE,
+ * such as kunpeng 930, if the PVID is set, the hardware will shift the
+ * VLAN field automatically. So, PMD driver does not need to do
+ * PVID-related operations in Tx. And pvid_sw_shift_en will be false at
+ * this point.
+ */
+ uint16_t pvid_sw_shift_en:1;
+
+ /*
+ * For better performance in tx datapath, releasing mbuf in batches is
+ * required.
+ * Only checking the VLD bit of the last descriptor in a batch of the
+ * thresh descriptors does not mean that these descriptors are all sent
+ * by hardware successfully. So we need to check that the VLD bits of
+ * all descriptors are cleared. and then free all mbufs in the batch.
+ * - tx_rs_thresh
+ * Number of mbufs released at a time.
+ *
+ * - free
+ * Tx mbuf free array used for preserving temporarily address of mbuf
+ * released back to mempool, when releasing mbuf in batches.
+ */
+ uint16_t tx_rs_thresh;
+ struct rte_mbuf **free;
+
+ struct hns3_tx_basic_stats basic_stats;
+ struct hns3_tx_dfx_stats dfx_stats;
+
+
+ /*
+ * The following fields are not accessed in the I/O path, so they are
+ * placed at the end.
+ */
+ void *io_base;
+ struct hns3_adapter *hns;
+ uint64_t tx_ring_phys_addr; /* TX ring DMA address */
+ const struct rte_memzone *mz;
+
+ uint16_t port_id;
+ uint16_t queue_id;
+