From patchwork Thu Jun 7 15:52:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Lucero X-Patchwork-Id: 40776 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 F24041B1CA; Thu, 7 Jun 2018 17:52:24 +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 85E001B1BD; Thu, 7 Jun 2018 17:52:23 +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 w57FqBQ0023045; Thu, 7 Jun 2018 16:52:11 +0100 Received: (from alucero@localhost) by netronome.com (8.14.4/8.14.4/Submit) id w57FqBQk023044; Thu, 7 Jun 2018 16:52:11 +0100 From: Alejandro Lucero To: dev@dpdk.org Cc: stable@dpdk.org Date: Thu, 7 Jun 2018 16:52:11 +0100 Message-Id: <1528386731-23007-1-git-send-email-alejandro.lucero@netronome.com> X-Mailer: git-send-email 1.9.1 Subject: [dpdk-dev] [PATCH] net/nfp: fix data offset initialization in TX descriptors 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" The mbuf struct allows to prepend metadata and the NFP TX descriptors needs to give the data offset to the NIC. There is no application using this metadata but it is possible the PMD itself using it in the future for supporting hardware offloads like OVS offload. Also, this patch fixes a potential issue with the offset bits inside the TX descriptor not being used nor initialized, but the firmware checking it and doing the wrong thing if the offset bits contain garbage. Fixes: b812daadad0d ("nfp: add Rx and Tx") Signed-off-by: Alejandro Lucero --- drivers/net/nfp/nfp_net.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index faad1ee..14f7fc0 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -2245,6 +2245,14 @@ uint32_t nfp_net_txq_full(struct nfp_net_txq *txq) txds->data_len = txd.data_len; txds->dma_addr_hi = (dma_addr >> 32) & 0xff; txds->dma_addr_lo = (dma_addr & 0xffffffff); + + /* + * Prepend metadata? + * NFP has just support for a 7 bits offset + */ + txds->offset_eop = (uint8_t)pkt->data_off & + PCIE_DESC_TX_OFFSET_MASK; + ASSERT(free_descs > 0); free_descs--;