summaryrefslogtreecommitdiffstats
path: root/src/plugins/avf/avf.h
diff options
context:
space:
mode:
authorMohammed Hawari <mohammed@hawari.fr>2020-11-06 17:58:06 +0100
committerDamjan Marion <dmarion@me.com>2020-11-15 08:52:15 +0000
commit80ac72894c721bebfa303c8baf7d7de56cc68da9 (patch)
tree26444d86cdaeaf34abf2615db1ddadca4d548b76 /src/plugins/avf/avf.h
parent798267aaa218b99daab4860fd630b9d4bb744c0d (diff)
avf: add L4 checksum offload support
Change-Id: Ie90437cf597c5d53ab1cc41ea7db15b97614e2fc Signed-off-by: Mohammed Hawari <mohammed@hawari.fr> Type: improvement
Diffstat (limited to 'src/plugins/avf/avf.h')
-rw-r--r--src/plugins/avf/avf.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/plugins/avf/avf.h b/src/plugins/avf/avf.h
index 57e71263f9e..66a791ec9b2 100644
--- a/src/plugins/avf/avf.h
+++ b/src/plugins/avf/avf.h
@@ -46,10 +46,26 @@
#define AVF_RXD_ERROR_L4E (1ULL << (AVF_RXD_ERROR_SHIFT + 4))
#define AVF_TXD_CMD(x) (1 << (x + 4))
+#define AVF_TXD_CMD_EXT(x, val) ((u64)val << (x + 4))
#define AVF_TXD_CMD_EOP AVF_TXD_CMD(0)
#define AVF_TXD_CMD_RS AVF_TXD_CMD(1)
#define AVF_TXD_CMD_RSV AVF_TXD_CMD(2)
+#define AVF_TXD_CMD_IIPT_NONE AVF_TXD_CMD_EXT(5, 0)
+#define AVF_TXD_CMD_IIPT_IPV6 AVF_TXD_CMD_EXT(5, 1)
+#define AVF_TXD_CMD_IIPT_IPV4_NO_CSUM AVF_TXD_CMD_EXT(5, 2)
+#define AVF_TXD_CMD_IIPT_IPV4 AVF_TXD_CMD_EXT(5, 3)
+
+#define AVF_TXD_CMD_L4T_UNKNOWN AVF_TXD_CMD_EXT(8, 0)
+#define AVF_TXD_CMD_L4T_TCP AVF_TXD_CMD_EXT(8, 1)
+#define AVF_TXD_CMD_L4T_SCTP AVF_TXD_CMD_EXT(8, 2)
+#define AVF_TXD_CMD_L4T_UDP AVF_TXD_CMD_EXT(8, 3)
+
+#define AVF_TXD_OFFSET(x,factor,val) (((u64)val/(u64)factor) << (16 + x))
+#define AVF_TXD_OFFSET_MACLEN(val) AVF_TXD_OFFSET( 0, 2, val)
+#define AVF_TXD_OFFSET_IPLEN(val) AVF_TXD_OFFSET( 7, 4, val)
+#define AVF_TXD_OFFSET_L4LEN(val) AVF_TXD_OFFSET(14, 4, val)
+
extern vlib_log_class_registration_t avf_log;
#define avf_log_err(dev, f, ...) \