From: Subrahmanyam Nilla Date: Fri, 9 Nov 2018 05:50:55 +0000 (+0000) Subject: net/thunderx: fix Tx desc corruption in scatter-gather mode X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=823ebfc219f3fa53361afc7ce663f72464bfb3ff;p=dpdk.git net/thunderx: fix Tx desc corruption in scatter-gather mode For performance reasons, word1 of send_hdr_s sub descriptor was not cleared assuming it is always having default value of zero since it comes from fixed offsets of SQ buffer. This is causing issues in case of SG mode because, the size of send command might change and hence the word1 of send_hdr_s is not always at fixed offsets of the SQ buffer and hence not having default value of zero. This fixes the issue by clearing the word1 in case of SG mode for every packet. Fixes: 1c421f18e095 ("net/thunderx: add single and multi-segment Tx") Cc: stable@dpdk.org Signed-off-by: Subrahmanyam Nilla Signed-off-by: Nithin Dabilpuram Acked-by: Jerin Jacob --- diff --git a/drivers/net/thunderx/nicvf_rxtx.c b/drivers/net/thunderx/nicvf_rxtx.c index 247c356854..1c42874318 100644 --- a/drivers/net/thunderx/nicvf_rxtx.c +++ b/drivers/net/thunderx/nicvf_rxtx.c @@ -61,6 +61,14 @@ fill_sq_desc_header(union sq_entry_t *entry, struct rte_mbuf *pkt) entry->buff[0] = sqe.buff[0]; } +static inline void __hot +fill_sq_desc_header_zero_w1(union sq_entry_t *entry, + struct rte_mbuf *pkt) +{ + fill_sq_desc_header(entry, pkt); + entry->buff[1] = 0ULL; +} + void __hot nicvf_single_pool_free_xmited_buffers(struct nicvf_txq *sq) { @@ -204,7 +212,7 @@ nicvf_xmit_pkts_multiseg(void *tx_queue, struct rte_mbuf **tx_pkts, used_bufs += nb_segs; txbuffs[tail] = NULL; - fill_sq_desc_header(desc_ptr + tail, pkt); + fill_sq_desc_header_zero_w1(desc_ptr + tail, pkt); tail = (tail + 1) & qlen_mask; txbuffs[tail] = pkt;