net/bnxt: support port representor data path
[dpdk.git] / drivers / net / hinic / hinic_pmd_tx.c
index 996e0b2..4d99967 100644 (file)
@@ -313,6 +313,8 @@ static inline struct rte_mbuf *hinic_copy_tx_mbuf(struct hinic_nic_dev *nic_dev,
                mbuf = mbuf->next;
        }
 
+       dst_mbuf->pkt_len = dst_mbuf->data_len;
+
        return dst_mbuf;
 }
 
@@ -453,7 +455,7 @@ static inline bool hinic_is_tso_sge_valid(struct rte_mbuf *mbuf,
                                          *poff_info,
                                          struct hinic_wqe_info *sqe_info)
 {
-       u32 total_len, limit_len, checked_len, left_len;
+       u32 total_len, limit_len, checked_len, left_len, adjust_mss;
        u32 i, first_mss_sges, left_sges;
        struct rte_mbuf *mbuf_head, *mbuf_pre;
 
@@ -463,7 +465,9 @@ static inline bool hinic_is_tso_sge_valid(struct rte_mbuf *mbuf,
        /* tso sge number validation */
        if (unlikely(left_sges >= HINIC_NONTSO_PKT_MAX_SGE)) {
                checked_len = 0;
-               limit_len = mbuf->tso_segsz + poff_info->payload_offset;
+               adjust_mss = mbuf->tso_segsz >= TX_MSS_MIN ?
+                               mbuf->tso_segsz : TX_MSS_MIN;
+               limit_len = adjust_mss + poff_info->payload_offset;
                first_mss_sges = HINIC_NONTSO_PKT_MAX_SGE;
 
                /* each continues 17 mbufs segmust do one check */
@@ -477,7 +481,7 @@ static inline bool hinic_is_tso_sge_valid(struct rte_mbuf *mbuf,
                                mbuf_pre = mbuf;
                                mbuf = mbuf->next;
                                if (total_len >= limit_len) {
-                                       limit_len = mbuf_head->tso_segsz;
+                                       limit_len = adjust_mss;
                                        break;
                                }
                        }