app/testpmd: fix crash
authorFerruh Yigit <ferruh.yigit@intel.com>
Fri, 14 Jun 2019 17:19:39 +0000 (18:19 +0100)
committerThomas Monjalon <thomas@monjalon.net>
Sun, 16 Jun 2019 09:53:46 +0000 (12:53 +0300)
commit163fbaafa29f0f5f968162700061f1009321625c
tree10b07af0e5d7c096f82d1fe7a9316bcf68dcc93f
parentc530aa78e3747cdd273310eeb9c50603da7f9cb6
app/testpmd: fix crash

Testpmd tries to calculate mbuf size based on "max Rx packet size" and
"max MTU segment number".
When driver set a "nb_mtu_seg_max" to zero, it causes division by zero
segmentation fault in testpmd.

If the PMD set "nb_mtu_seg_max" to zero, testpmd shouldn't try to
calculate the mbuf size.

Fixes: 33f9630fc23d ("app/testpmd: create mbuf based on max supported segments")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
app/test-pmd/testpmd.c