net/sfc: account for data offset on Tx

Message ID 20230911104739.31452-3-viacheslav.galaktionov@arknetworks.am (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series net/sfc: account for data offset on Tx |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS

Commit Message

Viacheslav Galaktionov Sept. 11, 2023, 10:47 a.m. UTC
  Memory buffers passed by the application may contain private data,
which must not be sent to the NIC. Omit this private data by using
the actual data address instead of the default one.

Fixes: 3037e6cf3dde ("net/sfc: support regioned NIC DMA memory mapping type")
Cc: stable@dpdk.org

Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
Reviewed-by: Ivan Malov <ivan.malov@arknetworks.am>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc_ef100_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Andrew Rybchenko Sept. 11, 2023, 1:06 p.m. UTC | #1
On 9/11/23 13:47, Viacheslav Galaktionov wrote:
> Memory buffers passed by the application may contain private data,
> which must not be sent to the NIC. Omit this private data by using
> the actual data address instead of the default one.
> 
> Fixes: 3037e6cf3dde ("net/sfc: support regioned NIC DMA memory mapping type")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Viacheslav Galaktionov <viacheslav.galaktionov@arknetworks.am>
> Reviewed-by: Ivan Malov <ivan.malov@arknetworks.am>
> Reviewed-by: Andy Moreton <amoreton@xilinx.com>

Acked-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
  

Patch

diff --git a/drivers/net/sfc/sfc_ef100_tx.c b/drivers/net/sfc/sfc_ef100_tx.c
index 4c2205f7a4..1b6374775f 100644
--- a/drivers/net/sfc/sfc_ef100_tx.c
+++ b/drivers/net/sfc/sfc_ef100_tx.c
@@ -405,7 +405,7 @@  sfc_ef100_tx_qdesc_send_create(const struct sfc_ef100_txq *txq,
 				m->l2_len + m->l3_len) >> 1;
 	}
 
-	rc = sfc_ef100_tx_map(txq, rte_mbuf_data_iova_default(m),
+	rc = sfc_ef100_tx_map(txq, rte_mbuf_data_iova(m),
 			      rte_pktmbuf_data_len(m), &dma_addr);
 	if (unlikely(rc != 0))
 		return rc;