DPDK patches and discussions
 help / color / mirror / Atom feed
From: Alejandro Lucero <alejandro.lucero@netronome.com>
To: dev@dpdk.org
Cc: stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/nfp: fix data offset initialization in TX descriptors
Date: Thu,  7 Jun 2018 16:52:11 +0100	[thread overview]
Message-ID: <1528386731-23007-1-git-send-email-alejandro.lucero@netronome.com> (raw)

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 <alejandro.lucero@netronome.com>
---
 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--;
 
-- 
1.9.1

             reply	other threads:[~2018-06-07 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-07 15:52 Alejandro Lucero [this message]
2018-06-08 13:50 ` Alejandro Lucero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1528386731-23007-1-git-send-email-alejandro.lucero@netronome.com \
    --to=alejandro.lucero@netronome.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).