#define HINIC_UINT32_BIT_SIZE (CHAR_BIT * sizeof(uint32_t))
#define HINIC_VFTA_SIZE (4096 / HINIC_UINT32_BIT_SIZE)
+#define HINIC_MAX_MTU_SIZE 9600
+#define HINIC_MIN_MTU_SIZE 256
+
+#define HINIC_ETH_OVERHEAD \
+ (RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + RTE_VLAN_HLEN * 2)
+
+#define HINIC_MIN_FRAME_SIZE (HINIC_MIN_MTU_SIZE + HINIC_ETH_OVERHEAD)
+#define HINIC_MAX_JUMBO_FRAME_SIZE (HINIC_MAX_MTU_SIZE + HINIC_ETH_OVERHEAD)
+
+#define HINIC_MTU_TO_PKTLEN(mtu) ((mtu) + HINIC_ETH_OVERHEAD)
+
+#define HINIC_PKTLEN_TO_MTU(pktlen) ((pktlen) - HINIC_ETH_OVERHEAD)
+
+/* The max frame size with default MTU */
+#define HINIC_ETH_MAX_LEN (RTE_ETHER_MTU + HINIC_ETH_OVERHEAD)
+
enum hinic_dev_status {
HINIC_DEV_INIT,
HINIC_DEV_CLOSE,
/*
* tunnel packet, mask must be 0xff, spec value is 1;
* normal packet, mask must be 0, spec value is 0;
- * if tunnal packet, ucode use
+ * if tunnel packet, ucode use
* sip/dip/protocol/src_port/dst_dport from inner packet
*/
u32 tunnel_flag:8;