- if (ARK_TX_PAD_TO_60) {
- if (unlikely(rte_pktmbuf_pkt_len(mbuf) < 60)) {
- /* this packet even if it is small can be split,
- * be sure to add to the end mbuf
+ if (min_pkt_len &&
+ unlikely(rte_pktmbuf_pkt_len(mbuf) < min_pkt_len)) {
+ /* this packet even if it is small can be split,
+ * be sure to add to the end mbuf
+ */
+ uint16_t to_add = min_pkt_len -
+ rte_pktmbuf_pkt_len(mbuf);
+ char *appended =
+ rte_pktmbuf_append(mbuf, to_add);
+
+ if (appended == 0) {
+ /* This packet is in error,
+ * we cannot send it so just
+ * count it and delete it.