"flow_director_filter (port_id) mode IP (add|del|update)"
" flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)"
" src (src_ip_address) dst (dst_ip_address)"
+ " tos (tos_value) proto (proto_value) ttl (ttl_value)"
" vlan (vlan_value) flexbytes (flexbytes_value)"
" (drop|fwd) pf|vf(vf_id) queue (queue_id)"
" fd_id (fd_id_value)\n"
" flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp)"
" src (src_ip_address) (src_port)"
" dst (dst_ip_address) (dst_port)"
+ " tos (tos_value) ttl (ttl_value)"
" vlan (vlan_value) flexbytes (flexbytes_value)"
" (drop|fwd) pf|vf(vf_id) queue (queue_id)"
" fd_id (fd_id_value)\n"
" flow (ipv4-sctp|ipv6-sctp)"
" src (src_ip_address) (src_port)"
" dst (dst_ip_address) (dst_port)"
- " tag (verification_tag) vlan (vlan_value)"
+ " tag (verification_tag) "
+ " tos (tos_value) ttl (ttl_value)"
+ " vlan (vlan_value)"
" flexbytes (flexbytes_value) (drop|fwd)"
" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
" Add/Del a SCTP type flow director filter.\n\n"
"fld-8th|none) (select|add)\n"
" Set the input set for hash.\n\n"
- "set_fdir_input_set (port_id) (ipv4|ipv4-frag|"
- "ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|"
+ "set_fdir_input_set (port_id) "
+ "(ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
"ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|"
- "l2_payload) (src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|"
- "udp-src-port|udp-dst-port|tcp-src-port|tcp-dst-port|"
- "sctp-src-port|sctp-dst-port|sctp-veri-tag|fld-1st|"
- "fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|fld-7th|"
- "fld-8th|none) (select|add)\n"
+ "l2_payload) (ethertype|src-ipv4|dst-ipv4|src-ipv6|"
+ "dst-ipv6|ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|"
+ "ipv6-next-header|ipv6-hop-limits|udp-src-port|"
+ "udp-dst-port|tcp-src-port|tcp-dst-port|"
+ "sctp-src-port|sctp-dst-port|sctp-veri-tag|none)"
+ " (select|add)\n"
" Set the input set for FDir.\n\n"
);
}
uint16_t port_dst;
cmdline_fixed_string_t verify_tag;
uint32_t verify_tag_value;
+ cmdline_ipaddr_t tos;
+ uint8_t tos_value;
+ cmdline_ipaddr_t proto;
+ uint8_t proto_value;
+ cmdline_ipaddr_t ttl;
+ uint8_t ttl_value;
cmdline_fixed_string_t vlan;
uint16_t vlan_value;
cmdline_fixed_string_t flexbytes;
switch (entry.input.flow_type) {
case RTE_ETH_FLOW_FRAG_IPV4:
case RTE_ETH_FLOW_NONFRAG_IPV4_OTHER:
+ entry.input.flow.ip4_flow.proto = res->proto_value;
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.ip4_flow.src_ip);
+ entry.input.flow.ip4_flow.tos = res->tos_value;
+ entry.input.flow.ip4_flow.ttl = res->ttl_value;
/* need convert to big endian. */
entry.input.flow.udp4_flow.dst_port =
rte_cpu_to_be_16(res->port_dst);
entry.input.flow.sctp4_flow.ip.dst_ip);
IPV4_ADDR_TO_UINT(res->ip_src,
entry.input.flow.sctp4_flow.ip.src_ip);
+ entry.input.flow.ip4_flow.tos = res->tos_value;
+ entry.input.flow.ip4_flow.ttl = res->ttl_value;
/* need convert to big endian. */
entry.input.flow.sctp4_flow.dst_port =
rte_cpu_to_be_16(res->port_dst);
break;
case RTE_ETH_FLOW_FRAG_IPV6:
case RTE_ETH_FLOW_NONFRAG_IPV6_OTHER:
+ entry.input.flow.ipv6_flow.proto = res->proto_value;
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.ipv6_flow.src_ip);
+ entry.input.flow.ipv6_flow.tc = res->tos_value;
+ entry.input.flow.ipv6_flow.hop_limits = res->ttl_value;
/* need convert to big endian. */
entry.input.flow.udp6_flow.dst_port =
rte_cpu_to_be_16(res->port_dst);
entry.input.flow.sctp6_flow.ip.dst_ip);
IPV6_ADDR_TO_ARRAY(res->ip_src,
entry.input.flow.sctp6_flow.ip.src_ip);
+ entry.input.flow.ipv6_flow.tc = res->tos_value;
+ entry.input.flow.ipv6_flow.hop_limits = res->ttl_value;
/* need convert to big endian. */
entry.input.flow.sctp6_flow.dst_port =
rte_cpu_to_be_16(res->port_dst);
cmdline_parse_token_num_t cmd_flow_director_verify_tag_value =
TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
verify_tag_value, UINT32);
+cmdline_parse_token_string_t cmd_flow_director_tos =
+ TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+ tos, "tos");
+cmdline_parse_token_num_t cmd_flow_director_tos_value =
+ TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+ tos_value, UINT8);
+cmdline_parse_token_string_t cmd_flow_director_proto =
+ TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+ proto, "proto");
+cmdline_parse_token_num_t cmd_flow_director_proto_value =
+ TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+ proto_value, UINT8);
+cmdline_parse_token_string_t cmd_flow_director_ttl =
+ TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+ ttl, "ttl");
+cmdline_parse_token_num_t cmd_flow_director_ttl_value =
+ TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+ ttl_value, UINT8);
cmdline_parse_token_string_t cmd_flow_director_vlan =
TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
vlan, "vlan");
(void *)&cmd_flow_director_ip_src,
(void *)&cmd_flow_director_dst,
(void *)&cmd_flow_director_ip_dst,
+ (void *)&cmd_flow_director_tos,
+ (void *)&cmd_flow_director_tos_value,
+ (void *)&cmd_flow_director_proto,
+ (void *)&cmd_flow_director_proto_value,
+ (void *)&cmd_flow_director_ttl,
+ (void *)&cmd_flow_director_ttl_value,
(void *)&cmd_flow_director_vlan,
(void *)&cmd_flow_director_vlan_value,
(void *)&cmd_flow_director_flexbytes,
(void *)&cmd_flow_director_dst,
(void *)&cmd_flow_director_ip_dst,
(void *)&cmd_flow_director_port_dst,
+ (void *)&cmd_flow_director_tos,
+ (void *)&cmd_flow_director_tos_value,
+ (void *)&cmd_flow_director_ttl,
+ (void *)&cmd_flow_director_ttl_value,
(void *)&cmd_flow_director_vlan,
(void *)&cmd_flow_director_vlan_value,
(void *)&cmd_flow_director_flexbytes,
(void *)&cmd_flow_director_port_dst,
(void *)&cmd_flow_director_verify_tag,
(void *)&cmd_flow_director_verify_tag_value,
+ (void *)&cmd_flow_director_tos,
+ (void *)&cmd_flow_director_tos_value,
+ (void *)&cmd_flow_director_ttl,
+ (void *)&cmd_flow_director_ttl_value,
(void *)&cmd_flow_director_vlan,
(void *)&cmd_flow_director_vlan_value,
(void *)&cmd_flow_director_flexbytes,
char str[32];
enum rte_eth_input_set_field inset;
} inset_table[] = {
+ {"ethertype", RTE_ETH_INPUT_SET_L2_ETHERTYPE},
{"ovlan", RTE_ETH_INPUT_SET_L2_OUTER_VLAN},
{"ivlan", RTE_ETH_INPUT_SET_L2_INNER_VLAN},
{"src-ipv4", RTE_ETH_INPUT_SET_L3_SRC_IP4},
{"dst-ipv4", RTE_ETH_INPUT_SET_L3_DST_IP4},
{"ipv4-tos", RTE_ETH_INPUT_SET_L3_IP4_TOS},
{"ipv4-proto", RTE_ETH_INPUT_SET_L3_IP4_PROTO},
+ {"ipv4-ttl", RTE_ETH_INPUT_SET_L3_IP4_TTL},
{"src-ipv6", RTE_ETH_INPUT_SET_L3_SRC_IP6},
{"dst-ipv6", RTE_ETH_INPUT_SET_L3_DST_IP6},
{"ipv6-tc", RTE_ETH_INPUT_SET_L3_IP6_TC},
{"ipv6-next-header", RTE_ETH_INPUT_SET_L3_IP6_NEXT_HEADER},
+ {"ipv6-hop-limits", RTE_ETH_INPUT_SET_L3_IP6_HOP_LIMITS},
{"udp-src-port", RTE_ETH_INPUT_SET_L4_UDP_SRC_PORT},
{"udp-dst-port", RTE_ETH_INPUT_SET_L4_UDP_DST_PORT},
{"tcp-src-port", RTE_ETH_INPUT_SET_L4_TCP_SRC_PORT},
cmdline_parse_token_string_t cmd_set_hash_input_set_flow_type =
TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
flow_type,
- "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#ipv6#"
+ "ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#"
"ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload");
cmdline_parse_token_string_t cmd_set_hash_input_set_field =
TOKEN_STRING_INITIALIZER(struct cmd_set_hash_input_set_result,
.f = cmd_set_hash_input_set_parsed,
.data = NULL,
.help_str = "set_hash_input_set <port_id> "
- "ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|ipv6-frag|"
- "ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
+ "ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
+ "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
"ovlan|ivlan|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos|ipv4-proto|"
"ipv6-tc|ipv6-next-header|udp-src-port|udp-dst-port|tcp-src-port|"
"tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag|udp-key|"
cmdline_parse_token_string_t cmd_set_fdir_input_set_flow_type =
TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result,
flow_type,
- "ipv4#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#ipv6#"
+ "ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#ipv4-other#"
"ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#ipv6-other#l2_payload");
cmdline_parse_token_string_t cmd_set_fdir_input_set_field =
TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result,
inset_field,
- "src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#udp-src-port#udp-dst-port#"
+ "ethertype#src-ipv4#dst-ipv4#src-ipv6#dst-ipv6#"
+ "ipv4-tos#ipv4-proto#ipv4-ttl#ipv6-tc#ipv6-next-header#"
+ "ipv6-hop-limits#udp-src-port#udp-dst-port#"
"tcp-src-port#tcp-dst-port#sctp-src-port#sctp-dst-port#"
- "sctp-veri-tag#fld-1st#fld-2nd#fld-3rd#fld-4th#fld-5th#fld-6th#"
- "fld-7th#fld-8th#none");
+ "sctp-veri-tag#none");
cmdline_parse_token_string_t cmd_set_fdir_input_set_select =
TOKEN_STRING_INITIALIZER(struct cmd_set_fdir_input_set_result,
select, "select#add");
.f = cmd_set_fdir_input_set_parsed,
.data = NULL,
.help_str = "set_fdir_input_set <port_id> "
- "ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|ipv6|ipv6-frag|"
- "ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
- "src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|udp-src-port|udp-dst-port|"
- "tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag|"
- "fld-1st|fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|"
- "fld-7th|fld-8th|none select|add",
+ "ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp|ipv4-other|"
+ "ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload "
+ "ethertype|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|"
+ "ipv4-tos|ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|"
+ "ipv6-hop-limits|udp-src-port|udp-dst-port|"
+ "tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|"
+ "sctp-veri-tag|none select|add",
.tokens = {
(void *)&cmd_set_fdir_input_set_cmd,
(void *)&cmd_set_fdir_input_set_port_id,
# Commands to add flow director filters of different flow types::
flow_director_filter (port_id) mode IP (add|del|update) \
- flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)
+ flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag) \
src (src_ip_address) dst (dst_ip_address) \
+ tos (tos_value) proto (proto_value) ttl (ttl_value) \
vlan (vlan_value) flexbytes (flexbytes_value) \
(drop|fwd) pf|vf(vf_id) queue (queue_id) \
fd_id (fd_id_value)
flow (ipv4-tcp|ipv4-udp|ipv6-tcp|ipv6-udp) \
src (src_ip_address) (src_port) \
dst (dst_ip_address) (dst_port) \
+ tos (tos_value) ttl (ttl_value) \
vlan (vlan_value) flexbytes (flexbytes_value) \
(drop|fwd) queue pf|vf(vf_id) (queue_id) \
fd_id (fd_id_value)
flow_director_filter (port_id) mode IP (add|del|update) \
flow (ipv4-sctp|ipv6-sctp) \
src (src_ip_address) (src_port) \
- dst (dst_ip_address) (dst_port)
+ dst (dst_ip_address) (dst_port) \
+ tos (tos_value) ttl (ttl_value) \
tag (verification_tag) vlan (vlan_value) \
flexbytes (flexbytes_value) (drop|fwd) \
pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)
For example, to add an ipv4-udp flow type filter::
testpmd> flow_director_filter 0 add flow ipv4-udp src 2.2.2.3 32 \
- dst 2.2.2.5 33 vlan 0x1 flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1
+ dst 2.2.2.5 33 tos 2 ttl 40 vlan 0x1 flexbytes (0x88,0x48) \
+ fwd pf queue 1 fd_id 1
For example, add an ipv4-other flow type filter::
testpmd> flow_director_filter 0 add flow ipv4-other src 2.2.2.3 \
- dst 2.2.2.5 vlan 0x1 flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1
+ dst 2.2.2.5 tos 2 proto 20 ttl 40 vlan 0x1 \
+ flexbytes (0x88,0x48) fwd pf queue 1 fd_id 1
flush_flow_director
~~~~~~~~~~~~~~~~~~~
Set the input set for hash::
- set_hash_input_set (port_id) (ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp| \
- ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other| \
+ set_hash_input_set (port_id) (ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp| \
+ ipv4-other|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other| \
l2_payload) (ovlan|ivlan|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos| \
ipv4-proto|ipv6-tc|ipv6-next-header|udp-src-port|udp-dst-port| \
tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag| \
udp-key|gre-key|fld-1st|fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|fld-7th| \
fld-8th|none) (select|add)
-For example, to add source IP to hash input set for flow type of ipv4 on port 0::
+For example, to add source IP to hash input set for flow type of ipv4-udp on port 0::
- testpmd> set_hash_input_set 0 ipv4 src-ipv4 add
+ testpmd> set_hash_input_set 0 ipv4-udp src-ipv4 add
set_fdir_input_set
~~~~~~~~~~~~~~~~~~
-Set the input set for Fdir::
+The Flow Director filters can match the different fields for different type of packet, i.e. specific input set
+on per flow type and the flexible payload. This command can be used to change input set for each flow type.
- set_fdir_input_set (port_id) (ipv4|ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp| \
- ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other|l2_payload)
- (src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|udp-src-port|udp-dst-port| \
- tcp-src-port|tcp-dst-port|sctp-src-port|sctp-dst-port|sctp-veri-tag| \
- fld-1st|fld-2nd|fld-3rd|fld-4th|fld-5th|fld-6th|fld-7th|fld-8th|none) \
- (select|add)
+Set the input set for flow director::
+
+ set_fdir_input_set (port_id) (ipv4-frag|ipv4-tcp|ipv4-udp|ipv4-sctp| \
+ ipv4-other|ipv6|ipv6-frag|ipv6-tcp|ipv6-udp|ipv6-sctp|ipv6-other| \
+ l2_payload) (ethertype|src-ipv4|dst-ipv4|src-ipv6|dst-ipv6|ipv4-tos| \
+ ipv4-proto|ipv4-ttl|ipv6-tc|ipv6-next-header|ipv6-hop-limits| \
+ tudp-src-port|udp-dst-port|cp-src-port|tcp-dst-port|sctp-src-port| \
+ sctp-dst-port|sctp-veri-tag|none) (select|add)
-For example to add source IP to FD input set for flow type of ipv4 on port 0::
+For example to add source IP to FD input set for flow type of ipv4-udp on port 0::
- testpmd> set_fdir_input_set 0 ipv4 src-ipv4 add
+ testpmd> set_fdir_input_set 0 ipv4-udp src-ipv4 add
global_config
~~~~~~~~~~~~~