> -----Original Message----- > From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp- > boun...@lists.linaro.org] On Behalf Of ext Stuart Haslam > Sent: Thursday, December 11, 2014 3:01 PM > To: Bill Fischofer > Cc: lng-odp@lists.linaro.org > Subject: Re: [lng-odp] [PATCHv3] Implement v0.5 level packet APIs > > On Thu, Dec 11, 2014 at 05:00:44AM +0000, Bill Fischofer wrote: > > Signed-off-by: Bill Fischofer <bill.fischo...@linaro.org> > > --- > > v3 removes RFC, incorporates bug fixes from Stuart, and doxygen > > usage recommendations fram Anders and Petri > > > > example/generator/odp_generator.c | 82 +- > > example/ipsec/odp_ipsec.c | 32 +- > > example/ipsec/odp_ipsec_stream.c | 22 +- > > example/l2fwd/odp_l2fwd.c | 3 +- > > example/packet/odp_pktio.c | 8 +- > > helper/include/odph_ip.h | 35 +- > > helper/include/odph_packet.h | 97 --- > > helper/include/odph_udp.h | 5 +- > > platform/linux-generic/Makefile.am | 1 - > > platform/linux-generic/include/api/odp_packet.h | 737 +++++++++++++- > --- > > .../linux-generic/include/api/odp_platform_types.h | 21 +- > > .../linux-generic/include/odp_buffer_inlines.h | 54 ++ > > .../linux-generic/include/odp_buffer_internal.h | 1 + > > .../linux-generic/include/odp_packet_internal.h | 81 +- > > platform/linux-generic/odp_classification.c | 2 +- > > platform/linux-generic/odp_crypto.c | 11 +- > > platform/linux-generic/odp_packet.c | 921 > ++++++++++++++++----- > > platform/linux-generic/odp_packet_socket.c | 93 +-- > > 18 files changed, 1569 insertions(+), 637 deletions(-) > > delete mode 100644 helper/include/odph_packet.h > > > > [...] > > > @@ -491,10 +480,9 @@ int send_pkt_sock_mmsg(pkt_sock_t *const pkt_sock, > > memset(msgvec, 0, sizeof(msgvec)); > > > > for (i = 0; i < len; i++) { > > - uint8_t *const frame = odp_packet_l2(pkt_table[i]); > > - const size_t frame_len = > odp_packet_get_len(pkt_table[i]); > > - iovecs[i].iov_base = frame; > > - iovecs[i].iov_len = frame_len; > > + uint32_t len; > > + iovecs[i].iov_base = odp_packet_l2_ptr(pkt_table[i], > &len); > > + iovecs[i].iov_len = len; > > There's a name clash with len here (ok it's scoped, but it's confusing). > > Also, I have a question about odp_packet_l2_ptr(). The description says > it "outputs number of data bytes in the segment following the pointer." > which I took to mean the number of bytes of packet data (so with a > segment len > frame len as in linux-generic, I guess it would be > frame_len - l2_offset), is that what's meant?
Yes, it should be number of data bytes (not buffer space) in the segment flowing address. -Petri > > I've not yet picked up this version of the patch, so maybe this is > fixed, but with the previous version (plus the packet_offset_mmap() > fix applied) I see unexpected behaviour and wanted to check with you > before spending time merging again. > > The issue I have is that here odp_packet_l2_ptr() is returning a len > of buffer size - headroom (1984-66=1912), but the frame_len is 50 and > l2_offset is 0, so I'd expect to get 50. > > -- > Stuart. > > > _______________________________________________ > lng-odp mailing list > lng-odp@lists.linaro.org > http://lists.linaro.org/mailman/listinfo/lng-odp _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp