aboutsummaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-04-12 05:33:06 +0200
committerGerrit Code Review <gerrit@fd.io>2016-04-14 23:29:04 +0000
commit550b5f62528c435e4b9d41729f1d92e8ed9e161a (patch)
treec837efa6e8e386f3bb50592e1bb759439bf04b29 /vnet
parentd1f5d047988655a001655357f1ce35152161bedf (diff)
Init rte_mbuf length fields in af_packet driver
Change-Id: I30cdad9585c1457c0d8ceecb3e5110ad40740021 Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/af_packet/node.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/vnet/vnet/devices/af_packet/node.c b/vnet/vnet/devices/af_packet/node.c
index 1739cb3d316..9c1c4a32238 100644
--- a/vnet/vnet/devices/af_packet/node.c
+++ b/vnet/vnet/devices/af_packet/node.c
@@ -188,6 +188,11 @@ af_packet_device_input_fn (vlib_main_t * vm, vlib_node_runtime_t * node,
if (offset == 0)
{
+#if DPDK > 0
+ struct rte_mbuf * mb = rte_mbuf_from_vlib_buffer(b0);
+ rte_pktmbuf_data_len (mb) = b0->current_length;
+ rte_pktmbuf_pkt_len (mb) = b0->current_length;
+#endif
b0->total_length_not_including_first_buffer = 0;
b0->flags = VLIB_BUFFER_TOTAL_LENGTH_VALID;
vnet_buffer(b0)->sw_if_index[VLIB_RX] = apif->sw_if_index;