DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
To: dev@dpdk.org
Cc: Felix Marti <felix@chelsio.com>,
	Kumar Sanghvi <kumaras@chelsio.com>,
	Nirranjan Kirubaharan <nirranjan@chelsio.com>
Subject: [dpdk-dev] [RFC v2 2/2] testpmd: add an example to show packet filter flow
Date: Wed, 23 Dec 2015 18:11:21 +0530	[thread overview]
Message-ID: <d0e42a9aa186c35ec114845d7f660d0f5bdfa666.1450448999.git.rahul.lakkireddy@chelsio.com> (raw)
In-Reply-To: <cover.1450448999.git.rahul.lakkireddy@chelsio.com>
In-Reply-To: <cover.1450448999.git.rahul.lakkireddy@chelsio.com>

Extend the existing flow_director_filter to add support for packet
filter flow.  Also shows how to pass the extra behavior arguments
to rewrite fields in matched filter rules.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Kumar Sanghvi <kumaras@chelsio.com>
---
v2:
1. Added new field filter-type to allow specifying maskfull vs maskless
   filter types.
2. Added new field filter-prio to allow specifying the priority between
   maskfull and maskless filters i.e. if we have a maskfull and a
   maskless filter both of which can match a single traffic pattern
   then, which one takes the priority is determined by filter-prio.
3. Added new field flow-label to be matched for ipv6.
4. Added new mac-swap behavior argument.


 app/test-pmd/cmdline.c | 528 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 520 insertions(+), 8 deletions(-)

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 73298c9..3402f2c 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -641,7 +641,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" 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) pf|vf(vf_id) queue (queue_id)"
+			" (drop|fwd|switch) pf|vf(vf_id) queue (queue_id)"
 			" fd_id (fd_id_value)\n"
 			"    Add/Del an IP type flow director filter.\n\n"
 
@@ -650,7 +650,7 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" src (src_ip_address) (src_port)"
 			" dst (dst_ip_address) (dst_port)"
 			" vlan (vlan_value) flexbytes (flexbytes_value)"
-			" (drop|fwd) pf|vf(vf_id) queue (queue_id)"
+			" (drop|fwd|switch) pf|vf(vf_id) queue (queue_id)"
 			" fd_id (fd_id_value)\n"
 			"    Add/Del an UDP/TCP type flow director filter.\n\n"
 
@@ -659,16 +659,41 @@ static void cmd_help_long_parsed(void *parsed_result,
 			" src (src_ip_address) (src_port)"
 			" dst (dst_ip_address) (dst_port)"
 			" tag (verification_tag) vlan (vlan_value)"
-			" flexbytes (flexbytes_value) (drop|fwd)"
+			" flexbytes (flexbytes_value) (drop|fwd|switch)"
 			" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
 			"    Add/Del a SCTP type flow director filter.\n\n"
 
 			"flow_director_filter (port_id) mode IP (add|del|update)"
 			" flow l2_payload ether (ethertype)"
-			" flexbytes (flexbytes_value) (drop|fwd)"
+			" flexbytes (flexbytes_value) (drop|fwd|switch)"
 			" pf|vf(vf_id) queue (queue_id) fd_id (fd_id_value)\n"
 			"    Add/Del a l2 payload type flow director filter.\n\n"
 
+			"flow_director_filter (port_id) mode IP (add|del|update)"
+			" flow (ipv4-tcp-pkt-filter|ipv4-udp-pkt-filter"
+			" ipv6-tcp-pkt-filter|ipv6-udp-pkt-filter)"
+			" filter-type maskfull|maskless"
+			" filter-prio default|maskfull|maskless"
+			" ingress-port (port_id) (port_id_mask)"
+			" ether (ethertype) (ethertype_mask)"
+			" inner-vlan (inner_vlan_value) (inner_vlan_mask)"
+			" outer-vlan (outer_vlan_value) (outer_vlan_mask)"
+			" tos (tos_value) (tos_mask)"
+			" flow-label (flow_label_value) (flow_label_mask)"
+			" proto (proto_value) (proto_mask)"
+			" ttl (ttl_value) (ttl_mask)"
+			" src (src_ip) (src_ip_mask) (src_port) (src_port_mask)"
+			" dst (dst_ip) (dst_ip_mask) (dst_port) (dst_port_mask)"
+			" flexbytes (flexbytes_value) (drop|fwd|switch)"
+			" pf|vf(vf_id) queue (queue_id)"
+			" port-arg none|port-redirect (dst-port-id)"
+			" mac-arg none|mac-rewrite|mac-swap (src-mac) (dst-mac)"
+			" vlan-arg none|vlan-rewrite|vlan-del (vlan_value)"
+			" nat-arg none|nat-rewrite"
+			" src (src_ip) (src_port) dst (dst_ip) (dst_port)"
+			" fd_id (fd_id_value)\n"
+			"    Add/Del a packet filter type flow director filter.\n\n"
+
 			"flow_director_filter (port_id) mode MAC-VLAN (add|del|update)"
 			" mac (mac_address) vlan (vlan_value)"
 			" flexbytes (flexbytes_value) (drop|fwd)"
@@ -7973,14 +7998,44 @@ struct cmd_flow_director_result {
 	cmdline_fixed_string_t ops;
 	cmdline_fixed_string_t flow;
 	cmdline_fixed_string_t flow_type;
+	cmdline_fixed_string_t filter_type;
+	cmdline_fixed_string_t filter_type_value;
+	cmdline_fixed_string_t filter_prio;
+	cmdline_fixed_string_t filter_prio_value;
+	cmdline_fixed_string_t iport;
+	uint8_t iport_id;
+	uint8_t iport_id_mask;
 	cmdline_fixed_string_t ether;
 	uint16_t ether_type;
+	uint16_t ether_type_mask;
+	cmdline_fixed_string_t ivlan;
+	uint16_t ivlan_value;
+	uint16_t ivlan_mask;
+	cmdline_fixed_string_t ovlan;
+	uint16_t ovlan_value;
+	uint16_t ovlan_mask;
+	cmdline_fixed_string_t tos;
+	uint8_t tos_value;
+	uint8_t tos_mask;
+	cmdline_fixed_string_t proto;
+	uint8_t proto_value;
+	uint8_t proto_mask;
+	cmdline_fixed_string_t ttl;
+	uint8_t ttl_value;
+	uint8_t ttl_mask;
+	cmdline_fixed_string_t flow_label;
+	uint32_t flow_label_value;
+	uint32_t flow_label_mask;
 	cmdline_fixed_string_t src;
 	cmdline_ipaddr_t ip_src;
+	cmdline_ipaddr_t ip_src_mask;
 	uint16_t port_src;
+	uint16_t port_src_mask;
 	cmdline_fixed_string_t dst;
 	cmdline_ipaddr_t ip_dst;
+	cmdline_ipaddr_t ip_dst_mask;
 	uint16_t port_dst;
+	uint16_t port_dst_mask;
 	cmdline_fixed_string_t verify_tag;
 	uint32_t verify_tag_value;
 	cmdline_fixed_string_t vlan;
@@ -7999,6 +8054,26 @@ struct cmd_flow_director_result {
 	cmdline_fixed_string_t tunnel_type;
 	cmdline_fixed_string_t tunnel_id;
 	uint32_t tunnel_id_value;
+
+	/* Extra arguments for behavior taken */
+	cmdline_fixed_string_t port_arg;
+	cmdline_fixed_string_t port_arg_op;
+	uint8_t port_arg_port_id;
+	cmdline_fixed_string_t mac_arg;
+	cmdline_fixed_string_t mac_arg_op;
+	struct ether_addr mac_arg_src_mac;
+	struct ether_addr mac_arg_dst_mac;
+	cmdline_fixed_string_t vlan_arg;
+	cmdline_fixed_string_t vlan_arg_op;
+	uint16_t vlan_arg_vlan;
+	cmdline_fixed_string_t nat_arg;
+	cmdline_fixed_string_t nat_arg_op;
+	cmdline_fixed_string_t nat_arg_src;
+	cmdline_ipaddr_t nat_arg_ip_src;
+	uint16_t nat_arg_port_src;
+	cmdline_fixed_string_t nat_arg_dst;
+	cmdline_ipaddr_t nat_arg_ip_dst;
+	uint16_t nat_arg_port_dst;
 };
 
 static inline int
@@ -8061,6 +8136,10 @@ str2flowtype(char *string)
 		{"ipv6-sctp", RTE_ETH_FLOW_NONFRAG_IPV6_SCTP},
 		{"ipv6-other", RTE_ETH_FLOW_NONFRAG_IPV6_OTHER},
 		{"l2_payload", RTE_ETH_FLOW_L2_PAYLOAD},
+		{"ipv4-tcp-pkt-filter", RTE_ETH_FLOW_PKT_FILTER_IPV4_TCP},
+		{"ipv4-udp-pkt-filter", RTE_ETH_FLOW_PKT_FILTER_IPV4_UDP},
+		{"ipv6-tcp-pkt-filter", RTE_ETH_FLOW_PKT_FILTER_IPV6_TCP},
+		{"ipv6-udp-pkt-filter", RTE_ETH_FLOW_PKT_FILTER_IPV6_UDP},
 	};
 
 	for (i = 0; i < RTE_DIM(flowtype_str); i++) {
@@ -8090,6 +8169,31 @@ str2fdir_tunneltype(char *string)
 	return RTE_FDIR_TUNNEL_TYPE_UNKNOWN;
 }
 
+static uint16_t
+str2fdir_behavior_sub_op(char *string)
+{
+	uint16_t i = 0;
+
+	static const struct {
+		char str[32];
+		enum rte_eth_fdir_behavior_sub_op op;
+	} behavior_sub_op_str[] = {
+		{"port-redirect", RTE_FDIR_BEHAVIOR_SUB_OP_INSERT},
+		{"mac-rewrite", RTE_FDIR_BEHAVIOR_SUB_OP_INSERT},
+		{"mac-swap", RTE_FDIR_BEHAVIOR_SUB_OP_SWAP},
+		{"vlan-rewrite", RTE_FDIR_BEHAVIOR_SUB_OP_INSERT},
+		{"vlan-del", RTE_FDIR_BEHAVIOR_SUB_OP_DELETE},
+		{"nat-rewrite", RTE_FDIR_BEHAVIOR_SUB_OP_INSERT},
+	};
+
+	for (i = 0; i < RTE_DIM(behavior_sub_op_str); i++) {
+		if (!strcmp(behavior_sub_op_str[i].str, string))
+			return behavior_sub_op_str[i].op;
+	}
+
+	return RTE_FDIR_BEHAVIOR_SUB_OP_UNKNOWN;
+}
+
 #define IPV4_ADDR_TO_UINT(ip_addr, ip) \
 do { \
 	if ((ip_addr).family == AF_INET) \
@@ -8119,6 +8223,7 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 {
 	struct cmd_flow_director_result *res = parsed_result;
 	struct rte_eth_fdir_filter entry;
+	struct rte_eth_pkt_filter_flow *pflow;
 	uint8_t flexbytes[RTE_ETH_FDIR_MAX_FLEXLEN];
 	char *end;
 	unsigned long vf_id;
@@ -8218,6 +8323,126 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 		entry.input.flow.l2_flow.ether_type =
 			rte_cpu_to_be_16(res->ether_type);
 		break;
+	case RTE_ETH_FLOW_PKT_FILTER_IPV4_TCP:
+	case RTE_ETH_FLOW_PKT_FILTER_IPV4_UDP:
+		pflow = &entry.input.flow.pkt_filter_flow;
+
+		if (!strcmp(res->filter_type_value, "maskless"))
+			pflow->type = RTE_ETH_PKT_FILTER_TYPE_MASKLESS;
+		else
+			pflow->type = RTE_ETH_PKT_FILTER_TYPE_MASKFULL;
+
+		if (!strcmp(res->filter_prio_value, "default"))
+			pflow->prio = pflow->type;
+		else if (!strcmp(res->filter_prio_value, "maskless"))
+			pflow->prio = RTE_ETH_PKT_FILTER_TYPE_MASKLESS;
+		else
+			pflow->prio = RTE_ETH_PKT_FILTER_TYPE_MASKFULL;
+
+		pflow->pkt.port_id = res->iport_id;
+		pflow->mask.port_id = res->iport_id_mask;
+
+		pflow->pkt.l2_flow.ether_type =
+			rte_cpu_to_be_16(res->ether_type);
+		pflow->mask.l2_flow.ether_type =
+			rte_cpu_to_be_16(res->ether_type_mask);
+
+		pflow->pkt.vlan_flow.inner_vlan =
+			rte_cpu_to_be_16(res->ivlan_value);
+		pflow->pkt.vlan_flow.outer_vlan = res->ovlan_value;
+			rte_cpu_to_be_16(res->ovlan_value);
+		pflow->mask.vlan_flow.inner_vlan = res->ivlan_mask;
+			rte_cpu_to_be_16(res->ivlan_mask);
+		pflow->mask.vlan_flow.outer_vlan = res->ovlan_mask;
+			rte_cpu_to_be_16(res->ovlan_mask);
+
+		pflow->pkt.ntuple_flow.tcp4.ip.tos = res->tos_value;
+		pflow->pkt.ntuple_flow.tcp4.ip.proto = res->proto_value;
+		pflow->pkt.ntuple_flow.tcp4.ip.ttl = res->ttl_value;
+		pflow->mask.ntuple_flow.tcp4.ip.tos = res->tos_mask;
+		pflow->mask.ntuple_flow.tcp4.ip.proto = res->proto_mask;
+		pflow->mask.ntuple_flow.tcp4.ip.ttl = res->ttl_mask;
+
+		IPV4_ADDR_TO_UINT(res->ip_src,
+				pflow->pkt.ntuple_flow.tcp4.ip.src_ip);
+		IPV4_ADDR_TO_UINT(res->ip_dst,
+				pflow->pkt.ntuple_flow.tcp4.ip.dst_ip);
+		IPV4_ADDR_TO_UINT(res->ip_src_mask,
+				pflow->mask.ntuple_flow.tcp4.ip.src_ip);
+		IPV4_ADDR_TO_UINT(res->ip_dst_mask,
+				pflow->mask.ntuple_flow.tcp4.ip.dst_ip);
+
+		pflow->pkt.ntuple_flow.tcp4.src_port =
+			rte_cpu_to_be_16(res->port_src);
+		pflow->pkt.ntuple_flow.tcp4.dst_port =
+			rte_cpu_to_be_16(res->port_dst);
+		pflow->mask.ntuple_flow.tcp4.src_port =
+			rte_cpu_to_be_16(res->port_src_mask);
+		pflow->mask.ntuple_flow.tcp4.dst_port =
+			rte_cpu_to_be_16(res->port_dst_mask);
+		break;
+	case RTE_ETH_FLOW_PKT_FILTER_IPV6_TCP:
+	case RTE_ETH_FLOW_PKT_FILTER_IPV6_UDP:
+		pflow = &entry.input.flow.pkt_filter_flow;
+
+		if (!strcmp(res->filter_type_value, "maskless"))
+			pflow->type = RTE_ETH_PKT_FILTER_TYPE_MASKLESS;
+		else
+			pflow->type = RTE_ETH_PKT_FILTER_TYPE_MASKFULL;
+
+		if (!strcmp(res->filter_prio_value, "default"))
+			pflow->prio = pflow->type;
+		else if (!strcmp(res->filter_prio_value, "maskless"))
+			pflow->prio = RTE_ETH_PKT_FILTER_TYPE_MASKLESS;
+		else
+			pflow->prio = RTE_ETH_PKT_FILTER_TYPE_MASKFULL;
+
+		pflow->pkt.port_id = res->iport_id;
+		pflow->mask.port_id = res->iport_id_mask;
+
+		pflow->pkt.l2_flow.ether_type =
+			rte_cpu_to_be_16(res->ether_type);
+		pflow->mask.l2_flow.ether_type =
+			rte_cpu_to_be_16(res->ether_type_mask);
+
+		pflow->pkt.vlan_flow.inner_vlan =
+			rte_cpu_to_be_16(res->ivlan_value);
+		pflow->pkt.vlan_flow.outer_vlan = res->ovlan_value;
+			rte_cpu_to_be_16(res->ovlan_value);
+		pflow->mask.vlan_flow.inner_vlan = res->ivlan_mask;
+			rte_cpu_to_be_16(res->ivlan_mask);
+		pflow->mask.vlan_flow.outer_vlan = res->ovlan_mask;
+			rte_cpu_to_be_16(res->ovlan_mask);
+
+		pflow->pkt.ntuple_flow.tcp6.ip.tc = res->tos_value;
+		pflow->pkt.ntuple_flow.tcp6.ip.flow_label =
+			rte_cpu_to_be_32(res->flow_label_value);
+		pflow->pkt.ntuple_flow.tcp6.ip.next_header = res->proto_value;
+		pflow->pkt.ntuple_flow.tcp6.ip.hop_limit = res->ttl_value;
+		pflow->mask.ntuple_flow.tcp6.ip.tc = res->tos_mask;
+		pflow->mask.ntuple_flow.tcp6.ip.flow_label =
+			rte_cpu_to_be_32(res->flow_label_mask);
+		pflow->mask.ntuple_flow.tcp6.ip.next_header = res->proto_mask;
+		pflow->mask.ntuple_flow.tcp6.ip.hop_limit = res->ttl_mask;
+
+		IPV6_ADDR_TO_ARRAY(res->ip_src,
+				pflow->pkt.ntuple_flow.tcp6.ip.src_ip);
+		IPV6_ADDR_TO_ARRAY(res->ip_dst,
+				pflow->pkt.ntuple_flow.tcp6.ip.dst_ip);
+		IPV6_ADDR_TO_ARRAY(res->ip_src_mask,
+				pflow->mask.ntuple_flow.tcp6.ip.src_ip);
+		IPV6_ADDR_TO_ARRAY(res->ip_dst_mask,
+				pflow->mask.ntuple_flow.tcp6.ip.dst_ip);
+
+		pflow->pkt.ntuple_flow.tcp6.src_port =
+			rte_cpu_to_be_16(res->port_src);
+		pflow->pkt.ntuple_flow.tcp6.dst_port =
+			rte_cpu_to_be_16(res->port_dst);
+		pflow->mask.ntuple_flow.tcp6.src_port =
+			rte_cpu_to_be_16(res->port_src_mask);
+		pflow->mask.ntuple_flow.tcp6.dst_port =
+			rte_cpu_to_be_16(res->port_dst_mask);
+		break;
 	default:
 		break;
 	}
@@ -8244,10 +8469,68 @@ cmd_flow_director_filter_parsed(void *parsed_result,
 	entry.input.flow_ext.vlan_tci = rte_cpu_to_be_16(res->vlan_value);
 
 	entry.action.flex_off = 0;  /*use 0 by default */
-	if (!strcmp(res->drop, "drop"))
+	if (!strcmp(res->drop, "switch")) {
+		struct rte_eth_behavior_arg_nat *nat_arg;
+
+		entry.action.behavior = RTE_ETH_FDIR_SWITCH;
+
+		/* Extra port arguments */
+		entry.action.behavior_arg.port_arg.op =
+			str2fdir_behavior_sub_op(res->port_arg_op);
+		entry.action.behavior_arg.port_arg.port_id =
+			res->port_arg_port_id;
+
+		/* Extra mac arguments */
+		entry.action.behavior_arg.mac_arg.op =
+			str2fdir_behavior_sub_op(res->mac_arg_op);
+		(void)rte_memcpy(&entry.action.behavior_arg.mac_arg.src_mac,
+				 &res->mac_arg_src_mac,
+				 sizeof(struct ether_addr));
+		(void)rte_memcpy(&entry.action.behavior_arg.mac_arg.dst_mac,
+				 &res->mac_arg_dst_mac,
+				 sizeof(struct ether_addr));
+
+		/* Extra vlan arguments */
+		entry.action.behavior_arg.vlan_arg.op =
+			str2fdir_behavior_sub_op(res->vlan_arg_op);
+		entry.action.behavior_arg.vlan_arg.vlan_tci =
+			rte_cpu_to_be_16(res->vlan_arg_vlan);
+
+		/* Extra nat arguments */
+		nat_arg = &entry.action.behavior_arg.nat_arg;
+
+		nat_arg->op = str2fdir_behavior_sub_op(res->nat_arg_op);
+		switch (entry.input.flow_type) {
+		case RTE_ETH_FLOW_NONFRAG_IPV4_TCP:
+		case RTE_ETH_FLOW_PKT_FILTER_IPV4_TCP:
+			IPV4_ADDR_TO_UINT(res->nat_arg_ip_src,
+				nat_arg->nat.tcp4.ip.src_ip);
+			IPV4_ADDR_TO_UINT(res->nat_arg_ip_dst,
+				nat_arg->nat.tcp4.ip.dst_ip);
+			nat_arg->nat.tcp4.src_port =
+				rte_cpu_to_be_16(res->nat_arg_port_src);
+			nat_arg->nat.tcp4.dst_port =
+				rte_cpu_to_be_16(res->nat_arg_port_dst);
+			break;
+		case RTE_ETH_FLOW_NONFRAG_IPV6_TCP:
+		case RTE_ETH_FLOW_PKT_FILTER_IPV6_TCP:
+			IPV6_ADDR_TO_ARRAY(res->nat_arg_ip_src,
+				nat_arg->nat.tcp6.ip.src_ip);
+			IPV6_ADDR_TO_ARRAY(res->nat_arg_ip_dst,
+				nat_arg->nat.tcp6.ip.dst_ip);
+			nat_arg->nat.tcp6.src_port =
+				rte_cpu_to_be_16(res->nat_arg_port_src);
+			nat_arg->nat.tcp6.dst_port =
+				rte_cpu_to_be_16(res->nat_arg_port_dst);
+			break;
+		default:
+			break;
+		}
+	} else if (!strcmp(res->drop, "drop")) {
 		entry.action.behavior = RTE_ETH_FDIR_REJECT;
-	else
+	} else {
 		entry.action.behavior = RTE_ETH_FDIR_ACCEPT;
+	}
 
 	if (!strcmp(res->pf_vf, "pf"))
 		entry.input.flow_ext.is_vf = 0;
@@ -8302,31 +8585,124 @@ cmdline_parse_token_string_t cmd_flow_director_flow =
 cmdline_parse_token_string_t cmd_flow_director_flow_type =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
 		flow_type, "ipv4-other#ipv4-frag#ipv4-tcp#ipv4-udp#ipv4-sctp#"
-		"ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#l2_payload");
+		"ipv6-other#ipv6-frag#ipv6-tcp#ipv6-udp#ipv6-sctp#l2_payload#"
+		"ipv4-tcp-pkt-filter#ipv4-udp-pkt-filter#ipv6-tcp-pkt-filter#"
+		"ipv6-udp-pkt-filter");
+cmdline_parse_token_string_t cmd_flow_director_filter_type =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 filter_type, "filter-type");
+cmdline_parse_token_string_t cmd_flow_director_filter_type_value =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 filter_type_value, "maskfull#maskless");
+cmdline_parse_token_string_t cmd_flow_director_filter_prio =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 filter_prio, "filter-prio");
+cmdline_parse_token_string_t cmd_flow_director_filter_prio_value =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 filter_prio_value, "default#maskfull#"
+				 "maskless");
+cmdline_parse_token_string_t cmd_flow_director_iport =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 iport, "ingress-port");
+cmdline_parse_token_num_t cmd_flow_director_iport_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      iport_id, UINT8);
+cmdline_parse_token_num_t cmd_flow_director_iport_id_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      iport_id_mask, UINT8);
 cmdline_parse_token_string_t cmd_flow_director_ether =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
 				 ether, "ether");
 cmdline_parse_token_num_t cmd_flow_director_ether_type =
 	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
 			      ether_type, UINT16);
+cmdline_parse_token_num_t cmd_flow_director_ether_type_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      ether_type_mask, UINT16);
+cmdline_parse_token_string_t cmd_flow_director_ivlan =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 ivlan, "inner-vlan");
+cmdline_parse_token_num_t cmd_flow_director_ivlan_value =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      ivlan_value, UINT16);
+cmdline_parse_token_num_t cmd_flow_director_ivlan_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      ivlan_mask, UINT16);
+cmdline_parse_token_string_t cmd_flow_director_ovlan =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 ovlan, "outer-vlan");
+cmdline_parse_token_num_t cmd_flow_director_ovlan_value =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      ovlan_value, UINT16);
+cmdline_parse_token_num_t cmd_flow_director_ovlan_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      ovlan_mask, UINT16);
+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_num_t cmd_flow_director_tos_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      tos_mask, UINT8);
+cmdline_parse_token_string_t cmd_flow_director_flow_label =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 flow_label, "flow-label");
+cmdline_parse_token_num_t cmd_flow_director_flow_label_value =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      flow_label_value, UINT32);
+cmdline_parse_token_num_t cmd_flow_director_flow_label_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      flow_label_mask, UINT32);
+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_num_t cmd_flow_director_proto_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      proto_mask, 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_num_t cmd_flow_director_ttl_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      ttl_mask, UINT8);
 cmdline_parse_token_string_t cmd_flow_director_src =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
 				 src, "src");
 cmdline_parse_token_ipaddr_t cmd_flow_director_ip_src =
 	TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result,
 				 ip_src);
+cmdline_parse_token_ipaddr_t cmd_flow_director_ip_src_mask =
+	TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result,
+				 ip_src_mask);
 cmdline_parse_token_num_t cmd_flow_director_port_src =
 	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
 			      port_src, UINT16);
+cmdline_parse_token_num_t cmd_flow_director_port_src_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      port_src_mask, UINT16);
 cmdline_parse_token_string_t cmd_flow_director_dst =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
 				 dst, "dst");
 cmdline_parse_token_ipaddr_t cmd_flow_director_ip_dst =
 	TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result,
 				 ip_dst);
+cmdline_parse_token_ipaddr_t cmd_flow_director_ip_dst_mask =
+	TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result,
+				 ip_dst_mask);
 cmdline_parse_token_num_t cmd_flow_director_port_dst =
 	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
 			      port_dst, UINT16);
+cmdline_parse_token_num_t cmd_flow_director_port_dst_mask =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      port_dst_mask, UINT16);
 cmdline_parse_token_string_t cmd_flow_director_verify_tag =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
 				  verify_tag, "verify_tag");
@@ -8347,7 +8723,7 @@ cmdline_parse_token_string_t cmd_flow_director_flexbytes_value =
 			      flexbytes_value, NULL);
 cmdline_parse_token_string_t cmd_flow_director_drop =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
-				 drop, "drop#fwd");
+				 drop, "drop#fwd#switch");
 cmdline_parse_token_string_t cmd_flow_director_pf_vf =
 	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
 			      pf_vf, NULL);
@@ -8395,6 +8771,61 @@ cmdline_parse_token_num_t cmd_flow_director_tunnel_id_value =
 	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
 			      tunnel_id_value, UINT32);
 
+cmdline_parse_token_string_t cmd_flow_director_port_arg =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 port_arg, "port-arg");
+cmdline_parse_token_string_t cmd_flow_director_port_arg_op =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 port_arg_op, "none#port-redirect");
+cmdline_parse_token_num_t cmd_flow_director_port_arg_port_id =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      port_arg_port_id, UINT8);
+cmdline_parse_token_string_t cmd_flow_director_mac_arg =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 mac_arg, "mac-arg");
+cmdline_parse_token_string_t cmd_flow_director_mac_arg_op =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 mac_arg_op, "none#mac-rewrite#mac-swap");
+cmdline_parse_token_etheraddr_t cmd_flow_director_mac_arg_src_mac =
+	TOKEN_ETHERADDR_INITIALIZER(struct cmd_flow_director_result,
+				    mac_arg_src_mac);
+cmdline_parse_token_etheraddr_t cmd_flow_director_mac_arg_dst_mac =
+	TOKEN_ETHERADDR_INITIALIZER(struct cmd_flow_director_result,
+				    mac_arg_dst_mac);
+cmdline_parse_token_string_t cmd_flow_director_vlan_arg =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 vlan_arg, "vlan-arg");
+cmdline_parse_token_string_t cmd_flow_director_vlan_arg_op =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 vlan_arg_op, "none#vlan-rewrite#vlan-del");
+cmdline_parse_token_num_t cmd_flow_director_vlan_arg_vlan =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      vlan_arg_vlan, UINT16);
+cmdline_parse_token_string_t cmd_flow_director_nat_arg =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 nat_arg, "nat-arg");
+cmdline_parse_token_string_t cmd_flow_director_nat_arg_op =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 nat_arg_op, "none#nat-rewrite");
+cmdline_parse_token_string_t cmd_flow_director_nat_arg_src =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 nat_arg_src, "src");
+cmdline_parse_token_ipaddr_t cmd_flow_director_nat_arg_ip_src =
+	TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result,
+				 nat_arg_ip_src);
+cmdline_parse_token_num_t cmd_flow_director_nat_arg_port_src =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      nat_arg_port_src, UINT16);
+cmdline_parse_token_string_t cmd_flow_director_nat_arg_dst =
+	TOKEN_STRING_INITIALIZER(struct cmd_flow_director_result,
+				 nat_arg_dst, "dst");
+cmdline_parse_token_ipaddr_t cmd_flow_director_nat_arg_ip_dst =
+	TOKEN_IPADDR_INITIALIZER(struct cmd_flow_director_result,
+				 nat_arg_ip_dst);
+cmdline_parse_token_num_t cmd_flow_director_nat_arg_port_dst =
+	TOKEN_NUM_INITIALIZER(struct cmd_flow_director_result,
+			      nat_arg_port_dst, UINT16);
+
 cmdline_parse_inst_t cmd_add_del_ip_flow_director = {
 	.f = cmd_flow_director_filter_parsed,
 	.data = NULL,
@@ -8517,6 +8948,86 @@ cmdline_parse_inst_t cmd_add_del_l2_flow_director = {
 	},
 };
 
+cmdline_parse_inst_t cmd_add_del_pkt_filter_flow_director = {
+	.f = cmd_flow_director_filter_parsed,
+	.data = NULL,
+	.help_str = "add or delete a packet filter flow director entry on NIC",
+	.tokens = {
+		(void *)&cmd_flow_director_filter,
+		(void *)&cmd_flow_director_port_id,
+		(void *)&cmd_flow_director_mode,
+		(void *)&cmd_flow_director_mode_ip,
+		(void *)&cmd_flow_director_ops,
+		(void *)&cmd_flow_director_flow,
+		(void *)&cmd_flow_director_flow_type,
+		(void *)&cmd_flow_director_filter_type,
+		(void *)&cmd_flow_director_filter_type_value,
+		(void *)&cmd_flow_director_filter_prio,
+		(void *)&cmd_flow_director_filter_prio_value,
+		(void *)&cmd_flow_director_iport,
+		(void *)&cmd_flow_director_iport_id,
+		(void *)&cmd_flow_director_iport_id_mask,
+		(void *)&cmd_flow_director_ether,
+		(void *)&cmd_flow_director_ether_type,
+		(void *)&cmd_flow_director_ether_type_mask,
+		(void *)&cmd_flow_director_ivlan,
+		(void *)&cmd_flow_director_ivlan_value,
+		(void *)&cmd_flow_director_ivlan_mask,
+		(void *)&cmd_flow_director_ovlan,
+		(void *)&cmd_flow_director_ovlan_value,
+		(void *)&cmd_flow_director_ovlan_mask,
+		(void *)&cmd_flow_director_tos,
+		(void *)&cmd_flow_director_tos_value,
+		(void *)&cmd_flow_director_tos_mask,
+		(void *)&cmd_flow_director_flow_label,
+		(void *)&cmd_flow_director_flow_label_value,
+		(void *)&cmd_flow_director_flow_label_mask,
+		(void *)&cmd_flow_director_proto,
+		(void *)&cmd_flow_director_proto_value,
+		(void *)&cmd_flow_director_proto_mask,
+		(void *)&cmd_flow_director_ttl,
+		(void *)&cmd_flow_director_ttl_value,
+		(void *)&cmd_flow_director_ttl_mask,
+		(void *)&cmd_flow_director_src,
+		(void *)&cmd_flow_director_ip_src,
+		(void *)&cmd_flow_director_ip_src_mask,
+		(void *)&cmd_flow_director_port_src,
+		(void *)&cmd_flow_director_port_src_mask,
+		(void *)&cmd_flow_director_dst,
+		(void *)&cmd_flow_director_ip_dst,
+		(void *)&cmd_flow_director_ip_dst_mask,
+		(void *)&cmd_flow_director_port_dst,
+		(void *)&cmd_flow_director_port_dst_mask,
+		(void *)&cmd_flow_director_flexbytes,
+		(void *)&cmd_flow_director_flexbytes_value,
+		(void *)&cmd_flow_director_drop,
+		(void *)&cmd_flow_director_pf_vf,
+		(void *)&cmd_flow_director_queue,
+		(void *)&cmd_flow_director_queue_id,
+		(void *)&cmd_flow_director_port_arg,
+		(void *)&cmd_flow_director_port_arg_op,
+		(void *)&cmd_flow_director_port_arg_port_id,
+		(void *)&cmd_flow_director_mac_arg,
+		(void *)&cmd_flow_director_mac_arg_op,
+		(void *)&cmd_flow_director_mac_arg_src_mac,
+		(void *)&cmd_flow_director_mac_arg_dst_mac,
+		(void *)&cmd_flow_director_vlan_arg,
+		(void *)&cmd_flow_director_vlan_arg_op,
+		(void *)&cmd_flow_director_vlan_arg_vlan,
+		(void *)&cmd_flow_director_nat_arg,
+		(void *)&cmd_flow_director_nat_arg_op,
+		(void *)&cmd_flow_director_nat_arg_src,
+		(void *)&cmd_flow_director_nat_arg_ip_src,
+		(void *)&cmd_flow_director_nat_arg_port_src,
+		(void *)&cmd_flow_director_nat_arg_dst,
+		(void *)&cmd_flow_director_nat_arg_ip_dst,
+		(void *)&cmd_flow_director_nat_arg_port_dst,
+		(void *)&cmd_flow_director_fd_id,
+		(void *)&cmd_flow_director_fd_id_value,
+		NULL,
+	},
+};
+
 cmdline_parse_inst_t cmd_add_del_mac_vlan_flow_director = {
 	.f = cmd_flow_director_filter_parsed,
 	.data = NULL,
@@ -9756,6 +10267,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 	(cmdline_parse_inst_t *)&cmd_add_del_udp_flow_director,
 	(cmdline_parse_inst_t *)&cmd_add_del_sctp_flow_director,
 	(cmdline_parse_inst_t *)&cmd_add_del_l2_flow_director,
+	(cmdline_parse_inst_t *)&cmd_add_del_pkt_filter_flow_director,
 	(cmdline_parse_inst_t *)&cmd_add_del_mac_vlan_flow_director,
 	(cmdline_parse_inst_t *)&cmd_add_del_tunnel_flow_director,
 	(cmdline_parse_inst_t *)&cmd_flush_flow_director,
-- 
2.5.3

  parent reply	other threads:[~2015-12-23 12:41 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 14:01 [dpdk-dev] [RFC 0/3] ethdev: Enhancements to flow director filter Rahul Lakkireddy
2015-12-10 14:01 ` [dpdk-dev] [RFC 1/3] ethdev: add packet filter flow and new behavior switch to fdir Rahul Lakkireddy
2015-12-10 15:46   ` Chilikin, Andrey
2015-12-11  7:08     ` Rahul Lakkireddy
2015-12-10 14:01 ` [dpdk-dev] [RFC 2/3] testpmd: add an example to show packet filter flow Rahul Lakkireddy
2015-12-10 14:01 ` [dpdk-dev] [RFC 3/3] doc: announce ABI change for filtering support Rahul Lakkireddy
2015-12-15  8:40   ` Rahul Lakkireddy
2015-12-15  8:55     ` Thomas Monjalon
2015-12-15 13:51       ` Rahul Lakkireddy
2015-12-15 13:57         ` Thomas Monjalon
2015-12-23 12:41 ` [dpdk-dev] [RFC v2 0/2] ethdev: Enhancements to flow director filter Rahul Lakkireddy
2015-12-23 12:41   ` [dpdk-dev] [RFC v2 1/2] ethdev: add packet filter flow and new behavior switch to fdir Rahul Lakkireddy
2016-01-13  1:12     ` Wu, Jingjing
2016-01-13  8:49       ` Rahul Lakkireddy
2016-01-13 13:16         ` Wu, Jingjing
2016-01-14  8:48           ` Wu, Jingjing
2016-01-14 13:17             ` Rahul Lakkireddy
2016-01-15  1:30               ` Wu, Jingjing
2016-01-15  7:11                 ` Rahul Lakkireddy
2015-12-23 12:41   ` Rahul Lakkireddy [this message]
2016-01-11 13:50   ` [dpdk-dev] [RFC v2 0/2] ethdev: Enhancements to flow director filter Rahul Lakkireddy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0e42a9aa186c35ec114845d7f660d0f5bdfa666.1450448999.git.rahul.lakkireddy@chelsio.com \
    --to=rahul.lakkireddy@chelsio.com \
    --cc=dev@dpdk.org \
    --cc=felix@chelsio.com \
    --cc=kumaras@chelsio.com \
    --cc=nirranjan@chelsio.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).