summaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/af_packet.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/af_packet.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/af_packet.c')
-rw-r--r--src/vnet/devices/af_packet/af_packet.c30
1 files changed, 2 insertions, 28 deletions
diff --git a/src/vnet/devices/af_packet/af_packet.c b/src/vnet/devices/af_packet/af_packet.c
index fbcd488ac9b..32696014727 100644
--- a/src/vnet/devices/af_packet/af_packet.c
+++ b/src/vnet/devices/af_packet/af_packet.c
@@ -23,7 +23,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <linux/virtio_net.h>
#include <vppinfra/linux/sysfs.h>
#include <vlib/vlib.h>
@@ -129,7 +128,6 @@ static int
create_packet_v2_sock (int host_if_index, tpacket_req_t * rx_req,
tpacket_req_t * tx_req, int *fd, u8 ** ring)
{
- af_packet_main_t *apm = &af_packet_main;
int ret, err;
struct sockaddr_ll sll;
int ver = TPACKET_V2;
@@ -143,31 +141,7 @@ create_packet_v2_sock (int host_if_index, tpacket_req_t * rx_req,
ret = VNET_API_ERROR_SYSCALL_ERROR_1;
goto error;
}
- int opt = 1;
- if (setsockopt (*fd, SOL_PACKET, PACKET_VNET_HDR, &opt, sizeof (opt)) != 0)
- {
- DBG_SOCK ("Failed to enable vnet headers on the socket");
- if ((apm->flags & AF_PACKET_USES_VNET_HEADERS) != 0)
- {
- /* Should never happen - vnet was already enabled once,
- * but we fail to reenable it on a new interface
- **/
- ret = VNET_API_ERROR_SYSCALL_ERROR_1;
- goto error;
- }
- }
- else
- {
- apm->flags |= AF_PACKET_USES_VNET_HEADERS;
- }
-#ifdef PACKET_QDISC_BYPASS
- opt = 1;
- if (setsockopt (*fd, SOL_PACKET, PACKET_QDISC_BYPASS, &opt, sizeof (opt)) !=
- 0)
- {
- DBG_SOCK ("Failed to bypass Linux QDISC");
- }
-#endif
+
if ((err =
setsockopt (*fd, SOL_PACKET, PACKET_VERSION, &ver, sizeof (ver))) < 0)
{
@@ -176,7 +150,7 @@ create_packet_v2_sock (int host_if_index, tpacket_req_t * rx_req,
goto error;
}
- opt = 1;
+ int opt = 1;
if ((err =
setsockopt (*fd, SOL_PACKET, PACKET_LOSS, &opt, sizeof (opt))) < 0)
{