The index i was incremented in the wrong place, and the check on the
presence of a next buffer in the chain was actually done for the
next desc_status rather than the current one.
Type: fix
Signed-off-by: Mauro Sardara <msardara@cisco.com>
Change-Id: I74a64a34fea497900b7969cd96e1aeeb570a1bba
u32 n_buffers = 0;
u32 n_left = ptd->n_packets;
u32 packet_len;
- int i = 0;
+ int i = -1;
/* construct copy and packet vector out of ring slots */
while (n_left)
dst_off = start_offset;
next_slot:
+ i++; /* next descriptor */
n_bytes_left = desc_len[i];
packet_len += n_bytes_left;
}
while (PREDICT_FALSE (n_bytes_left));
- /* next descriptor */
- i++;
-
if (desc_status[i].next)
{
src_off = 0;