aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/devices/af_packet/af_packet_api.c
diff options
context:
space:
mode:
authorJakub Grajciar <Jakub.Grajciar@pantheon.tech>2017-10-20 13:37:28 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2017-10-23 16:00:38 +0000
commit92b0275a364022af6ab828dfac83e38c0117cfe6 (patch)
treeb6fe19970fa41f7575c1577656da8e237d42cafe /src/vnet/devices/af_packet/af_packet_api.c
parentfb66301070cf2e77b61296dea9686a4ac6a94976 (diff)
af_packet: invalid TCP/UDP offload checksum on RX node recalculation
Change-Id: I1075e5d2a1b6dfe3a443b40b41b8458a30505680 Signed-off-by: Jakub Grajciar <Jakub.Grajciar@pantheon.tech> Signed-off-by: Jakub.Grajciar@pantheon.tech <Jakub.Grajciar@pantheon.tech>
Diffstat (limited to 'src/vnet/devices/af_packet/af_packet_api.c')
-rw-r--r--src/vnet/devices/af_packet/af_packet_api.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/vnet/devices/af_packet/af_packet_api.c b/src/vnet/devices/af_packet/af_packet_api.c
index 414c838cdf7..c7dfabc2ebd 100644
--- a/src/vnet/devices/af_packet/af_packet_api.c
+++ b/src/vnet/devices/af_packet/af_packet_api.c
@@ -42,9 +42,10 @@
#include <vlibapi/api_helper_macros.h>
-#define foreach_vpe_api_msg \
-_(AF_PACKET_CREATE, af_packet_create) \
-_(AF_PACKET_DELETE, af_packet_delete)
+#define foreach_vpe_api_msg \
+_(AF_PACKET_CREATE, af_packet_create) \
+_(AF_PACKET_DELETE, af_packet_delete) \
+_(AF_PACKET_SET_L4_CKSUM_OFFLOAD, af_packet_set_l4_cksum_offload)
static void
vl_api_af_packet_create_t_handler (vl_api_af_packet_create_t * mp)
@@ -90,6 +91,18 @@ vl_api_af_packet_delete_t_handler (vl_api_af_packet_delete_t * mp)
REPLY_MACRO (VL_API_AF_PACKET_DELETE_REPLY);
}
+static void
+ vl_api_af_packet_set_l4_cksum_offload_t_handler
+ (vl_api_af_packet_set_l4_cksum_offload_t * mp)
+{
+ vlib_main_t *vm = vlib_get_main ();
+ vl_api_af_packet_delete_reply_t *rmp;
+ int rv = 0;
+
+ rv = af_packet_set_l4_cksum_offload (vm, mp->sw_if_index, mp->set);
+ REPLY_MACRO (VL_API_AF_PACKET_SET_L4_CKSUM_OFFLOAD_REPLY);
+}
+
/*
* af_packet_api_hookup
* Add vpe's API message handlers to the table.