struct tx_bd_long_hi *txbd1 = NULL;
uint32_t vlan_tag_flags, cfa_action;
bool long_bd = false;
- uint16_t last_prod = 0;
struct rte_mbuf *m_seg;
struct bnxt_sw_tx_bd *tx_buf;
static const uint32_t lhint_arr[4] = {
tx_buf = &txr->tx_buf_ring[txr->tx_prod];
tx_buf->mbuf = tx_pkt;
tx_buf->nr_bds = long_bd + tx_pkt->nb_segs;
- last_prod = (txr->tx_prod + tx_buf->nr_bds - 1) &
- txr->tx_ring_struct->ring_mask;
if (unlikely(bnxt_tx_avail(txr) < tx_buf->nr_bds))
return -ENOMEM;
txbd1->cfa_action = cfa_action;
if (tx_pkt->ol_flags & PKT_TX_TCP_SEG) {
+ uint16_t hdr_size;
+
/* TSO */
txbd1->lflags |= TX_BD_LONG_LFLAGS_LSO;
- txbd1->hdr_size = tx_pkt->l2_len + tx_pkt->l3_len +
+ hdr_size = tx_pkt->l2_len + tx_pkt->l3_len +
tx_pkt->l4_len + tx_pkt->outer_l2_len +
tx_pkt->outer_l3_len;
+ /* The hdr_size is multiple of 16bit units not 8bit.
+ * Hence divide by 2.
+ */
+ txbd1->hdr_size = hdr_size >> 1;
txbd1->mss = tx_pkt->tso_segsz;
} else if ((tx_pkt->ol_flags & PKT_TX_OIP_IIP_TCP_UDP_CKSUM) ==
m_seg = tx_pkt->next;
/* i is set at the end of the if(long_bd) block */
- while (txr->tx_prod != last_prod) {
+ while (m_seg) {
txr->tx_prod = RING_NEXT(txr->tx_ring_struct, txr->tx_prod);
tx_buf = &txr->tx_buf_ring[txr->tx_prod];
}
txbd->flags_type |= TX_BD_LONG_FLAGS_PACKET_END;
- if (txbd1)
- txbd1->lflags = rte_cpu_to_le_32(txbd1->lflags);
txr->tx_prod = RING_NEXT(txr->tx_ring_struct, txr->tx_prod);