static uint16_t enicpmd_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts)
{
- unsigned int index;
+ uint16_t index;
unsigned int frags;
unsigned int pkt_len;
unsigned int seg_len;
unsigned short vlan_id;
unsigned short ol_flags;
uint8_t last_seg, eop;
+ unsigned int host_tx_descs = 0;
for (index = 0; index < nb_pkts; index++) {
tx_pkt = *tx_pkts++;
return index;
}
}
+
pkt_len = tx_pkt->pkt_len;
vlan_id = tx_pkt->vlan_tci;
ol_flags = tx_pkt->ol_flags;
next_tx_pkt = tx_pkt->next;
seg_len = tx_pkt->data_len;
inc_len += seg_len;
- eop = (pkt_len == inc_len) || (!next_tx_pkt);
- last_seg = eop &&
- (index == ((unsigned int)nb_pkts - 1));
+
+ host_tx_descs++;
+ last_seg = 0;
+ eop = 0;
+ if ((pkt_len == inc_len) || !next_tx_pkt) {
+ eop = 1;
+ /* post if last packet in batch or > thresh */
+ if ((index == (nb_pkts - 1)) ||
+ (host_tx_descs > ENIC_TX_POST_THRESH)) {
+ last_seg = 1;
+ host_tx_descs = 0;
+ }
+ }
enic_send_pkt(enic, wq, tx_pkt, (unsigned short)seg_len,
!frags, eop, last_seg, ol_flags, vlan_id);
tx_pkt = next_tx_pkt;
#define ENIC_NON_TSO_MAX_DESC 16
#define ENIC_DEFAULT_RX_FREE_THRESH 32
+#define ENIC_TX_POST_THRESH (ENIC_MIN_WQ_DESCS / 2)
#define ENIC_SETTING(enic, f) ((enic->config.flags & VENETF_##f) ? 1 : 0)