aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/device.c
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2017-10-11 14:15:47 +0200
committerFlorin Coras <florin.coras@gmail.com>2017-10-11 21:11:53 +0000
commitc51702097789a6b4e27ea2b909af74a0a35b7c13 (patch)
tree797bf66417e0cbdb316ea86fe4b30efa449a5608 /src/vnet/devices/af_packet/device.c
parenta472f868d64c4faa128f427a3fa711aaef260a5d (diff)
Revert "VPP-1001 - update AF Packet Driver to for modern kernels"
Issues observed with specific kernel versions, e.g. stock Ubuntu 16.04 kernel. This reverts commit 3eab064e3fadaf2a6a128f167ad04ca0319b4e17. Change-Id: I24241f3b580df749fc686af3a319011ca035fb5e Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet/devices/af_packet/device.c')
-rw-r--r--src/vnet/devices/af_packet/device.c30
1 files changed, 1 insertions, 29 deletions
diff --git a/src/vnet/devices/af_packet/device.c b/src/vnet/devices/af_packet/device.c
index a48ae5cf25d..e01b1c71b32 100644
--- a/src/vnet/devices/af_packet/device.c
+++ b/src/vnet/devices/af_packet/device.c
@@ -23,8 +23,6 @@
#include <net/if.h>
#include <net/if_arp.h>
-#include <linux/virtio_net.h>
-
#include <vlib/vlib.h>
#include <vlib/unix/unix.h>
#include <vnet/ip/ip.h>
@@ -52,6 +50,7 @@ static char *af_packet_tx_func_error_strings[] = {
#undef _
};
+
static u8 *
format_af_packet_device_name (u8 * s, va_list * args)
{
@@ -77,23 +76,6 @@ format_af_packet_tx_trace (u8 * s, va_list * args)
return s;
}
-
-static_always_inline void
-af_packet_buffer_tx_offload (vlib_buffer_t * b, struct virtio_net_hdr *vhdr)
-{
- /* For now - just mark the data as valid,
- * DPDK csums on input, tap presently operates in legacy
- * compatibility mode where the kernel checksums CSUM_PARTIAL
- * for it and we have fixed the af_packet input
- *
- * In the future, locally originated frames, etc can be made
- * to fit this convention so that they are not checksummed
- * unless needed.
- **/
- vhdr->flags = VIRTIO_NET_HDR_F_DATA_VALID;
-}
-
-
static uword
af_packet_interface_tx (vlib_main_t * vm,
vlib_node_runtime_t * node, vlib_frame_t * frame)
@@ -120,10 +102,6 @@ af_packet_interface_tx (vlib_main_t * vm,
{
u32 len;
u32 offset = 0;
- if (PREDICT_TRUE ((apm->flags & AF_PACKET_USES_VNET_HEADERS) != 0))
- {
- offset = sizeof (struct virtio_net_hdr);
- }
vlib_buffer_t *b0;
n_left--;
u32 bi = buffers[0];
@@ -141,12 +119,6 @@ af_packet_interface_tx (vlib_main_t * vm,
do
{
b0 = vlib_get_buffer (vm, bi);
- if (PREDICT_TRUE ((apm->flags & AF_PACKET_USES_VNET_HEADERS) != 0))
- {
- u8 *vh =
- (u8 *) tph + TPACKET_ALIGN (sizeof (struct tpacket2_hdr));
- af_packet_buffer_tx_offload (b0, (struct virtio_net_hdr *) vh);
- }
len = b0->current_length;
clib_memcpy ((u8 *) tph +
TPACKET_ALIGN (sizeof (struct tpacket2_hdr)) + offset,