On 06/30/2015 01:56 PM, Nicolas Morey-Chaisemartin wrote:
>
> On 06/30/2015 01:41 PM, Stuart Haslam wrote:
>> On Mon, Jun 29, 2015 at 10:05:10AM +0200, Nicolas Morey-Chaisemartin wrote:
>>> +
>>> +static uint32_t _rx_pkt_to_iovec(odp_packet_t pkt,
>>> +                            struct iovec iovecs[ODP_BUFFER_MAX_SEG])
>>> +{
>>> +   odp_packet_seg_t seg = odp_packet_first_seg(pkt);
>>> +   uint32_t seg_count = odp_packet_num_segs(pkt);
>>> +   uint32_t seg_id = 0;
>>> +   uint32_t iov_count = 0;
>>> +   uint32_t headroom = odp_packet_headroom(pkt);
>>> +   uint32_t tailroom = odp_packet_tailroom(pkt);
>>> +
>>> +   for (seg_id = 0; seg_id < seg_count; ++seg_id) {
>>> +           uint32_t seglen = odp_packet_seg_buf_len(pkt, seg);
>>> +           uint8_t *ptr = odp_packet_seg_buf_addr(pkt, seg);
>> I think if you used odp_packet_seg_data() + data_len() here you wouldn't
>> need to deal with the headroom and tailroom at all.
> You're right. I'll gitve it a try.
>
Would it be acceptable to include odp_buffer_inlines so both call to seg_data 
and seg_data_len ca be replaced by a single call to segment_map?
The call seems quite costly and it's a bit of a waste to do it twice.

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to