aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Shin <jonshin@cisco.com>2016-08-18 08:16:27 -0700
committerSteve Shin <jonshin@cisco.com>2016-08-18 10:38:30 -0700
commit82a7af95e7553747dcebdb865a9c9a67826745d4 (patch)
treef0aa52708016788c22f22a50ff5839db3f451e13
parenta8f7b750bbebe8486e575a5901cb7bdfdb902192 (diff)
tuntap_rx modification to handle jumbo packets ( > 2K bytes)
Change-Id: Iebe30b87457741ac268b24c96fa7ea8ad1e101a6 Signed-off-by: Steve Shin <jonshin@cisco.com>
-rw-r--r--vnet/vnet/unix/tuntap.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/vnet/vnet/unix/tuntap.c b/vnet/vnet/unix/tuntap.c
index 967c0aca4ac..01da1730e6c 100644
--- a/vnet/vnet/unix/tuntap.c
+++ b/vnet/vnet/unix/tuntap.c
@@ -206,6 +206,7 @@ tuntap_rx (vlib_main_t * vm,
#else
dpdk_main_t * dm = &dpdk_main;
u32 free_list_index = dm->vlib_buffer_free_list_index;
+ struct rte_mbuf *first_mb = NULL, *prev_mb = NULL;
#endif
/* Make sure we have some RX buffers. */
@@ -262,6 +263,15 @@ tuntap_rx (vlib_main_t * vm,
b = vlib_get_buffer (vm, tm->rx_buffers[i_rx]);
#if DPDK == 1
mb = rte_mbuf_from_vlib_buffer(b);
+
+ if (first_mb == NULL)
+ first_mb = mb;
+
+ if (prev_mb != NULL)
+ {
+ prev_mb->next = mb;
+ first_mb->nb_segs++;
+ }
#endif
b->flags = 0;
b->current_data = 0;
@@ -270,12 +280,13 @@ tuntap_rx (vlib_main_t * vm,
n_bytes_left -= buffer_size;
#if DPDK == 1
rte_pktmbuf_data_len (mb) = b->current_length;
+ mb->data_off = RTE_PKTMBUF_HEADROOM + b->current_data;
#endif
if (n_bytes_left <= 0)
{
#if DPDK == 1
- rte_pktmbuf_pkt_len (mb) = n_bytes_in_packet;
+ rte_pktmbuf_pkt_len (first_mb) = n_bytes_in_packet;
#endif
break;
}
@@ -284,9 +295,7 @@ tuntap_rx (vlib_main_t * vm,
b->flags |= VLIB_BUFFER_NEXT_PRESENT;
b->next_buffer = tm->rx_buffers[i_rx];
#if DPDK == 1
- ASSERT(0);
- // ((struct rte_pktmbuf *)(b->mb))->next =
- // vlib_get_buffer (vm, tm->rx_buffers[i_rx])->mb;
+ prev_mb = mb;
#endif
}