* [dpdk-dev] [PATCH v1] app/testpmd: fix the overhead overflow issue
@ 2020-11-05 9:51 Steve Yang
2020-11-05 14:31 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Steve Yang @ 2020-11-05 9:51 UTC (permalink / raw)
To: dev
Cc: ferruh.yigit, beilei.xing, wenzhuo.lu, bernard.iremonger,
qiming.yang, mdr, nhorman, andrew.rybchenko, Steve Yang
If "dev_info.max_mtu" isn't set by driver, the rte_ethdev will set
default value "UINT16_MAX", that will cause the overhead value overflow.
Add more strict condition to ensure the overhead valid.
Fixes: bed05536c8f8 ("app/testpmd: fix max Rx packet length for VLAN packets")
Signed-off-by: Steve Yang <stevex.yang@intel.com>
---
app/test-pmd/testpmd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index c263121a9a..b34eaf2016 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -1459,7 +1459,10 @@ init_config(void)
"rte_eth_dev_info_get() failed\n");
/* Update the max_rx_pkt_len to have MTU as RTE_ETHER_MTU */
- if (port->dev_info.max_rx_pktlen && port->dev_info.max_mtu)
+ if (port->dev_info.max_mtu &&
+ port->dev_info.max_mtu != UINT16_MAX &&
+ port->dev_info.max_rx_pktlen &&
+ port->dev_info.max_rx_pktlen > port->dev_info.max_mtu)
overhead_len = port->dev_info.max_rx_pktlen -
port->dev_info.max_mtu;
else
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1] app/testpmd: fix the overhead overflow issue
2020-11-05 9:51 [dpdk-dev] [PATCH v1] app/testpmd: fix the overhead overflow issue Steve Yang
@ 2020-11-05 14:31 ` Ferruh Yigit
2020-11-05 18:22 ` Thomas Monjalon
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2020-11-05 14:31 UTC (permalink / raw)
To: Steve Yang, dev
Cc: beilei.xing, wenzhuo.lu, bernard.iremonger, qiming.yang, mdr,
nhorman, andrew.rybchenko
On 11/5/2020 9:51 AM, Steve Yang wrote:
> If "dev_info.max_mtu" isn't set by driver, the rte_ethdev will set
> default value "UINT16_MAX", that will cause the overhead value overflow.
>
> Add more strict condition to ensure the overhead valid.
>
> Fixes: bed05536c8f8 ("app/testpmd: fix max Rx packet length for VLAN packets")
>
> Signed-off-by: Steve Yang <stevex.yang@intel.com>
Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH v1] app/testpmd: fix the overhead overflow issue
2020-11-05 14:31 ` Ferruh Yigit
@ 2020-11-05 18:22 ` Thomas Monjalon
0 siblings, 0 replies; 3+ messages in thread
From: Thomas Monjalon @ 2020-11-05 18:22 UTC (permalink / raw)
To: Steve Yang
Cc: dev, beilei.xing, wenzhuo.lu, bernard.iremonger, qiming.yang,
mdr, nhorman, andrew.rybchenko, Ferruh Yigit
05/11/2020 15:31, Ferruh Yigit:
> On 11/5/2020 9:51 AM, Steve Yang wrote:
> > If "dev_info.max_mtu" isn't set by driver, the rte_ethdev will set
> > default value "UINT16_MAX", that will cause the overhead value overflow.
> >
> > Add more strict condition to ensure the overhead valid.
> >
> > Fixes: bed05536c8f8 ("app/testpmd: fix max Rx packet length for VLAN packets")
> >
> > Signed-off-by: Steve Yang <stevex.yang@intel.com>
>
> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Rejected because causing other issues:
http://inbox.dpdk.org/dev/CADyeNEB2610Shzm6QN--wO8wDzg_-QtYuG05=gWrcaA39h0_ww@mail.gmail.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-11-05 18:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 9:51 [dpdk-dev] [PATCH v1] app/testpmd: fix the overhead overflow issue Steve Yang
2020-11-05 14:31 ` Ferruh Yigit
2020-11-05 18:22 ` Thomas Monjalon
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).