" Add/Del a flex filter.\n\n"
"flow_director_filter (port_id) (add|del|update)"
- " flow (ip4|ip4-frag|ip6|ip6-frag)"
+ " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)"
" src (src_ip_address) dst (dst_ip_address)"
" vlan (vlan_value) flexbytes (flexbytes_value)"
" (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del an IP type flow director filter.\n\n"
"flow_director_filter (port_id) (add|del|update)"
- " flow (udp4|tcp4|udp6|tcp6)"
+ " flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp)"
" src (src_ip_address) (src_port)"
" dst (dst_ip_address) (dst_port)"
" vlan (vlan_value) flexbytes (flexbytes_value)"
" Add/Del an UDP/TCP type flow director filter.\n\n"
"flow_director_filter (port_id) (add|del|update)"
- " flow (sctp4|sctp6)"
+ " flow (ipv4-sctp|ipv6-sctp)"
" src (src_ip_address) (src_port)"
" dst (dst_ip_address) (dst_port)"
" tag (verification_tag) vlan (vlan_value)"
"flow_director_flex_mask (port_id)"
" flow (raw|ip4|ip4-frag|tcp4|udp4|sctp4|ip6|ip6-frag|tcp6|udp6|sctp6|all)"
+ " flow (raw|ipv4-other|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|"
+ "ipv6-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|all)"
" (mask)\n"
" Configure mask of flex payload.\n\n"
" Get the global configurations of hash filters.\n\n"
"set_hash_global_config (port_id) (toeplitz|simple_xor|default)"
- " (ip4|ip4-frag|tcp4|udp4|#sctp4|ip6|ip6-frag|tcp6|udp6|sctp6)"
+ " (ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|"
+ "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload)"
" (enable|disable)\n"
" Set the global configurations of hash filters.\n\n"
);
return ret;
}
-static enum rte_eth_flow_type
+static uint16_t
str2flowtype(char *string)
{
uint8_t i = 0;
static const struct {
char str[32];
- enum rte_eth_flow_type type;
+ uint16_t type;
} flowtype_str[] = {
- {"raw", RTE_ETH_FLOW_TYPE_RAW},
- {"ip4", RTE_ETH_FLOW_TYPE_IPV4_OTHER},
- {"ip4-frag", RTE_ETH_FLOW_TYPE_FRAG_IPV4},
- {"udp4", RTE_ETH_FLOW_TYPE_UDPV4},
- {"tcp4", RTE_ETH_FLOW_TYPE_TCPV4},
- {"sctp4", RTE_ETH_FLOW_TYPE_SCTPV4},
- {"ip6", RTE_ETH_FLOW_TYPE_IPV6_OTHER},
- {"ip6-frag", RTE_ETH_FLOW_TYPE_FRAG_IPV6},
- {"udp6", RTE_ETH_FLOW_TYPE_UDPV6},
- {"tcp6", RTE_ETH_FLOW_TYPE_TCPV6},
- {"sctp6", RTE_ETH_FLOW_TYPE_TCPV6},
+ {"raw", RTE_ETH_FLOW_RAW},
+ {"ipv4", RTE_ETH_FLOW_IPV4},
+ {"ipv4-frag", RTE_ETH_FLOW_FRAG_IPV4},
+ {"ipv4-tcp", RTE_ETH_FLOW_NONFRAG_IPV4_TCP},
+ {"ipv4-udp", RTE_ETH_FLOW_NONFRAG_IPV4_UDP},
+ {"ipv4-sctp", RTE_ETH_FLOW_NONFRAG_IPV4_SCTP},
+ {"ipv4-other", RTE_ETH_FLOW_NONFRAG_IPV4_OTHER},
+ {"ipv6", RTE_ETH_FLOW_IPV6},
+ {"ipv6-frag", RTE_ETH_FLOW_FRAG_IPV6},
+ {"ipv6-tcp", RTE_ETH_FLOW_NONFRAG_IPV6_TCP},
+ {"ipv6-udp", RTE_ETH_FLOW_NONFRAG_IPV6_UDP},
+ {"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
+ {"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
+ {"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
};
for (i = 0; i < RTE_DIM(flowtype_str); i++) {
if (!strcmp(flowtype_str[i].str, string))
return flowtype_str[i].type;
}
- return RTE_ETH_FLOW_TYPE_NONE;
+ return RTE_ETH_FLOW_UNKNOWN;
}
#define IPV4_ADDR_TO_UINT(ip_addr, ip) \
entry.input.flow_type = str2flowtype(res->flow_type);
switch (entry.input.flow_type) {
- case RTE_ETH_FLOW_TYPE_IPV4_OTHER:
- case RTE_ETH_FLOW_TYPE_FRAG_IPV4:
- case RTE_ETH_FLOW_TYPE_UDPV4:
- case RTE_ETH_FLOW_TYPE_TCPV4:
+ case RTE_ETH_FLOW_FRAG_IPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
IPV4_ADDR_TO_UINT(res->ip_dst,
entry.input.flow.ip4_flow.dst_ip);
IPV4_ADDR_TO_UINT(res->ip_src,
entry.input.flow.udp4_flow.src_port =
rte_cpu_to_be_16(res->port_src);
break;
- case RTE_ETH_FLOW_TYPE_SCTPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
IPV4_ADDR_TO_UINT(res->ip_dst,
entry.input.flow.sctp4_flow.ip.dst_ip);
IPV4_ADDR_TO_UINT(res->ip_src,
entry.input.flow.sctp4_flow.verify_tag =
rte_cpu_to_be_32(res->verify_tag_value);
break;
- case RTE_ETH_FLOW_TYPE_IPV6_OTHER:
- case RTE_ETH_FLOW_TYPE_FRAG_IPV6:
- case RTE_ETH_FLOW_TYPE_UDPV6:
- case RTE_ETH_FLOW_TYPE_TCPV6:
+ case RTE_ETH_FLOW_FRAG_IPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
IPV6_ADDR_TO_ARRAY(res->ip_dst,
entry.input.flow.ipv6_flow.dst_ip);
IPV6_ADDR_TO_ARRAY(res->ip_src,
entry.input.flow.udp6_flow.src_port =
rte_cpu_to_be_16(res->port_src);
break;
- case RTE_ETH_FLOW_TYPE_SCTPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
IPV6_ADDR_TO_ARRAY(res->ip_dst,
entry.input.flow.sctp6_flow.ip.dst_ip);
IPV6_ADDR_TO_ARRAY(res->ip_src,
flow, "flow");
cmdline_parse_token_string_t cmd_flow_director_flow_type =
TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
- flow_type,
- "ip4#ip4-frag#tcp4#udp4#sctp4#"
- "ip6#ip6-frag#tcp6#udp6#sctp6");
+ flow_type, "ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
+ "ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp");
cmdline_parse_token_string_t cmd_flow_director_src =
TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
src, "src");
struct rte_eth_fdir_info fdir_info;
struct rte_eth_fdir_flex_mask flex_mask;
struct rte_port *port;
- enum rte_eth_flow_type i;
+ uint32_t flow_type_mask;
+ uint16_t i;
int ret;
if (res->port_id > nb_ports) {
return;
}
+ memset(&fdir_info, 0, sizeof(fdir_info));
+ ret = rte_eth_dev_filter_ctrl(res->port_id, RTE_ETH_FILTER_FDIR,
+ RTE_ETH_FILTER_INFO, &fdir_info);
+ if (ret < 0) {
+ printf("Cannot get FDir filter info\n");
+ return;
+ }
+
+ flow_type_mask = fdir_info.flow_types_mask[0];
if (!strcmp(res->flow_type, "all")) {
- memset(&fdir_info, 0, sizeof(fdir_info));
- rte_eth_dev_filter_ctrl(res->port_id, RTE_ETH_FILTER_FDIR,
- RTE_ETH_FILTER_INFO, &fdir_info);
- for (i = RTE_ETH_FLOW_TYPE_RAW;
- i <= RTE_ETH_FLOW_TYPE_FRAG_IPV6;
- i++) {
- if (fdir_info.flow_types_mask[0] & (1 << i)) {
+ if (!flow_type_mask) {
+ printf("No flow type supported\n");
+ return;
+ }
+ for (i = RTE_ETH_FLOW_UNKNOWN; i < RTE_ETH_FLOW_MAX; i++) {
+ if (flow_type_mask & (1 << i)) {
flex_mask.flow_type = i;
fdir_set_flex_mask(res->port_id, &flex_mask);
}
return;
}
flex_mask.flow_type = str2flowtype(res->flow_type);
+ if (!(flow_type_mask & (1 << flex_mask.flow_type))) {
+ printf("Flow type %s not supported on port %d\n",
+ res->flow_type, res->port_id);
+ return;
+ }
fdir_set_flex_mask(res->port_id, &flex_mask);
cmd_reconfig_device_queue(res->port_id, 1, 1);
}
flow, "flow");
cmdline_parse_token_string_t cmd_flow_director_flexmask_flow_type =
TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result,
- flow_type,
- "raw#ip4#ip4-frag#tcp4#udp4#sctp4#"
- "ip6#ip6-frag#tcp6#udp6#sctp6#all");
+ flow_type, "raw#ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
+ "ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#all");
cmdline_parse_token_string_t cmd_flow_director_flexmask_mask =
TOKEN_STRING_INITIALIZER(struct cmd_flow_director_flex_mask_result,
mask, NULL);
};
static char *
-flowtype_to_str(enum rte_eth_flow_type ftype)
+flowtype_to_str(uint16_t ftype)
{
uint16_t i;
static struct {
char str[16];
- enum rte_eth_flow_type ftype;
+ uint16_t ftype;
} ftype_table[] = {
- {"ip4", RTE_ETH_FLOW_TYPE_IPV4_OTHER},
- {"ip4-frag", RTE_ETH_FLOW_TYPE_FRAG_IPV4},
- {"udp4", RTE_ETH_FLOW_TYPE_UDPV4},
- {"tcp4", RTE_ETH_FLOW_TYPE_TCPV4},
- {"sctp4", RTE_ETH_FLOW_TYPE_SCTPV4},
- {"ip6", RTE_ETH_FLOW_TYPE_IPV6_OTHER},
- {"ip6-frag", RTE_ETH_FLOW_TYPE_FRAG_IPV6},
- {"udp6", RTE_ETH_FLOW_TYPE_UDPV6},
- {"tcp6", RTE_ETH_FLOW_TYPE_TCPV6},
- {"sctp6", RTE_ETH_FLOW_TYPE_TCPV6},
+ {"ipv4", RTE_ETH_FLOW_IPV4},
+ {"ipv4-frag", RTE_ETH_FLOW_FRAG_IPV4},
+ {"ipv4-tcp", RTE_ETH_FLOW_NONFRAG_IPV4_TCP},
+ {"ipv4-udp", RTE_ETH_FLOW_NONFRAG_IPV4_UDP},
+ {"ipv4-sctp", RTE_ETH_FLOW_NONFRAG_IPV4_SCTP},
+ {"ipv4-other", RTE_ETH_FLOW_NONFRAG_IPV4_OTHER},
+ {"ipv6", RTE_ETH_FLOW_IPV6},
+ {"ipv6-frag", RTE_ETH_FLOW_FRAG_IPV6},
+ {"ipv6-tcp", RTE_ETH_FLOW_NONFRAG_IPV6_TCP},
+ {"ipv6-udp", RTE_ETH_FLOW_NONFRAG_IPV6_UDP},
+ {"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
+ {"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
+ {"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
};
for (i = 0; i < RTE_DIM(ftype_table); i++) {
{
struct cmd_get_hash_global_config_result *res = parsed_result;
struct rte_eth_hash_filter_info info;
- uint32_t idx, offset, i;
+ uint32_t idx, offset;
+ uint16_t i;
char *str;
int ret;
break;
}
- for (i = 0; i < RTE_ETH_FLOW_TYPE_MAX; i++) {
+ for (i = 0; i < RTE_ETH_FLOW_MAX; i++) {
idx = i / UINT32_BIT;
offset = i % UINT32_BIT;
if (!(info.info.global_conf.valid_bit_mask[idx] &
(1UL << offset)))
continue;
- str = flowtype_to_str((enum rte_eth_flow_type)i);
+ str = flowtype_to_str(i);
if (!str)
continue;
printf("Symmetric hash is %s globally for flow type %s "
cmdline_parse_token_string_t cmd_set_hash_global_config_flow_type =
TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result,
flow_type,
- "ip4#ip4-frag#tcp4#udp4#sctp4#ip6#ip6-frag#tcp6#udp6#sctp6");
+ "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#ipv6#"
+ "ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload");
cmdline_parse_token_string_t cmd_set_hash_global_config_enable =
TOKEN_STRING_INITIALIZER(struct cmd_set_hash_global_config_result,
enable, "enable#disable");
.data = NULL,
.help_str = "set_hash_global_config port_id "
"toeplitz|simple_xor|default "
- "ip4|ip4-frag|tcp4|udp4|#sctp4|ip6|ip6-frag|tcp6|udp6|sctp6 "
+ "ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|"
+ "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
"enable|disable",
.tokens = {
(void *)&cmd_set_hash_global_config_all,
#include "testpmd.h"
-static const char *flowtype_str[RTE_ETH_FLOW_TYPE_MAX] = {
- NULL,
- "raw",
- "udp4",
- "tcp4",
- "sctp4",
- "ip4",
- "ip4-frag",
- "udp6",
- "tcp6",
- "sctp6",
- "ip6",
- "ip6-frag",
-};
+static char *flowtype_to_str(uint16_t flow_type);
static void
print_ethaddr(const char *name, struct ether_addr *eth_addr)
printf("\n");
}
+static char *
+flowtype_to_str(uint16_t flow_type)
+{
+ struct flow_type_info {
+ char str[32];
+ uint16_t ftype;
+ };
+
+ uint8_t i;
+ static struct flow_type_info flowtype_str_table[] = {
+ {"raw", RTE_ETH_FLOW_RAW},
+ {"ipv4", RTE_ETH_FLOW_IPV4},
+ {"ipv4-frag", RTE_ETH_FLOW_FRAG_IPV4},
+ {"ipv4-tcp", RTE_ETH_FLOW_NONFRAG_IPV4_TCP},
+ {"ipv4-udp", RTE_ETH_FLOW_NONFRAG_IPV4_UDP},
+ {"ipv4-sctp", RTE_ETH_FLOW_NONFRAG_IPV4_SCTP},
+ {"ipv4-other", RTE_ETH_FLOW_NONFRAG_IPV4_OTHER},
+ {"ipv6", RTE_ETH_FLOW_IPV6},
+ {"ipv6-frag", RTE_ETH_FLOW_FRAG_IPV6},
+ {"ipv6-tcp", RTE_ETH_FLOW_NONFRAG_IPV6_TCP},
+ {"ipv6-udp", RTE_ETH_FLOW_NONFRAG_IPV6_UDP},
+ {"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
+ {"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
+ {"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
+ };
+
+ for (i = 0; i < RTE_DIM(flowtype_str_table); i++) {
+ if (flowtype_str_table[i].ftype == flow_type)
+ return flowtype_str_table[i].str;
+ }
+
+ return NULL;
+}
+
static inline void
print_fdir_flex_mask(struct rte_eth_fdir_flex_conf *flex_conf, uint32_t num)
{
struct rte_eth_fdir_flex_mask *mask;
uint32_t i, j;
+ char *p;
for (i = 0; i < flex_conf->nb_flexmasks; i++) {
mask = &flex_conf->flex_mask[i];
- printf("\n %s:\t", flowtype_str[mask->flow_type]);
+ p = flowtype_to_str(mask->flow_type);
+ printf("\n %s:\t", p ? p : "unknown");
for (j = 0; j < num; j++)
printf(" %02x", mask->mask[j]);
}
static inline void
print_fdir_flow_type(uint32_t flow_types_mask)
{
- int i = 0;
+ int i;
+ char *p;
- for (i = RTE_ETH_FLOW_TYPE_UDPV4;
- i <= RTE_ETH_FLOW_TYPE_FRAG_IPV6;
- i++) {
- if (flow_types_mask & (1 << i))
- printf(" %s", flowtype_str[i]);
+ for (i = RTE_ETH_FLOW_UNKNOWN; i < RTE_ETH_FLOW_MAX; i++) {
+ if (!(flow_types_mask & (1 << i)))
+ continue;
+ p = flowtype_to_str(i);
+ if (p)
+ printf(" %s", p);
+ else
+ printf(" unknown");
}
printf("\n");
}
port = &ports[port_id];
flex_conf = &port->dev_conf.fdir_conf.flex_conf;
- for (i = 0; i < RTE_ETH_FLOW_TYPE_MAX; i++) {
+ for (i = 0; i < RTE_ETH_FLOW_MAX; i++) {
if (cfg->flow_type == flex_conf->flex_mask[i].flow_type) {
idx = i;
break;
}
}
- if (i >= RTE_ETH_FLOW_TYPE_MAX) {
+ if (i >= RTE_ETH_FLOW_MAX) {
if (flex_conf->nb_flexmasks < RTE_DIM(flex_conf->flex_mask)) {
idx = flex_conf->nb_flexmasks;
flex_conf->nb_flexmasks++;
extern "C" {
#endif
+/*
+ * A packet can be identified by hardware as different flow types. Different
+ * NIC hardwares may support different flow types.
+ * Basically, the NIC hardware identifies the flow type as deep protocol as
+ * possible, and exclusively. For example, if a packet is identified as
+ * 'RTE_ETH_FLOW_NONFRAG_IPV4_TCP', it will not be any of other flow types,
+ * though it is an actual IPV4 packet.
+ * Note that the flow types are used to define RSS offload types in
+ * rte_ethdev.h.
+ */
+#define RTE_ETH_FLOW_UNKNOWN 0
+#define RTE_ETH_FLOW_RAW 1
+#define RTE_ETH_FLOW_IPV4 2
+#define RTE_ETH_FLOW_FRAG_IPV4 3
+#define RTE_ETH_FLOW_NONFRAG_IPV4_TCP 4
+#define RTE_ETH_FLOW_NONFRAG_IPV4_UDP 5
+#define RTE_ETH_FLOW_NONFRAG_IPV4_SCTP 6
+#define RTE_ETH_FLOW_NONFRAG_IPV4_OTHER 7
+#define RTE_ETH_FLOW_IPV6 8
+#define RTE_ETH_FLOW_FRAG_IPV6 9
+#define RTE_ETH_FLOW_NONFRAG_IPV6_TCP 10
+#define RTE_ETH_FLOW_NONFRAG_IPV6_UDP 11
+#define RTE_ETH_FLOW_NONFRAG_IPV6_SCTP 12
+#define RTE_ETH_FLOW_NONFRAG_IPV6_OTHER 13
+#define RTE_ETH_FLOW_L2_PAYLOAD 14
+#define RTE_ETH_FLOW_IPV6_EX 15
+#define RTE_ETH_FLOW_IPV6_TCP_EX 16
+#define RTE_ETH_FLOW_IPV6_UDP_EX 17
+#define RTE_ETH_FLOW_MAX 18
+
/**
* Feature filter types
*/
#define RTE_ETH_FDIR_MAX_FLEXLEN 16 /** < Max length of flexbytes. */
-/**
- * Flow type
- */
-enum rte_eth_flow_type {
- RTE_ETH_FLOW_TYPE_NONE = 0,
- RTE_ETH_FLOW_TYPE_RAW,
- RTE_ETH_FLOW_TYPE_UDPV4,
- RTE_ETH_FLOW_TYPE_TCPV4,
- RTE_ETH_FLOW_TYPE_SCTPV4,
- RTE_ETH_FLOW_TYPE_IPV4_OTHER,
- RTE_ETH_FLOW_TYPE_FRAG_IPV4,
- RTE_ETH_FLOW_TYPE_UDPV6,
- RTE_ETH_FLOW_TYPE_TCPV6,
- RTE_ETH_FLOW_TYPE_SCTPV6,
- RTE_ETH_FLOW_TYPE_IPV6_OTHER,
- RTE_ETH_FLOW_TYPE_FRAG_IPV6,
- RTE_ETH_FLOW_TYPE_MAX = 64,
-};
-
/**
* A structure used to define the input for IPV4 flow
*/
* A structure used to define the input for a flow director filter entry
*/
struct rte_eth_fdir_input {
- enum rte_eth_flow_type flow_type; /**< Type of flow */
+ uint16_t flow_type;
union rte_eth_fdir_flow flow;
/**< Flow fields to match, dependent on flow_type */
struct rte_eth_fdir_flow_ext flow_ext;
* for each flow type
*/
struct rte_eth_fdir_flex_mask {
- enum rte_eth_flow_type flow_type; /**< Flow type */
+ uint16_t flow_type;
uint8_t mask[RTE_ETH_FDIR_MAX_FLEXLEN];
/**< Mask for the whole flexible payload */
};
uint16_t nb_flexmasks; /**< The number of following mask */
struct rte_eth_flex_payload_cfg flex_set[RTE_ETH_PAYLOAD_MAX];
/**< Flex payload configuration for each payload type */
- struct rte_eth_fdir_flex_mask flex_mask[RTE_ETH_FLOW_TYPE_MAX];
+ struct rte_eth_fdir_flex_mask flex_mask[RTE_ETH_FLOW_MAX];
/**< Flex mask configuration for each flow type */
};
#define UINT32_BIT (CHAR_BIT * sizeof(uint32_t))
#define RTE_FLOW_MASK_ARRAY_SIZE \
-(RTE_ALIGN(RTE_ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT)
+ (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)
/**
* A structure used to get the information of flow director filter.
};
#define RTE_SYM_HASH_MASK_ARRAY_SIZE \
- (RTE_ALIGN(RTE_ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT)
+ (RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)
/**
* A structure used to set or get global hash function configurations which
* include symmetric hash enable per flow type and hash function type.
I40E_PFINT_ICR0_ENA_ADMINQ_MASK)
#define I40E_FLOW_TYPES ( \
- (1UL << RTE_ETH_FLOW_TYPE_UDPV4) | \
- (1UL << RTE_ETH_FLOW_TYPE_TCPV4) | \
- (1UL << RTE_ETH_FLOW_TYPE_SCTPV4) | \
- (1UL << RTE_ETH_FLOW_TYPE_IPV4_OTHER) | \
- (1UL << RTE_ETH_FLOW_TYPE_FRAG_IPV4) | \
- (1UL << RTE_ETH_FLOW_TYPE_UDPV6) | \
- (1UL << RTE_ETH_FLOW_TYPE_TCPV6) | \
- (1UL << RTE_ETH_FLOW_TYPE_SCTPV6) | \
- (1UL << RTE_ETH_FLOW_TYPE_IPV6_OTHER) | \
- (1UL << RTE_ETH_FLOW_TYPE_FRAG_IPV6))
+ (1UL << RTE_ETH_FLOW_FRAG_IPV4) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) | \
+ (1UL << RTE_ETH_FLOW_FRAG_IPV6) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) | \
+ (1UL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) | \
+ (1UL << RTE_ETH_FLOW_L2_PAYLOAD))
static int eth_i40e_dev_init(\
__attribute__((unused)) struct eth_driver *eth_drv,
struct rte_eth_hash_global_conf *g_cfg)
{
uint32_t reg, mask = I40E_FLOW_TYPES;
- uint32_t i;
+ uint16_t i;
enum i40e_filter_pctype pctype;
memset(g_cfg, 0, sizeof(*g_cfg));
PMD_DRV_LOG(DEBUG, "Hash function is %s",
(reg & I40E_GLQF_CTL_HTOEP_MASK) ? "Toeplitz" : "Simple XOR");
- for (i = 0; mask && i < RTE_ETH_FLOW_TYPE_MAX; i++) {
+ for (i = 0; mask && i < RTE_ETH_FLOW_MAX; i++) {
if (!(mask & (1UL << i)))
continue;
mask &= ~(1UL << i);
/* Bit set indicats the coresponding flow type is supported */
g_cfg->valid_bit_mask[0] |= (1UL << i);
- pctype = i40e_flowtype_to_pctype((enum rte_eth_flow_type)i);
+ pctype = i40e_flowtype_to_pctype(i);
reg = I40E_READ_REG(hw, I40E_GLQF_HSYM(pctype));
if (reg & I40E_GLQF_HSYM_SYMH_ENA_MASK)
g_cfg->sym_hash_enable_mask[0] |= (1UL << i);
struct rte_eth_hash_global_conf *g_cfg)
{
int ret;
- uint32_t i, reg;
+ uint16_t i;
+ uint32_t reg;
uint32_t mask0 = g_cfg->valid_bit_mask[0];
enum i40e_filter_pctype pctype;
if (!(mask0 & (1UL << i)))
continue;
mask0 &= ~(1UL << i);
- pctype = i40e_flowtype_to_pctype((enum rte_eth_flow_type)i);
+ pctype = i40e_flowtype_to_pctype(i);
reg = (g_cfg->sym_hash_enable_mask[0] & (1UL << i)) ?
I40E_GLQF_HSYM_SYMH_ENA_MASK : 0;
I40E_WRITE_REG(hw, I40E_GLQF_HSYM(pctype), reg);
}
enum i40e_filter_pctype
-i40e_flowtype_to_pctype(enum rte_eth_flow_type flow_type)
-{
- static const enum i40e_filter_pctype
- pctype_table[RTE_ETH_FLOW_TYPE_MAX] = {
- [RTE_ETH_FLOW_TYPE_UDPV4] = I40E_FILTER_PCTYPE_NONF_IPV4_UDP,
- [RTE_ETH_FLOW_TYPE_TCPV4] = I40E_FILTER_PCTYPE_NONF_IPV4_TCP,
- [RTE_ETH_FLOW_TYPE_SCTPV4] = I40E_FILTER_PCTYPE_NONF_IPV4_SCTP,
- [RTE_ETH_FLOW_TYPE_IPV4_OTHER] =
- I40E_FILTER_PCTYPE_NONF_IPV4_OTHER,
- [RTE_ETH_FLOW_TYPE_FRAG_IPV4] =
- I40E_FILTER_PCTYPE_FRAG_IPV4,
- [RTE_ETH_FLOW_TYPE_UDPV6] = I40E_FILTER_PCTYPE_NONF_IPV6_UDP,
- [RTE_ETH_FLOW_TYPE_TCPV6] = I40E_FILTER_PCTYPE_NONF_IPV6_TCP,
- [RTE_ETH_FLOW_TYPE_SCTPV6] = I40E_FILTER_PCTYPE_NONF_IPV6_SCTP,
- [RTE_ETH_FLOW_TYPE_IPV6_OTHER] =
- I40E_FILTER_PCTYPE_NONF_IPV6_OTHER,
- [RTE_ETH_FLOW_TYPE_FRAG_IPV6] =
- I40E_FILTER_PCTYPE_FRAG_IPV6,
+i40e_flowtype_to_pctype(uint16_t flow_type)
+{
+ static const enum i40e_filter_pctype pctype_table[] = {
+ [RTE_ETH_FLOW_FRAG_IPV4] = I40E_FILTER_PCTYPE_FRAG_IPV4,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_UDP] =
+ I40E_FILTER_PCTYPE_NONF_IPV4_UDP,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_TCP] =
+ I40E_FILTER_PCTYPE_NONF_IPV4_TCP,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_SCTP] =
+ I40E_FILTER_PCTYPE_NONF_IPV4_SCTP,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_OTHER] =
+ I40E_FILTER_PCTYPE_NONF_IPV4_OTHER,
+ [RTE_ETH_FLOW_FRAG_IPV6] = I40E_FILTER_PCTYPE_FRAG_IPV6,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_UDP] =
+ I40E_FILTER_PCTYPE_NONF_IPV6_UDP,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_TCP] =
+ I40E_FILTER_PCTYPE_NONF_IPV6_TCP,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_SCTP] =
+ I40E_FILTER_PCTYPE_NONF_IPV6_SCTP,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_OTHER] =
+ I40E_FILTER_PCTYPE_NONF_IPV6_OTHER,
+ [RTE_ETH_FLOW_L2_PAYLOAD] = I40E_FILTER_PCTYPE_L2_PAYLOAD,
};
return pctype_table[flow_type];
}
-enum rte_eth_flow_type
+uint16_t
i40e_pctype_to_flowtype(enum i40e_filter_pctype pctype)
{
- static const enum rte_eth_flow_type
- flowtype_table[RTE_ETH_FLOW_TYPE_MAX] = {
- [I40E_FILTER_PCTYPE_NONF_IPV4_UDP] = RTE_ETH_FLOW_TYPE_UDPV4,
- [I40E_FILTER_PCTYPE_NONF_IPV4_TCP] = RTE_ETH_FLOW_TYPE_TCPV4,
- [I40E_FILTER_PCTYPE_NONF_IPV4_SCTP] = RTE_ETH_FLOW_TYPE_SCTPV4,
+ static const uint16_t flowtype_table[] = {
+ [I40E_FILTER_PCTYPE_FRAG_IPV4] = RTE_ETH_FLOW_FRAG_IPV4,
+ [I40E_FILTER_PCTYPE_NONF_IPV4_UDP] =
+ RTE_ETH_FLOW_NONFRAG_IPV4_UDP,
+ [I40E_FILTER_PCTYPE_NONF_IPV4_TCP] =
+ RTE_ETH_FLOW_NONFRAG_IPV4_TCP,
+ [I40E_FILTER_PCTYPE_NONF_IPV4_SCTP] =
+ RTE_ETH_FLOW_NONFRAG_IPV4_SCTP,
[I40E_FILTER_PCTYPE_NONF_IPV4_OTHER] =
- RTE_ETH_FLOW_TYPE_IPV4_OTHER,
- [I40E_FILTER_PCTYPE_FRAG_IPV4] =
- RTE_ETH_FLOW_TYPE_FRAG_IPV4,
- [I40E_FILTER_PCTYPE_NONF_IPV6_UDP] = RTE_ETH_FLOW_TYPE_UDPV6,
- [I40E_FILTER_PCTYPE_NONF_IPV6_TCP] = RTE_ETH_FLOW_TYPE_TCPV6,
- [I40E_FILTER_PCTYPE_NONF_IPV6_SCTP] = RTE_ETH_FLOW_TYPE_SCTPV6,
+ RTE_ETH_FLOW_NONFRAG_IPV4_OTHER,
+ [I40E_FILTER_PCTYPE_FRAG_IPV6] = RTE_ETH_FLOW_FRAG_IPV6,
+ [I40E_FILTER_PCTYPE_NONF_IPV6_UDP] =
+ RTE_ETH_FLOW_NONFRAG_IPV6_UDP,
+ [I40E_FILTER_PCTYPE_NONF_IPV6_TCP] =
+ RTE_ETH_FLOW_NONFRAG_IPV6_TCP,
+ [I40E_FILTER_PCTYPE_NONF_IPV6_SCTP] =
+ RTE_ETH_FLOW_NONFRAG_IPV6_SCTP,
[I40E_FILTER_PCTYPE_NONF_IPV6_OTHER] =
- RTE_ETH_FLOW_TYPE_IPV6_OTHER,
- [I40E_FILTER_PCTYPE_FRAG_IPV6] =
- RTE_ETH_FLOW_TYPE_FRAG_IPV6,
+ RTE_ETH_FLOW_NONFRAG_IPV6_OTHER,
+ [I40E_FILTER_PCTYPE_L2_PAYLOAD] = RTE_ETH_FLOW_L2_PAYLOAD,
};
return flowtype_table[pctype];
int socket_id);
int i40e_fdir_configure(struct rte_eth_dev *dev);
void i40e_fdir_teardown(struct i40e_pf *pf);
-enum i40e_filter_pctype i40e_flowtype_to_pctype(
- enum rte_eth_flow_type flow_type);
-enum rte_eth_flow_type i40e_pctype_to_flowtype(
- enum i40e_filter_pctype pctype);
+enum i40e_filter_pctype i40e_flowtype_to_pctype(uint16_t flow_type);
+uint16_t i40e_pctype_to_flowtype(enum i40e_filter_pctype pctype);
int i40e_fdir_ctrl_func(struct rte_eth_dev *dev,
enum rte_filter_op filter_op,
void *arg);
hw->aq.asq_buf_size = I40E_AQ_BUF_SZ;
}
-#define I40E_VALID_FLOW_TYPE(flow_type) \
- ((flow_type) == RTE_ETH_FLOW_TYPE_UDPV4 || \
- (flow_type) == RTE_ETH_FLOW_TYPE_TCPV4 || \
- (flow_type) == RTE_ETH_FLOW_TYPE_SCTPV4 || \
- (flow_type) == RTE_ETH_FLOW_TYPE_IPV4_OTHER || \
- (flow_type) == RTE_ETH_FLOW_TYPE_FRAG_IPV4 || \
- (flow_type) == RTE_ETH_FLOW_TYPE_UDPV6 || \
- (flow_type) == RTE_ETH_FLOW_TYPE_TCPV6 || \
- (flow_type) == RTE_ETH_FLOW_TYPE_SCTPV6 || \
- (flow_type) == RTE_ETH_FLOW_TYPE_IPV6_OTHER || \
- (flow_type) == RTE_ETH_FLOW_TYPE_FRAG_IPV6)
+#define I40E_VALID_FLOW(flow_type) \
+ ((flow_type) == RTE_ETH_FLOW_FRAG_IPV4 || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV4_TCP || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV4_UDP || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV4_SCTP || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV4_OTHER || \
+ (flow_type) == RTE_ETH_FLOW_FRAG_IPV6 || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV6_TCP || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV6_UDP || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV6_SCTP || \
+ (flow_type) == RTE_ETH_FLOW_NONFRAG_IPV6_OTHER || \
+ (flow_type) == RTE_ETH_FLOW_L2_PAYLOAD)
#define I40E_VALID_PCTYPE(pctype) \
- ((pctype) == I40E_FILTER_PCTYPE_NONF_IPV4_UDP || \
+ ((pctype) == I40E_FILTER_PCTYPE_FRAG_IPV4 || \
(pctype) == I40E_FILTER_PCTYPE_NONF_IPV4_TCP || \
+ (pctype) == I40E_FILTER_PCTYPE_NONF_IPV4_UDP || \
(pctype) == I40E_FILTER_PCTYPE_NONF_IPV4_SCTP || \
(pctype) == I40E_FILTER_PCTYPE_NONF_IPV4_OTHER || \
- (pctype) == I40E_FILTER_PCTYPE_FRAG_IPV4 || \
+ (pctype) == I40E_FILTER_PCTYPE_FRAG_IPV6 || \
(pctype) == I40E_FILTER_PCTYPE_NONF_IPV6_UDP || \
(pctype) == I40E_FILTER_PCTYPE_NONF_IPV6_TCP || \
(pctype) == I40E_FILTER_PCTYPE_NONF_IPV6_SCTP || \
(pctype) == I40E_FILTER_PCTYPE_NONF_IPV6_OTHER || \
- (pctype) == I40E_FILTER_PCTYPE_FRAG_IPV6)
+ (pctype) == I40E_FILTER_PCTYPE_L2_PAYLOAD)
#endif /* _I40E_ETHDEV_H_ */
I40E_PRTQF_FLX_PIT_DEST_OFF_SHIFT) & \
I40E_PRTQF_FLX_PIT_DEST_OFF_MASK))
-#define I40E_FDIR_FLOW_TYPES ( \
- (1 << RTE_ETH_FLOW_TYPE_UDPV4) | \
- (1 << RTE_ETH_FLOW_TYPE_TCPV4) | \
- (1 << RTE_ETH_FLOW_TYPE_SCTPV4) | \
- (1 << RTE_ETH_FLOW_TYPE_IPV4_OTHER) | \
- (1 << RTE_ETH_FLOW_TYPE_FRAG_IPV4) | \
- (1 << RTE_ETH_FLOW_TYPE_UDPV6) | \
- (1 << RTE_ETH_FLOW_TYPE_TCPV6) | \
- (1 << RTE_ETH_FLOW_TYPE_SCTPV6) | \
- (1 << RTE_ETH_FLOW_TYPE_IPV6_OTHER) | \
- (1 << RTE_ETH_FLOW_TYPE_FRAG_IPV6))
+#define I40E_FDIR_FLOWS ( \
+ (1 << RTE_ETH_FLOW_FRAG_IPV4) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_UDP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_TCP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) | \
+ (1 << RTE_ETH_FLOW_FRAG_IPV6) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_UDP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_TCP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER))
#define I40E_FLEX_WORD_MASK(off) (0x80 >> (off))
}
/* check flex mask setting configuration */
- if (conf->nb_flexmasks > RTE_ETH_FLOW_TYPE_FRAG_IPV6) {
+ if (conf->nb_flexmasks >= RTE_ETH_FLOW_MAX) {
PMD_DRV_LOG(ERR, "invalid number of flex masks.");
return -EINVAL;
}
for (i = 0; i < conf->nb_flexmasks; i++) {
flex_mask = &conf->flex_mask[i];
- if (!I40E_VALID_FLOW_TYPE(flex_mask->flow_type)) {
+ if (!I40E_VALID_FLOW(flex_mask->flow_type)) {
PMD_DRV_LOG(WARNING, "invalid flow type.");
return -EINVAL;
}
struct ipv4_hdr *ip;
struct ipv6_hdr *ip6;
static const uint8_t next_proto[] = {
- [RTE_ETH_FLOW_TYPE_UDPV4] = IPPROTO_UDP,
- [RTE_ETH_FLOW_TYPE_TCPV4] = IPPROTO_TCP,
- [RTE_ETH_FLOW_TYPE_SCTPV4] = IPPROTO_SCTP,
- [RTE_ETH_FLOW_TYPE_IPV4_OTHER] = IPPROTO_IP,
- [RTE_ETH_FLOW_TYPE_FRAG_IPV4] = IPPROTO_IP,
- [RTE_ETH_FLOW_TYPE_UDPV6] = IPPROTO_UDP,
- [RTE_ETH_FLOW_TYPE_TCPV6] = IPPROTO_TCP,
- [RTE_ETH_FLOW_TYPE_SCTPV6] = IPPROTO_SCTP,
- [RTE_ETH_FLOW_TYPE_IPV6_OTHER] = IPPROTO_NONE,
- [RTE_ETH_FLOW_TYPE_FRAG_IPV6] = IPPROTO_NONE,
+ [RTE_ETH_FLOW_FRAG_IPV4] = IPPROTO_IP,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_TCP] = IPPROTO_TCP,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_UDP] = IPPROTO_UDP,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_SCTP] = IPPROTO_SCTP,
+ [RTE_ETH_FLOW_NONFRAG_IPV4_OTHER] = IPPROTO_IP,
+ [RTE_ETH_FLOW_FRAG_IPV6] = IPPROTO_NONE,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_TCP] = IPPROTO_TCP,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_UDP] = IPPROTO_UDP,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_SCTP] = IPPROTO_SCTP,
+ [RTE_ETH_FLOW_NONFRAG_IPV6_OTHER] = IPPROTO_NONE,
};
switch (fdir_input->flow_type) {
- case RTE_ETH_FLOW_TYPE_UDPV4:
- case RTE_ETH_FLOW_TYPE_TCPV4:
- case RTE_ETH_FLOW_TYPE_SCTPV4:
- case RTE_ETH_FLOW_TYPE_IPV4_OTHER:
- case RTE_ETH_FLOW_TYPE_FRAG_IPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
+ case RTE_ETH_FLOW_FRAG_IPV4:
ip = (struct ipv4_hdr *)(raw_pkt + sizeof(struct ether_hdr));
ether->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4);
ip->dst_addr = fdir_input->flow.ip4_flow.src_ip;
ip->next_proto_id = next_proto[fdir_input->flow_type];
break;
- case RTE_ETH_FLOW_TYPE_UDPV6:
- case RTE_ETH_FLOW_TYPE_TCPV6:
- case RTE_ETH_FLOW_TYPE_SCTPV6:
- case RTE_ETH_FLOW_TYPE_IPV6_OTHER:
- case RTE_ETH_FLOW_TYPE_FRAG_IPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
+ case RTE_ETH_FLOW_FRAG_IPV6:
ip6 = (struct ipv6_hdr *)(raw_pkt + sizeof(struct ether_hdr));
ether->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6);
/* fill the L4 head */
switch (fdir_input->flow_type) {
- case RTE_ETH_FLOW_TYPE_UDPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
udp = (struct udp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv4_hdr));
payload = (unsigned char *)udp + sizeof(struct udp_hdr);
udp->dgram_len = rte_cpu_to_be_16(I40E_FDIR_UDP_DEFAULT_LEN);
break;
- case RTE_ETH_FLOW_TYPE_TCPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
tcp = (struct tcp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv4_hdr));
payload = (unsigned char *)tcp + sizeof(struct tcp_hdr);
tcp->data_off = I40E_FDIR_TCP_DEFAULT_DATAOFF;
break;
- case RTE_ETH_FLOW_TYPE_SCTPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
sctp = (struct sctp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv4_hdr));
payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
sctp->tag = fdir_input->flow.sctp4_flow.verify_tag;
break;
- case RTE_ETH_FLOW_TYPE_IPV4_OTHER:
- case RTE_ETH_FLOW_TYPE_FRAG_IPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
+ case RTE_ETH_FLOW_FRAG_IPV4:
payload = raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv4_hdr);
set_idx = I40E_FLXPLD_L3_IDX;
break;
- case RTE_ETH_FLOW_TYPE_UDPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
udp = (struct udp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv6_hdr));
payload = (unsigned char *)udp + sizeof(struct udp_hdr);
udp->dgram_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN);
break;
- case RTE_ETH_FLOW_TYPE_TCPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
tcp = (struct tcp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv6_hdr));
payload = (unsigned char *)tcp + sizeof(struct tcp_hdr);
tcp->dst_port = fdir_input->flow.udp6_flow.src_port;
break;
- case RTE_ETH_FLOW_TYPE_SCTPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
sctp = (struct sctp_hdr *)(raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv6_hdr));
payload = (unsigned char *)sctp + sizeof(struct sctp_hdr);
sctp->tag = fdir_input->flow.sctp6_flow.verify_tag;
break;
- case RTE_ETH_FLOW_TYPE_IPV6_OTHER:
- case RTE_ETH_FLOW_TYPE_FRAG_IPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
+ case RTE_ETH_FLOW_FRAG_IPV6:
payload = raw_pkt + sizeof(struct ether_hdr) +
sizeof(struct ipv6_hdr);
set_idx = I40E_FLXPLD_L3_IDX;
return -ENOTSUP;
}
- if (!I40E_VALID_FLOW_TYPE(filter->input.flow_type)) {
+ if (!I40E_VALID_FLOW(filter->input.flow_type)) {
PMD_DRV_LOG(ERR, "invalid flow_type input.");
return -EINVAL;
}
{
struct i40e_fdir_flex_mask *mask;
struct rte_eth_fdir_flex_mask *ptr = flex_mask;
- enum rte_eth_flow_type flow_type;
+ uint16_t flow_type;
uint8_t i, j;
uint16_t off_bytes, mask_tmp;
fdir->best_spc =
(uint32_t)hw->func_caps.fd_filters_best_effort;
fdir->max_flexpayload = I40E_FDIR_MAX_FLEX_LEN;
- fdir->flow_types_mask[0] = I40E_FDIR_FLOW_TYPES;
+ fdir->flow_types_mask[0] = I40E_FDIR_FLOWS;
fdir->flex_payload_unit = sizeof(uint16_t);
fdir->flex_bitmask_unit = sizeof(uint16_t);
fdir->max_flex_payload_segment_num = I40E_MAX_FLXPLD_FIED;
#define IXGBE_FDIRCMD_CMD_INTERVAL_US 10
#define IXGBE_FDIR_FLOW_TYPES ( \
- (1 << RTE_ETH_FLOW_TYPE_UDPV4) | \
- (1 << RTE_ETH_FLOW_TYPE_TCPV4) | \
- (1 << RTE_ETH_FLOW_TYPE_SCTPV4) | \
- (1 << RTE_ETH_FLOW_TYPE_IPV4_OTHER) | \
- (1 << RTE_ETH_FLOW_TYPE_UDPV6) | \
- (1 << RTE_ETH_FLOW_TYPE_TCPV6) | \
- (1 << RTE_ETH_FLOW_TYPE_SCTPV6) | \
- (1 << RTE_ETH_FLOW_TYPE_IPV6_OTHER))
+ (1 << RTE_ETH_FLOW_FRAG_IPV4) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_UDP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_TCP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) | \
+ (1 << RTE_ETH_FLOW_FRAG_IPV4) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_UDP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_TCP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) | \
+ (1 << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER))
#define IPV6_ADDR_TO_MASK(ipaddr, ipv6m) do { \
uint8_t ipv6_addr[16]; \
for (i = 0; i < conf->nb_flexmasks; i++) {
flex_mask = &conf->flex_mask[i];
- if (flex_mask->flow_type != RTE_ETH_FLOW_TYPE_RAW) {
+ if (flex_mask->flow_type != RTE_ETH_FLOW_RAW) {
PMD_DRV_LOG(ERR, "unsupported flow type.");
return -EINVAL;
}
(fdir_filter->input.flow_ext.flexbytes[0] & 0xFF));
switch (fdir_filter->input.flow_type) {
- case RTE_ETH_FLOW_TYPE_UDPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_UDPV4;
break;
- case RTE_ETH_FLOW_TYPE_TCPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_TCPV4;
break;
- case RTE_ETH_FLOW_TYPE_SCTPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_SCTPV4;
break;
- case RTE_ETH_FLOW_TYPE_IPV4_OTHER:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_IPV4;
break;
- case RTE_ETH_FLOW_TYPE_UDPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_UDPV6;
break;
- case RTE_ETH_FLOW_TYPE_TCPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_TCPV6;
break;
- case RTE_ETH_FLOW_TYPE_SCTPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_SCTPV6;
break;
- case RTE_ETH_FLOW_TYPE_IPV6_OTHER:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
input->formatted.flow_type = IXGBE_ATR_FLOW_TYPE_IPV6;
break;
default:
}
switch (fdir_filter->input.flow_type) {
- case RTE_ETH_FLOW_TYPE_UDPV4:
- case RTE_ETH_FLOW_TYPE_TCPV4:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_UDP:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
input->formatted.src_port =
fdir_filter->input.flow.udp4_flow.src_port;
input->formatted.dst_port =
fdir_filter->input.flow.udp4_flow.dst_port;
/*for SCTP flow type, port and verify_tag are meaningless in ixgbe.*/
- case RTE_ETH_FLOW_TYPE_SCTPV4:
- case RTE_ETH_FLOW_TYPE_IPV4_OTHER:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_SCTP:
+ case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
input->formatted.src_ip[0] =
fdir_filter->input.flow.ip4_flow.src_ip;
input->formatted.dst_ip[0] =
fdir_filter->input.flow.ip4_flow.dst_ip;
break;
- case RTE_ETH_FLOW_TYPE_UDPV6:
- case RTE_ETH_FLOW_TYPE_TCPV6:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_UDP:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
input->formatted.src_port =
fdir_filter->input.flow.udp6_flow.src_port;
input->formatted.dst_port =
fdir_filter->input.flow.udp6_flow.dst_port;
/*for SCTP flow type, port and verify_tag are meaningless in ixgbe.*/
- case RTE_ETH_FLOW_TYPE_SCTPV6:
- case RTE_ETH_FLOW_TYPE_IPV6_OTHER:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_SCTP:
+ case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
rte_memcpy(input->formatted.src_ip,
fdir_filter->input.flow.ipv6_flow.src_ip,
sizeof(input->formatted.src_ip));
fdir_info->flex_conf.flex_set[0].src_offset[0] = offset;
fdir_info->flex_conf.flex_set[0].src_offset[1] = offset + 1;
fdir_info->flex_conf.nb_flexmasks = 1;
- fdir_info->flex_conf.flex_mask[0].flow_type = RTE_ETH_FLOW_TYPE_RAW;
+ fdir_info->flex_conf.flex_mask[0].flow_type = RTE_ETH_FLOW_RAW;
fdir_info->flex_conf.flex_mask[0].mask[0] =
(uint8_t)(info->mask.flex_bytes_mask & 0x00FF);
fdir_info->flex_conf.flex_mask[0].mask[1] =