From: Alejandro Lucero Date: Mon, 11 Jun 2018 09:50:37 +0000 (+0100) Subject: net/nfp: fix field initialization in Tx descriptor X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=01f65293ceb94921a35554fa7b17bc0ec1764c96;p=dpdk.git net/nfp: fix field initialization in Tx descriptor TX descriptor eop_offset field is not initialized and it could contain garbage. This patch fixes the potential problem setting EOP as the only subfield. The other subfield, data offset, is not used by now. Fixes: b812daadad0d ("nfp: add Rx and Tx") Cc: stable@dpdk.org Signed-off-by: Alejandro Lucero --- diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index faad1ee9bf..36586969ff 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2253,11 +2253,15 @@ nfp_net_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) txq->wr_p = 0; pkt_size -= dma_size; - if (!pkt_size) - /* End of packet */ - txds->offset_eop |= PCIE_DESC_TX_EOP; + + /* + * Making the EOP, packets with just one segment + * the priority + */ + if (likely(!pkt_size)) + txds->offset_eop = PCIE_DESC_TX_EOP; else - txds->offset_eop &= PCIE_DESC_TX_OFFSET_MASK; + txds->offset_eop = 0; pkt = pkt->next; /* Referencing next free TX descriptor */