memif: fix chain buffer length in zero-copy mode 72/32872/2
authorBenoît Ganne <bganne@cisco.com>
Wed, 23 Jun 2021 11:45:25 +0000 (13:45 +0200)
committerDamjan Marion <dmarion@me.com>
Wed, 30 Jun 2021 18:57:59 +0000 (18:57 +0000)
The total_length_not_including_first_buffer field must be reset before
being updated otherwise it will quicly grows as stale values are reused.

Type: fix

Change-Id: Ic48c0822660998b0dfc0b5fdeadae6071b2d03f7
Signed-off-by: Benoît Ganne <bganne@cisco.com>
src/plugins/memif/node.c

index c7ad974..a69ab7f 100644 (file)
@@ -587,6 +587,7 @@ memif_device_input_zc_inline (vlib_main_t *vm, vlib_node_runtime_t *node,
       if (PREDICT_FALSE ((d0->flags & MEMIF_DESC_FLAG_NEXT) && n_slots))
        {
          hb->flags |= VLIB_BUFFER_TOTAL_LENGTH_VALID;
+         hb->total_length_not_including_first_buffer = 0;
        next_slot:
          s0 = cur_slot & mask;
          d0 = &ring->desc[s0];