From patchwork Mon Jun 11 09:50:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Lucero X-Patchwork-Id: 40967 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 254681E899; Mon, 11 Jun 2018 11:50:54 +0200 (CEST) Received: from netronome.com (host-79-78-33-110.static.as9105.net [79.78.33.110]) by dpdk.org (Postfix) with ESMTP id 3C0A21E882; Mon, 11 Jun 2018 11:50:52 +0200 (CEST) Received: from netronome.com (localhost [127.0.0.1]) by netronome.com (8.14.4/8.14.4/Debian-4.1ubuntu1) with ESMTP id w5B9obVF008351; Mon, 11 Jun 2018 10:50:37 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w5B9obrj008350; Mon, 11 Jun 2018 10:50:37 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Mon, 11 Jun 2018 10:50:37 +0100 Message-Id: <1528710637-8313-1-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] net/nfp: fix field initialization in TX descriptor X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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") Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index faad1ee..3658696 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2253,11 +2253,15 @@ uint32_t nfp_net_txq_full(struct nfp_net_txq *txq) 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 */