return -EINVAL;
if (filter->priority > E1000_2TUPLE_MAX_PRI)
return -EINVAL; /* filter index is out of range. */
- if (filter->tcp_flags > TCP_FLAG_ALL)
+ if (filter->tcp_flags > RTE_NTUPLE_TCP_FLAGS_MASK)
return -EINVAL; /* flags is invalid. */
switch (filter->dst_port_mask) {
ttqf &= ~E1000_TTQF_MASK_ENABLE;
/* tcp flags bits setting. */
- if (filter->filter_info.tcp_flags & TCP_FLAG_ALL) {
- if (filter->filter_info.tcp_flags & TCP_URG_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_NTUPLE_TCP_FLAGS_MASK) {
+ if (filter->filter_info.tcp_flags & RTE_TCP_URG_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_URG;
- if (filter->filter_info.tcp_flags & TCP_ACK_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_ACK_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_ACK;
- if (filter->filter_info.tcp_flags & TCP_PSH_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_PSH_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_PSH;
- if (filter->filter_info.tcp_flags & TCP_RST_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_RST_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_RST;
- if (filter->filter_info.tcp_flags & TCP_SYN_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_SYN_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_SYN;
- if (filter->filter_info.tcp_flags & TCP_FIN_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_FIN_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_FIN;
} else {
imir_ext |= E1000_IMIREXT_CTRL_BP;
return -EINVAL;
if (filter->priority > E1000_2TUPLE_MAX_PRI)
return -EINVAL; /* filter index is out of range. */
- if (filter->tcp_flags > TCP_FLAG_ALL)
+ if (filter->tcp_flags > RTE_NTUPLE_TCP_FLAGS_MASK)
return -EINVAL; /* flags is invalid. */
switch (filter->dst_ip_mask) {
imir |= filter->filter_info.priority << E1000_IMIR_PRIORITY_SHIFT;
/* tcp flags bits setting. */
- if (filter->filter_info.tcp_flags & TCP_FLAG_ALL) {
- if (filter->filter_info.tcp_flags & TCP_URG_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_NTUPLE_TCP_FLAGS_MASK) {
+ if (filter->filter_info.tcp_flags & RTE_TCP_URG_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_URG;
- if (filter->filter_info.tcp_flags & TCP_ACK_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_ACK_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_ACK;
- if (filter->filter_info.tcp_flags & TCP_PSH_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_PSH_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_PSH;
- if (filter->filter_info.tcp_flags & TCP_RST_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_RST_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_RST;
- if (filter->filter_info.tcp_flags & TCP_SYN_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_SYN_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_SYN;
- if (filter->filter_info.tcp_flags & TCP_FIN_FLAG)
+ if (filter->filter_info.tcp_flags & RTE_TCP_FIN_FLAG)
imir_ext |= E1000_IMIREXT_CTRL_FIN;
} else {
imir_ext |= E1000_IMIREXT_CTRL_BP;
uint16_t tcp_urp; /**< TCP urgent pointer, if any. */
} __attribute__((__packed__));
+/**
+ * TCP Flags
+ */
+#define RTE_TCP_CWR_FLAG 0x80 /**< Congestion Window Reduced */
+#define RTE_TCP_ECE_FLAG 0x40 /**< ECN-Echo */
+#define RTE_TCP_URG_FLAG 0x20 /**< Urgent Pointer field significant */
+#define RTE_TCP_ACK_FLAG 0x10 /**< Acknowledgment field significant */
+#define RTE_TCP_PSH_FLAG 0x08 /**< Push Function */
+#define RTE_TCP_RST_FLAG 0x04 /**< Reset the connection */
+#define RTE_TCP_SYN_FLAG 0x02 /**< Synchronize sequence numbers */
+#define RTE_TCP_FIN_FLAG 0x01 /**< No more data from sender */
+
#ifdef __cplusplus
}
#endif