diff options
author | Pierre Pfister <ppfister@cisco.com> | 2016-12-02 10:55:13 +0000 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-12-02 12:25:09 +0000 |
commit | 58290ea2f6364fdc6f0dd9c201d6d0b84025f3d3 (patch) | |
tree | 6ae3e6924df7e9a5589c8c5018c1a9c9fff450cb | |
parent | 9dd34e00ede6e5d0b32e8e0c0b26b03dee468549 (diff) |
Fix dpdk_validate_rte-mbuf for chained buffers
Change I4ad40f398f7b5cf introduced a bug with chained buffers.
This patch should fix it.
Change-Id: Ia409d5eb90fcd6d7ff3c7da0836edfd2eb25998b
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
-rw-r--r-- | vnet/vnet/devices/dpdk/device.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c index 9f40c277b20..800a06caf13 100644 --- a/vnet/vnet/devices/dpdk/device.c +++ b/vnet/vnet/devices/dpdk/device.c @@ -160,12 +160,13 @@ dpdk_validate_rte_mbuf (vlib_main_t * vm, vlib_buffer_t * b, rte_mbuf header */ if (PREDICT_FALSE ((b->flags & VNET_BUFFER_RTE_MBUF_VALID) == 0)) { - last_mb = mb = rte_mbuf_from_vlib_buffer (b); + vlib_buffer_t *b2 = b; + last_mb = mb = rte_mbuf_from_vlib_buffer (b2); rte_pktmbuf_reset (mb); - while (maybe_multiseg && (b->flags & VLIB_BUFFER_NEXT_PRESENT)) + while (maybe_multiseg && (b2->flags & VLIB_BUFFER_NEXT_PRESENT)) { - b = vlib_get_buffer (vm, b->next_buffer); - mb = rte_mbuf_from_vlib_buffer (b); + b2 = vlib_get_buffer (vm, b2->next_buffer); + mb = rte_mbuf_from_vlib_buffer (b2); last_mb->next = mb; last_mb = mb; rte_pktmbuf_reset (mb); |