Message ID | 1460679929-30653-6-git-send-email-bill.fischofer@linaro.org |
---|---|
State | Accepted |
Commit | 32c560f78b06c576208d573634ec2a51e6c72809 |
Headers | show |
Merged, Maxim. On 04/15/16 03:25, Bill Fischofer wrote: > odp_packet_buf_len() must return buffer length over all segments > > Signed-off-by: Bill Fischofer <bill.fischofer@linaro.org> > Reviewed-by: Bala Manoharan <bala.manoharan@linaro.org> > --- > platform/linux-generic/odp_packet.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c > index 4202a90..2abb227 100644 > --- a/platform/linux-generic/odp_packet.c > +++ b/platform/linux-generic/odp_packet.c > @@ -211,7 +211,9 @@ void *odp_packet_head(odp_packet_t pkt) > > uint32_t odp_packet_buf_len(odp_packet_t pkt) > { > - return odp_packet_hdr(pkt)->buf_hdr.size; > + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); > + > + return pkt_hdr->buf_hdr.size * pkt_hdr->buf_hdr.segcount; > } > > void *odp_packet_data(odp_packet_t pkt)
diff --git a/platform/linux-generic/odp_packet.c b/platform/linux-generic/odp_packet.c index 4202a90..2abb227 100644 --- a/platform/linux-generic/odp_packet.c +++ b/platform/linux-generic/odp_packet.c @@ -211,7 +211,9 @@ void *odp_packet_head(odp_packet_t pkt) uint32_t odp_packet_buf_len(odp_packet_t pkt) { - return odp_packet_hdr(pkt)->buf_hdr.size; + odp_packet_hdr_t *pkt_hdr = odp_packet_hdr(pkt); + + return pkt_hdr->buf_hdr.size * pkt_hdr->buf_hdr.segcount; } void *odp_packet_data(odp_packet_t pkt)