diff options
author | Eyal Bari <ebari@cisco.com> | 2018-04-01 15:13:06 +0300 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-04-04 07:02:43 +0000 |
commit | eb4f74a54f022aa759f3ce57af23ca28e57c9f85 (patch) | |
tree | c6e1d354c6ff10b4b3022d5eaa3d4a99dda6013e /src/plugins/dpdk/device/node.c | |
parent | 56ccc23fbc6244190140bd7eb57bfa75f2312c62 (diff) |
dpdk:fix checksum handling of l2 interfaces
dpdk-input was dropping packets with bad ip-checksum on l2 interfaces
Change-Id: Ife5b52766bb71e878b1da6e94ae7b8a1e59fc478
Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/node.c')
-rw-r--r-- | src/plugins/dpdk/device/node.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/plugins/dpdk/device/node.c b/src/plugins/dpdk/device/node.c index 7edcc36e593..e1674dcd88d 100644 --- a/src/plugins/dpdk/device/node.c +++ b/src/plugins/dpdk/device/node.c @@ -298,25 +298,25 @@ dpdk_device_input (dpdk_main_t * dm, dpdk_device_t * xd, next1 = dpdk_rx_next_from_etype (mb1); next2 = dpdk_rx_next_from_etype (mb2); next3 = dpdk_rx_next_from_etype (mb3); + + or_ol_flags = (mb0->ol_flags | mb1->ol_flags | + mb2->ol_flags | mb3->ol_flags); + if (PREDICT_FALSE (or_ol_flags & PKT_RX_IP_CKSUM_BAD)) + { + dpdk_rx_error_from_mb (mb0, &next0, &error0); + dpdk_rx_error_from_mb (mb1, &next1, &error1); + dpdk_rx_error_from_mb (mb2, &next2, &error2); + dpdk_rx_error_from_mb (mb3, &next3, &error3); + b0->error = node->errors[error0]; + b1->error = node->errors[error1]; + b2->error = node->errors[error2]; + b3->error = node->errors[error3]; + } } dpdk_prefetch_buffer (xd->rx_vectors[queue_id][mb_index + 11]); dpdk_prefetch_ethertype (xd->rx_vectors[queue_id][mb_index + 7]); - or_ol_flags = (mb0->ol_flags | mb1->ol_flags | - mb2->ol_flags | mb3->ol_flags); - if (PREDICT_FALSE (or_ol_flags & PKT_RX_IP_CKSUM_BAD)) - { - dpdk_rx_error_from_mb (mb0, &next0, &error0); - dpdk_rx_error_from_mb (mb1, &next1, &error1); - dpdk_rx_error_from_mb (mb2, &next2, &error2); - dpdk_rx_error_from_mb (mb3, &next3, &error3); - b0->error = node->errors[error0]; - b1->error = node->errors[error1]; - b2->error = node->errors[error2]; - b3->error = node->errors[error3]; - } - offset0 = device_input_next_node_advance[next0]; b0->current_data = mb0->data_off + offset0 - RTE_PKTMBUF_HEADROOM; b0->flags |= device_input_next_node_flags[next0]; @@ -436,10 +436,12 @@ dpdk_device_input (dpdk_main_t * dm, dpdk_device_t * xd, if (PREDICT_FALSE (xd->per_interface_next_index != ~0)) next0 = xd->per_interface_next_index; else - next0 = dpdk_rx_next_from_etype (mb0); + { + next0 = dpdk_rx_next_from_etype (mb0); - dpdk_rx_error_from_mb (mb0, &next0, &error0); - b0->error = node->errors[error0]; + dpdk_rx_error_from_mb (mb0, &next0, &error0); + b0->error = node->errors[error0]; + } offset0 = device_input_next_node_advance[next0]; b0->current_data = mb0->data_off + offset0 - RTE_PKTMBUF_HEADROOM; |