summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2016-02-18 10:11:34 +0100
committerDave Barach <openvpp@barachs.net>2016-06-07 19:29:28 +0000
commitb54db102acdae5694f21d6617eef52f8f7f77c29 (patch)
treeb0e9da4c9a599257855032dce40765f8e9806cf2
parent19414deeaa15ea9434f86d40a5bc7ca43916eab5 (diff)
Adjust buffer data offset based on rte_mbuff data_off
This commit removes assumption that all packets have data offset equal to RTE_PKTMBUF_HEADROOM. Some drivers like fm10K receive packets with different data offset. Change-Id: I0aba6296458dab9df6fff639b4b827b2084ddc3e Signed-off-by: Damjan Marion <damarion@cisco.com>
-rw-r--r--vnet/vnet/devices/dpdk/node.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/vnet/vnet/devices/dpdk/node.c b/vnet/vnet/devices/dpdk/node.c
index 0dd3cfcdd77..2c90d80a31e 100644
--- a/vnet/vnet/devices/dpdk/node.c
+++ b/vnet/vnet/devices/dpdk/node.c
@@ -502,7 +502,6 @@ static inline u32 dpdk_device_input ( dpdk_main_t * dm,
u32 n_trace, trace_cnt __attribute__((unused));
vlib_buffer_free_list_t * fl;
u8 efd_discard_burst = 0;
- u16 ip_align_offset = 0;
u32 buffer_flags_template;
if (xd->admin_up == 0)
@@ -522,9 +521,6 @@ static inline u32 dpdk_device_input ( dpdk_main_t * dm,
return 0;
}
- if (xd->pmd == VNET_DPDK_PMD_THUNDERX)
- ip_align_offset = 6;
-
buffer_flags_template = dm->buffer_flags_template;
vec_reset_length (xd->d_trace_buffers);
@@ -673,15 +669,11 @@ static inline u32 dpdk_device_input ( dpdk_main_t * dm,
sizeof (ethernet_header_t) : 0);
b0->current_data = l3_offset0;
+ /* Some drivers like fm10k receive frames with
+ mb->data_off > RTE_PKTMBUF_HEADROOM */
+ b0->current_data += mb->data_off - RTE_PKTMBUF_HEADROOM;
b0->current_length = mb->data_len - l3_offset0;
- if (PREDICT_FALSE (ip_align_offset != 0))
- {
- if (next0 == DPDK_RX_NEXT_IP4_INPUT ||
- next0 == DPDK_RX_NEXT_IP6_INPUT)
- b0->current_data += ip_align_offset;
- }
-
b0->flags = buffer_flags_template;
if (VMWARE_LENGTH_BUG_WORKAROUND)
@@ -1390,6 +1382,9 @@ void dpdk_io_thread (vlib_worker_thread_t * w,
sizeof (ethernet_header_t) : 0);
b0->current_data = l3_offset0;
+ /* Some drivers like fm10k receive frames with
+ mb->data_off > RTE_PKTMBUF_HEADROOM */
+ b0->current_data += mb->data_off - RTE_PKTMBUF_HEADROOM;
b0->current_length = mb->data_len - l3_offset0;
b0->flags = buffer_flags_template;