net/iavf: fix pkt len check

Message ID 20231013114125.376-1-dexia.li@jaguarmicro.com (mailing list archive)
State Rejected, archived
Delegated to: Qi Zhang
Headers
Series net/iavf: fix pkt len check |

Checks

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

Commit Message

Dexia Li Oct. 13, 2023, 11:41 a.m. UTC
  App usually encap some bytes in mbuf headroom, for example, tunnel
header. When RTE_MBUF_F_TX_TCP_SEG is set, this check will drop packets.
Since the packet will be cut by hw soon, the out packet will not exceed
mtu.

Signed-off-by: Dexia Li <dexia.li@jaguarmicro.com>
---
 drivers/net/iavf/iavf_rxtx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

David Marchand Oct. 13, 2023, 11:47 a.m. UTC | #1
Hello Dexia,

On Fri, Oct 13, 2023 at 1:42 PM Dexia Li <dexia.li@jaguarmicro.com> wrote:
>
> App usually encap some bytes in mbuf headroom, for example, tunnel
> header. When RTE_MBUF_F_TX_TCP_SEG is set, this check will drop packets.
> Since the packet will be cut by hw soon, the out packet will not exceed
> mtu.
>
> Signed-off-by: Dexia Li <dexia.li@jaguarmicro.com>

This should be fixed with series:
https://patchwork.dpdk.org/project/dpdk/list/?series=29651&state=%2A&archive=both

Applied in next-net-intel:
https://git.dpdk.org/next/dpdk-next-net-intel/commit/?id=ff67c8a679c2daba282841459d8cd4131b3a85ab

Those patches will make it to the main dpdk repo soon.

Please double check they work for you.
Thanks.
  
David Marchand Oct. 16, 2023, 7:30 a.m. UTC | #2
On Mon, Oct 16, 2023 at 3:37 AM Dexia Li <dexia.li@jaguarmicro.com> wrote:
>
> Thanks for your commit.
> It works for me.
>

Thanks for confirming, I marked this patch as rejected.
  

Patch

diff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c
index b1d0fbceb6..b6dabed3c8 100644
--- a/drivers/net/iavf/iavf_rxtx.c
+++ b/drivers/net/iavf/iavf_rxtx.c
@@ -3641,7 +3641,7 @@  iavf_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 
 		/* check the data_len in mbuf */
 		if (m->data_len < IAVF_TX_MIN_PKT_LEN ||
-			m->data_len > max_frame_size) {
+			(!(ol_flags & RTE_MBUF_F_TX_TCP_SEG) && m->data_len > max_frame_size)) {
 			rte_errno = EINVAL;
 			PMD_DRV_LOG(ERR, "INVALID mbuf: bad data_len=[%hu]", m->data_len);
 			return i;