On 13 March 2017 at 15:02, Bill Fischofer <[email protected]> wrote:
> Address bug https://bugs.linaro.org/show_bug.cgi?id=2908 by checking > the pool capability max packet length and modifying the test in > test_extend_ref() to account for implementations that do not limit > packet lengths. > > Signed-off-by: Bill Fischofer <[email protected]> > --- > test/common_plat/validation/api/packet/packet.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/test/common_plat/validation/api/packet/packet.c > b/test/common_plat/validation/api/packet/packet.c > index 900c4263..5544c237 100644 > --- a/test/common_plat/validation/api/packet/packet.c > +++ b/test/common_plat/validation/api/packet/packet.c > @@ -1847,6 +1847,9 @@ void packet_test_extend_ref(void) > { > odp_packet_t max_pkt, ref; > uint32_t hr, tr, max_len; > + odp_pool_capability_t capa; > + > + CU_ASSERT_FATAL(odp_pool_capability(&capa) == 0); > > max_pkt = odp_packet_copy(segmented_test_packet, > odp_packet_pool(segmented_test_packet)); > @@ -1860,8 +1863,10 @@ void packet_test_extend_ref(void) > odp_packet_push_tail(max_pkt, tr); > > /* Max packet should not be extendable at either end */ > - CU_ASSERT(odp_packet_extend_tail(&max_pkt, 1, NULL, NULL) < 0); > - CU_ASSERT(odp_packet_extend_head(&max_pkt, 1, NULL, NULL) < 0); > + if (max_len == capa.pkt.max_len) { > This capability is already defined in odp-dpdk as an internal capability. And used to calculate & make sure at least one packet fits in the pool. So my question was if odp-dpdk should use this internal capability to check against the max packet size since dpdk has no such capability ?. /Krishna > + CU_ASSERT(odp_packet_extend_tail(&max_pkt, 1, NULL, NULL) > < 0); > + CU_ASSERT(odp_packet_extend_head(&max_pkt, 1, NULL, NULL) > < 0); > + } > > /* See if we can trunc and extend anyway */ > CU_ASSERT(odp_packet_trunc_tail(&max_pkt, hr + tr + 1, > -- > 2.12.0.rc1 > >
