[dpdk-dev] net/nfp: fix data offset initialization in TX descriptors

Message ID 1528386731-23007-1-git-send-email-alejandro.lucero@netronome.com (mailing list archive)
State Rejected, archived
Delegated to: Ferruh Yigit
Headers
Series [dpdk-dev] net/nfp: fix data offset initialization in TX descriptors |

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Alejandro Lucero June 7, 2018, 3:52 p.m. UTC
  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(+)
  

Comments

Alejandro Lucero June 8, 2018, 1:50 p.m. UTC | #1
Please, ignore this patch. It is not clear yet if we need this. We thought
it was fixing a problem but we have doubts now.

I have changed the status of the patch to not applicable.

thanks

On Thu, Jun 7, 2018 at 4:52 PM, Alejandro Lucero <
alejandro.lucero@netronome.com> wrote:

> 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
>
>
  

Patch

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--;