* [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types @ 2015-01-19 6:56 Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 1/7] app/test-pmd: code style fix Helin Zhang ` (8 more replies) 0 siblings, 9 replies; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev It unifies the flow types and RSS offload types for all PMDs. Previously flow types are defined actually for i40e, and there has different RSS offloads tyeps for 1/10G and 40G seperately. This is not so convenient for application development, and not good for adding new PMDs. In addition, it enables new RSS offloads of 'tcp' and 'all' in testpmd. Helin Zhang (7): app/test-pmd: code style fix ethdev: code style fix i40e: code style fix ethdev: fix of calculating the size of flow type mask array ethdev: unification of flow types ethdev: unification of RSS offload types app/testpmd: support new rss offloads app/test-pipeline/init.c | 2 +- app/test-pmd/cmdline.c | 107 +++++++++++++++-------- app/test-pmd/config.c | 137 +++++++++++++++++++---------- examples/distributor/main.c | 9 +- examples/ip_pipeline/init.c | 2 +- examples/l3fwd-acl/main.c | 7 +- lib/librte_ether/rte_eth_ctrl.h | 91 +++++++++++--------- lib/librte_ether/rte_ethdev.h | 147 +++++++++++++------------------- lib/librte_pmd_e1000/e1000_ethdev.h | 11 +++ lib/librte_pmd_e1000/igb_ethdev.c | 1 + lib/librte_pmd_e1000/igb_rxtx.c | 27 ++---- lib/librte_pmd_i40e/i40e_ethdev.c | 126 ++++++++++++++------------- lib/librte_pmd_i40e/i40e_ethdev.h | 50 +++++------ lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1 + lib/librte_pmd_i40e/i40e_fdir.c | 91 ++++++++++---------- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 1 + lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 11 +++ lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 27 ++---- lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 1 + lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h | 6 ++ lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 10 +-- 21 files changed, 473 insertions(+), 392 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH 1/7] app/test-pmd: code style fix 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang @ 2015-01-19 6:56 ` Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 2/7] ethdev: " Helin Zhang ` (7 subsequent siblings) 8 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev Added code style fixes. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 97b6525..87dedf9 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1918,11 +1918,11 @@ fdir_get_infos(portid_t port_id) fdir_stats_border, port_id, fdir_stats_border); printf(" MODE: "); if (fdir_info.mode == RTE_FDIR_MODE_PERFECT) - printf(" PERFECT\n"); + printf(" PERFECT\n"); else if (fdir_info.mode == RTE_FDIR_MODE_SIGNATURE) - printf(" SIGNATURE\n"); + printf(" SIGNATURE\n"); else - printf(" DISABLE\n"); + printf(" DISABLE\n"); printf(" SUPPORTED FLOW TYPE: "); print_fdir_flow_type(fdir_info.flow_types_mask[0]); printf(" FLEX PAYLOAD INFO:\n"); -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH 2/7] ethdev: code style fix 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 1/7] app/test-pmd: code style fix Helin Zhang @ 2015-01-19 6:56 ` Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 3/7] i40e: " Helin Zhang ` (6 subsequent siblings) 8 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev Added code style fixes. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 5d9c387..4308eae 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -406,29 +406,29 @@ enum rte_fdir_mode { * It can be gotten to help taking specific configurations per device. */ struct rte_eth_fdir_info { - enum rte_fdir_mode mode; /**< Flow director mode */ + enum rte_fdir_mode mode; /**< Flow director mode */ + /** Flex payload configuration information */ struct rte_eth_fdir_flex_conf flex_conf; - /**< Flex payload configuration information */ - uint32_t guarant_spc; /**< Guaranteed spaces.*/ - uint32_t best_spc; /**< Best effort spaces.*/ + uint32_t guarant_spc; /**< Guaranteed spaces.*/ + uint32_t best_spc; /**< Best effort spaces.*/ + /** Bit mask for every supported flow type. */ uint32_t flow_types_mask[RTE_ETH_FLOW_TYPE_MAX / sizeof(uint32_t)]; - /**< Bit mask for every supported flow type. */ - uint32_t max_flexpayload; /**< Total flex payload in bytes. */ + uint32_t max_flexpayload; /**< Total flex payload in bytes. */ + /** Flexible payload unit in bytes. Size and alignments of all flex + payload segments should be multiplies of this value. */ uint32_t flex_payload_unit; - /**< Flexible payload unit in bytes. Size and alignments of all flex - payload segments should be multiplies of this value. */ + /** Max number of flexible payload continuous segments. + Each segment should be a multiple of flex_payload_unit.*/ uint32_t max_flex_payload_segment_num; - /**< Max number of flexible payload continuous segments. - Each segment should be a multiple of flex_payload_unit.*/ + /** Maximum src_offset in bytes allowed. It indicates that + src_offset[i] in struct rte_eth_flex_payload_cfg should be less + than this value. */ uint16_t flex_payload_limit; - /**< Maximum src_offset in bytes allowed. It indicates that - src_offset[i] in struct rte_eth_flex_payload_cfg should be - less than this value. */ + /** Flex bitmask unit in bytes. Size of flex bitmasks should be a + multiply of this value. */ uint32_t flex_bitmask_unit; - /**< Flex bitmask unit in bytes. Size of flex bitmasks should - be a multiply of this value. */ + /** Max supported size of flex bitmasks in flex_bitmask_unit */ uint32_t max_flex_bitmask_num; - /**< Max supported size of flex bitmasks in flex_bitmask_unit */ }; /** -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH 3/7] i40e: code style fix 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 1/7] app/test-pmd: code style fix Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 2/7] ethdev: " Helin Zhang @ 2015-01-19 6:56 ` Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang ` (5 subsequent siblings) 8 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev Added code style fixes. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_pmd_i40e/i40e_fdir.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/librte_pmd_i40e/i40e_fdir.c b/lib/librte_pmd_i40e/i40e_fdir.c index 68511c8..c9e535b 100644 --- a/lib/librte_pmd_i40e/i40e_fdir.c +++ b/lib/librte_pmd_i40e/i40e_fdir.c @@ -677,11 +677,8 @@ i40e_fdir_configure(struct rte_eth_dev *dev) i40e_set_flx_pld_cfg(pf, &conf->flex_set[i]); /* configure flex mask*/ for (i = 0; i < conf->nb_flexmasks; i++) { - pctype = i40e_flowtype_to_pctype( - conf->flex_mask[i].flow_type); - i40e_set_flex_mask_on_pctype(pf, - pctype, - &conf->flex_mask[i]); + pctype = i40e_flowtype_to_pctype(conf->flex_mask[i].flow_type); + i40e_set_flex_mask_on_pctype(pf, pctype, &conf->flex_mask[i]); } return ret; -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH 4/7] ethdev: fix of calculating the size of flow type mask array 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang ` (2 preceding siblings ...) 2015-01-19 6:56 ` [dpdk-dev] [PATCH 3/7] i40e: " Helin Zhang @ 2015-01-19 6:56 ` Helin Zhang [not found] ` <2108624.Ik2ARBIxyb@xps13> 2015-01-19 6:56 ` [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types Helin Zhang ` (4 subsequent siblings) 8 siblings, 1 reply; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev It wrongly calculates the size of the flow type mask array. The fix is to align the flow type maximum index ID with the number of element bit width, and then divide the number of element bit width. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 4308eae..1c15ed0 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -398,6 +398,10 @@ enum rte_fdir_mode { RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode. */ }; +#define UINT32_BIT (CHAR_BIT * sizeof(uint32_t)) +#define RTE_FLOW_TYPE_MASK_ARRAY_SIZE \ + (RTE_ALIGN(RTE_ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT) + /** * A structure used to get the information of flow director filter. * It supports RTE_ETH_FILTER_FDIR with RTE_ETH_FILTER_INFO operation. @@ -412,7 +416,7 @@ struct rte_eth_fdir_info { uint32_t guarant_spc; /**< Guaranteed spaces.*/ uint32_t best_spc; /**< Best effort spaces.*/ /** Bit mask for every supported flow type. */ - uint32_t flow_types_mask[RTE_ETH_FLOW_TYPE_MAX / sizeof(uint32_t)]; + uint32_t flow_types_mask[RTE_FLOW_TYPE_MASK_ARRAY_SIZE]; uint32_t max_flexpayload; /**< Total flex payload in bytes. */ /** Flexible payload unit in bytes. Size and alignments of all flex payload segments should be multiplies of this value. */ -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <2108624.Ik2ARBIxyb@xps13>]
* Re: [dpdk-dev] [PATCH 4/7] ethdev: fix of calculating the size of flow type mask array [not found] ` <2108624.Ik2ARBIxyb@xps13> @ 2015-02-03 5:24 ` Zhang, Helin 0 siblings, 0 replies; 24+ messages in thread From: Zhang, Helin @ 2015-02-03 5:24 UTC (permalink / raw) To: Thomas Monjalon; +Cc: dev Hi Thomas > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Monday, February 2, 2015 11:31 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 4/7] ethdev: fix of calculating the size of flow > type mask array > > Hi Helin, > > 2015-01-19 14:56, Helin Zhang: > > +#define UINT32_BIT (CHAR_BIT * sizeof(uint32_t)) > > I don't understand how UINT32_BIT is better than a simple sizeof(uint32_t)? UINT32_BIT is 32, while sizeof(uint32_t) is 4. They are different. Regards, Helin > > -- > Thomas ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang ` (3 preceding siblings ...) 2015-01-19 6:56 ` [dpdk-dev] [PATCH 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang @ 2015-01-19 6:56 ` Helin Zhang [not found] ` <98DB008FA2AC6644B40AD8C766FAB271014BDED15D@BOREAL.arubanetworks.com> [not found] ` <5329819.johOmNX3Da@xps13> 2015-01-19 6:56 ` [dpdk-dev] [PATCH 6/7] ethdev: unification of RSS offload types Helin Zhang ` (3 subsequent siblings) 8 siblings, 2 replies; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev Flow types was defined actually for i40e hardware specifically, and wasn't able to be used for defining RSS offload types of all PMDs. It removed the enum flow types, and uses macros instead with new names. The new macros can be used for defining RSS offload types later. Also modifications are made in i40e and testpmd accordingly. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/cmdline.c | 88 ++++++++++++++++++++++++--------------- app/test-pmd/config.c | 71 +++++++++++++++++++++---------- lib/librte_ether/rte_eth_ctrl.h | 55 ++++++++++++++---------- lib/librte_pmd_i40e/i40e_ethdev.c | 68 +++++++++++++++++------------- lib/librte_pmd_i40e/i40e_ethdev.h | 34 +++++++-------- lib/librte_pmd_i40e/i40e_fdir.c | 84 ++++++++++++++++++------------------- 6 files changed, 235 insertions(+), 165 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 4618b92..80b9c32 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -707,7 +707,7 @@ static void cmd_help_long_parsed(void *parsed_result, " get info of a flex filter.\n\n" "flow_director_filter (port_id) (add|del)" - " flow (ip4|ip4-frag|ip6|ip6-frag)" + " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" " src (src_ip_address) dst (dst_ip_address)" " flexbytes (flexbytes_value)" " (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n" @@ -733,7 +733,8 @@ static void cmd_help_long_parsed(void *parsed_result, " Flush all flow director entries of a device.\n\n" "flow_director_flex_mask (port_id)" - " flow (ip4|ip4-frag|tcp4|udp4|sctp4|ip6|ip6-frag|tcp6|udp6|sctp6|all)" + " flow (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" @@ -8158,31 +8159,34 @@ parse_flexbytes(const char *q_arg, uint8_t *flexbytes, uint16_t max_num) 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[] = { - {"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", ETH_FLOW_TYPE_IPV4}, + {"ipv4-frag", ETH_FLOW_TYPE_FRAG_IPV4}, + {"ipv4-tcp", ETH_FLOW_TYPE_NONFRAG_IPV4_TCP}, + {"ipv4-udp", ETH_FLOW_TYPE_NONFRAG_IPV4_UDP}, + {"ipv4-sctp", ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP}, + {"ipv4-other", ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER}, + {"ipv6", ETH_FLOW_TYPE_IPV6}, + {"ipv6-frag", ETH_FLOW_TYPE_FRAG_IPV6}, + {"ipv6-tcp", ETH_FLOW_TYPE_NONFRAG_IPV6_TCP}, + {"ipv6-udp", ETH_FLOW_TYPE_NONFRAG_IPV6_UDP}, + {"ipv6-sctp", ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP}, + {"ipv6-other", ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER}, + {"l2_payload", ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_UNKNOWN; } #define IPV4_ADDR_TO_UINT(ip_addr, ip) \ @@ -8235,9 +8239,9 @@ cmd_flow_director_filter_parsed(void *parsed_result, 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_UDPV4: - case RTE_ETH_FLOW_TYPE_TCPV4: + case ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER: + case ETH_FLOW_TYPE_NONFRAG_IPV4_UDP: + case ETH_FLOW_TYPE_NONFRAG_IPV4_TCP: IPV4_ADDR_TO_UINT(res->ip_dst, entry.input.flow.ip4_flow.dst_ip); IPV4_ADDR_TO_UINT(res->ip_src, @@ -8248,7 +8252,7 @@ cmd_flow_director_filter_parsed(void *parsed_result, entry.input.flow.udp4_flow.src_port = rte_cpu_to_be_16(res->port_src); break; - case RTE_ETH_FLOW_TYPE_SCTPV4: + case ETH_FLOW_TYPE_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, @@ -8257,9 +8261,9 @@ cmd_flow_director_filter_parsed(void *parsed_result, 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_UDPV6: - case RTE_ETH_FLOW_TYPE_TCPV6: + case ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER: + case ETH_FLOW_TYPE_NONFRAG_IPV6_UDP: + case ETH_FLOW_TYPE_NONFRAG_IPV6_TCP: IPV6_ADDR_TO_ARRAY(res->ip_dst, entry.input.flow.ipv6_flow.dst_ip); IPV6_ADDR_TO_ARRAY(res->ip_src, @@ -8270,7 +8274,7 @@ cmd_flow_director_filter_parsed(void *parsed_result, entry.input.flow.udp6_flow.src_port = rte_cpu_to_be_16(res->port_src); break; - case RTE_ETH_FLOW_TYPE_SCTPV6: + case ETH_FLOW_TYPE_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, @@ -8321,9 +8325,8 @@ cmdline_parse_token_string_t cmd_flow_director_flow = 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"); @@ -8511,7 +8514,9 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result, struct cmd_flow_director_flex_mask_result *res = parsed_result; struct rte_eth_fdir_flex_mask flex_mask; struct rte_port *port; - enum rte_eth_flow_type i; + struct rte_eth_fdir_info fdir_info; + uint32_t flow_type_mask; + uint16_t i; int ret; if (res->port_id > nb_ports) { @@ -8534,10 +8539,23 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result, printf("error: Cannot parse mask input.\n"); 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")) { - for (i = RTE_ETH_FLOW_TYPE_UDPV4; - i <= RTE_ETH_FLOW_TYPE_FRAG_IPV6; - i++) { + if (!flow_type_mask) { + printf("No flow type supported\n"); + return; + } + for (i = ETH_FLOW_TYPE_UNKNOWN; i < ETH_FLOW_TYPE_MAX; i++) { + if (!(flow_type_mask & (1 << i))) + continue; flex_mask.flow_type = i; fdir_set_flex_mask(res->port_id, &flex_mask); } @@ -8545,6 +8563,11 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result, 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); } @@ -8561,9 +8584,8 @@ cmdline_parse_token_string_t cmd_flow_director_flexmask_flow = 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, - "ip4#ip4-frag#tcp4#udp4#sctp4#" - "ip6#ip6-frag#tcp6#udp6#sctp6#all"); + flow_type, "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); diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 87dedf9..4c61a07 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -96,19 +96,7 @@ #include "testpmd.h" -static const char *flowtype_str[RTE_ETH_FLOW_TYPE_MAX] = { - NULL, - "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) @@ -1843,15 +1831,50 @@ print_fdir_flex_payload(struct rte_eth_fdir_flex_conf *flex_conf) 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[] = { + {"ipv4", ETH_FLOW_TYPE_IPV4}, + {"ipv4-frag", ETH_FLOW_TYPE_FRAG_IPV4}, + {"ipv4-tcp", ETH_FLOW_TYPE_NONFRAG_IPV4_TCP}, + {"ipv4-udp", ETH_FLOW_TYPE_NONFRAG_IPV4_UDP}, + {"ipv4-sctp", ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP}, + {"ipv4-other", ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER}, + {"ipv6", ETH_FLOW_TYPE_IPV6}, + {"ipv6-frag", ETH_FLOW_TYPE_FRAG_IPV6}, + {"ipv6-tcp", ETH_FLOW_TYPE_NONFRAG_IPV6_TCP}, + {"ipv6-udp", ETH_FLOW_TYPE_NONFRAG_IPV6_UDP}, + {"ipv6-sctp", ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP}, + {"ipv6-other", ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER}, + {"l2_payload", ETH_FLOW_TYPE_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) { struct rte_eth_fdir_flex_mask *mask; int 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 < RTE_ETH_FDIR_MAX_FLEXLEN; j++) printf(" %02x", mask->mask[j]); } @@ -1861,13 +1884,17 @@ print_fdir_flex_mask(struct rte_eth_fdir_flex_conf *flex_conf) 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 = ETH_FLOW_TYPE_UNKNOWN; i < ETH_FLOW_TYPE_MAX; i++) { + if (!(flow_types_mask & (1 << i))) + continue; + p = flowtype_to_str(i); + if (p) + printf(" %s", p); + else + printf(" unknown"); } printf("\n"); } @@ -2028,13 +2055,13 @@ fdir_set_flex_mask(portid_t port_id, struct rte_eth_fdir_flex_mask *cfg) 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 < ETH_FLOW_TYPE_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 >= ETH_FLOW_TYPE_MAX) { if (flex_conf->nb_flexmasks < RTE_DIM(flex_conf->flex_mask)) { idx = flex_conf->nb_flexmasks; flex_conf->nb_flexmasks++; diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 1c15ed0..f2b39fc 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -46,6 +46,35 @@ 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 + * 'ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_UNKNOWN 0 +#define ETH_FLOW_TYPE_IPV4 1 +#define ETH_FLOW_TYPE_FRAG_IPV4 2 +#define ETH_FLOW_TYPE_NONFRAG_IPV4_TCP 3 +#define ETH_FLOW_TYPE_NONFRAG_IPV4_UDP 4 +#define ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP 5 +#define ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER 6 +#define ETH_FLOW_TYPE_IPV6 7 +#define ETH_FLOW_TYPE_FRAG_IPV6 8 +#define ETH_FLOW_TYPE_NONFRAG_IPV6_TCP 9 +#define ETH_FLOW_TYPE_NONFRAG_IPV6_UDP 10 +#define ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP 11 +#define ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER 12 +#define ETH_FLOW_TYPE_L2_PAYLOAD 13 +#define ETH_FLOW_TYPE_IPV6_EX 14 +#define ETH_FLOW_TYPE_IPV6_TCP_EX 15 +#define ETH_FLOW_TYPE_IPV6_UDP_EX 16 +#define ETH_FLOW_TYPE_MAX 17 + /** * Feature filter types */ @@ -179,24 +208,6 @@ struct rte_eth_tunnel_filter_conf { #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_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 */ struct rte_eth_ipv4_flow { @@ -291,7 +302,7 @@ struct rte_eth_fdir_flow_ext { * 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; /**< Type of flow */ union rte_eth_fdir_flow flow; /**< Flow fields to match, dependent on flow_type */ struct rte_eth_fdir_flow_ext flow_ext; @@ -371,7 +382,7 @@ struct rte_eth_flex_payload_cfg { * for each flow type */ struct rte_eth_fdir_flex_mask { - enum rte_eth_flow_type flow_type; /**< Flow type */ + uint16_t flow_type; /**< Flow type */ uint8_t mask[RTE_ETH_FDIR_MAX_FLEXLEN]; /**< Mask for the whole flexible payload */ }; @@ -385,7 +396,7 @@ struct rte_eth_fdir_flex_conf { 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[ETH_FLOW_TYPE_MAX]; /**< Flex mask configuration for each flow type */ }; @@ -400,7 +411,7 @@ enum rte_fdir_mode { #define UINT32_BIT (CHAR_BIT * sizeof(uint32_t)) #define RTE_FLOW_TYPE_MASK_ARRAY_SIZE \ - (RTE_ALIGN(RTE_ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT) + (RTE_ALIGN(ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT) /** * A structure used to get the information of flow director filter. diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index b47a3d2..de1eff4 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -5261,46 +5261,56 @@ i40e_dev_filter_ctrl(struct rte_eth_dev *dev, } enum i40e_filter_pctype -i40e_flowtype_to_pctype(enum rte_eth_flow_type flow_type) +i40e_flowtype_to_pctype(uint16_t flow_type) { static const enum i40e_filter_pctype pctype_table[] = { - [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, + [ETH_FLOW_TYPE_FRAG_IPV4] = I40E_FILTER_PCTYPE_FRAG_IPV4, + [ETH_FLOW_TYPE_NONFRAG_IPV4_UDP] = + I40E_FILTER_PCTYPE_NONF_IPV4_UDP, + [ETH_FLOW_TYPE_NONFRAG_IPV4_TCP] = + I40E_FILTER_PCTYPE_NONF_IPV4_TCP, + [ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP] = + I40E_FILTER_PCTYPE_NONF_IPV4_SCTP, + [ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER] = + I40E_FILTER_PCTYPE_NONF_IPV4_OTHER, + [ETH_FLOW_TYPE_FRAG_IPV6] = I40E_FILTER_PCTYPE_FRAG_IPV6, + [ETH_FLOW_TYPE_NONFRAG_IPV6_UDP] = + I40E_FILTER_PCTYPE_NONF_IPV6_UDP, + [ETH_FLOW_TYPE_NONFRAG_IPV6_TCP] = + I40E_FILTER_PCTYPE_NONF_IPV6_TCP, + [ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP] = + I40E_FILTER_PCTYPE_NONF_IPV6_SCTP, + [ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER] = + I40E_FILTER_PCTYPE_NONF_IPV6_OTHER, + [ETH_FLOW_TYPE_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[] = { - [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] = ETH_FLOW_TYPE_FRAG_IPV4, + [I40E_FILTER_PCTYPE_NONF_IPV4_UDP] = + ETH_FLOW_TYPE_NONFRAG_IPV4_UDP, + [I40E_FILTER_PCTYPE_NONF_IPV4_TCP] = + ETH_FLOW_TYPE_NONFRAG_IPV4_TCP, + [I40E_FILTER_PCTYPE_NONF_IPV4_SCTP] = + ETH_FLOW_TYPE_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, + ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER, + [I40E_FILTER_PCTYPE_FRAG_IPV6] = ETH_FLOW_TYPE_FRAG_IPV6, + [I40E_FILTER_PCTYPE_NONF_IPV6_UDP] = + ETH_FLOW_TYPE_NONFRAG_IPV6_UDP, + [I40E_FILTER_PCTYPE_NONF_IPV6_TCP] = + ETH_FLOW_TYPE_NONFRAG_IPV6_TCP, + [I40E_FILTER_PCTYPE_NONF_IPV6_SCTP] = + ETH_FLOW_TYPE_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, + ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER, + [I40E_FILTER_PCTYPE_L2_PAYLOAD] = ETH_FLOW_TYPE_L2_PAYLOAD, }; return flowtype_table[pctype]; diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h index f913ea9..e2a8db3 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.h +++ b/lib/librte_pmd_i40e/i40e_ethdev.h @@ -471,10 +471,8 @@ const struct rte_memzone *i40e_memzone_reserve(const char *name, 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); @@ -541,27 +539,29 @@ i40e_init_adminq_parameter(struct i40e_hw *hw) } #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) + ((flow_type) == ETH_FLOW_TYPE_FRAG_IPV4 || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_TCP || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_UDP || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER || \ + (flow_type) == ETH_FLOW_TYPE_FRAG_IPV6 || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_TCP || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_UDP || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP || \ + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER || \ + (flow_type) == ETH_FLOW_TYPE_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_ */ diff --git a/lib/librte_pmd_i40e/i40e_fdir.c b/lib/librte_pmd_i40e/i40e_fdir.c index c9e535b..9bdcabf 100644 --- a/lib/librte_pmd_i40e/i40e_fdir.c +++ b/lib/librte_pmd_i40e/i40e_fdir.c @@ -95,16 +95,16 @@ 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)) + (1 << ETH_FLOW_TYPE_FRAG_IPV4) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_UDP) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_TCP) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER) | \ + (1 << ETH_FLOW_TYPE_FRAG_IPV6) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_UDP) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_TCP) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP) | \ + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER)) #define I40E_FLEX_WORD_MASK(off) (0x80 >> (off)) @@ -498,7 +498,7 @@ i40e_check_fdir_flex_conf(const struct rte_eth_fdir_flex_conf *conf) } /* check flex mask setting configuration */ - if (conf->nb_flexmasks > RTE_ETH_FLOW_TYPE_FRAG_IPV6) { + if (conf->nb_flexmasks >= ETH_FLOW_TYPE_MAX) { PMD_DRV_LOG(ERR, "invalid number of flex masks."); return -EINVAL; } @@ -692,24 +692,24 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input, 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, + [ETH_FLOW_TYPE_FRAG_IPV4] = IPPROTO_IP, + [ETH_FLOW_TYPE_NONFRAG_IPV4_TCP] = IPPROTO_TCP, + [ETH_FLOW_TYPE_NONFRAG_IPV4_UDP] = IPPROTO_UDP, + [ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP] = IPPROTO_SCTP, + [ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER] = IPPROTO_IP, + [ETH_FLOW_TYPE_FRAG_IPV6] = IPPROTO_NONE, + [ETH_FLOW_TYPE_NONFRAG_IPV6_TCP] = IPPROTO_TCP, + [ETH_FLOW_TYPE_NONFRAG_IPV6_UDP] = IPPROTO_UDP, + [ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP] = IPPROTO_SCTP, + [ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_NONFRAG_IPV4_TCP: + case ETH_FLOW_TYPE_NONFRAG_IPV4_UDP: + case ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP: + case ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER: + case ETH_FLOW_TYPE_FRAG_IPV4: ip = (struct ipv4_hdr *)(raw_pkt + sizeof(struct ether_hdr)); ether->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); @@ -726,11 +726,11 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input, 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 ETH_FLOW_TYPE_NONFRAG_IPV6_TCP: + case ETH_FLOW_TYPE_NONFRAG_IPV6_UDP: + case ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP: + case ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER: + case ETH_FLOW_TYPE_FRAG_IPV6: ip6 = (struct ipv6_hdr *)(raw_pkt + sizeof(struct ether_hdr)); ether->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6); @@ -784,7 +784,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, /* fill the L4 head */ switch (fdir_input->flow_type) { - case RTE_ETH_FLOW_TYPE_UDPV4: + case ETH_FLOW_TYPE_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); @@ -798,7 +798,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, udp->dgram_len = rte_cpu_to_be_16(I40E_FDIR_UDP_DEFAULT_LEN); break; - case RTE_ETH_FLOW_TYPE_TCPV4: + case ETH_FLOW_TYPE_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); @@ -812,21 +812,21 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, tcp->data_off = I40E_FDIR_TCP_DEFAULT_DATAOFF; break; - case RTE_ETH_FLOW_TYPE_SCTPV4: + case ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER: + case ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_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); @@ -840,7 +840,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, udp->dgram_len = rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN); break; - case RTE_ETH_FLOW_TYPE_TCPV6: + case ETH_FLOW_TYPE_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); @@ -854,15 +854,15 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, tcp->dst_port = fdir_input->flow.udp6_flow.src_port; break; - case RTE_ETH_FLOW_TYPE_SCTPV6: + case ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER: + case ETH_FLOW_TYPE_FRAG_IPV6: payload = raw_pkt + sizeof(struct ether_hdr) + sizeof(struct ipv6_hdr); set_idx = I40E_FLXPLD_L3_IDX; @@ -1214,7 +1214,7 @@ i40e_fdir_info_get_flex_mask(struct i40e_pf *pf, { 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; -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <98DB008FA2AC6644B40AD8C766FAB271014BDED15D@BOREAL.arubanetworks.com>]
* Re: [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types [not found] ` <98DB008FA2AC6644B40AD8C766FAB271014BDED15D@BOREAL.arubanetworks.com> @ 2015-01-27 5:20 ` Zhang, Helin 0 siblings, 0 replies; 24+ messages in thread From: Zhang, Helin @ 2015-01-27 5:20 UTC (permalink / raw) To: Vithal S Mohare; +Cc: dev Hi Vithal Exactly! Some types of NIC (e.g. i40e) support it. Regards, Helin > -----Original Message----- > From: Vithal S Mohare [mailto:vmohare@arubanetworks.com] > Sent: Tuesday, January 27, 2015 12:31 PM > To: Zhang, Helin > Subject: RE: [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types > > Hi Helin, > > I see a new type *_L2_PAYLOAD added for RSS types. Is this for spraying of > pure L2 packets (non-ip)? > > Thanks, > -Vithal > > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang > Sent: Monday, January 19, 2015 12:26 PM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types > > Flow types was defined actually for i40e hardware specifically, and wasn't able > to be used for defining RSS offload types of all PMDs. It removed the enum flow > types, and uses macros instead with new names. The new macros can be used > for defining RSS offload types later. Also modifications are made in i40e and > testpmd accordingly. > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > --- > app/test-pmd/cmdline.c | 88 > ++++++++++++++++++++++++--------------- > app/test-pmd/config.c | 71 +++++++++++++++++++++---------- > lib/librte_ether/rte_eth_ctrl.h | 55 ++++++++++++++---------- > lib/librte_pmd_i40e/i40e_ethdev.c | 68 +++++++++++++++++------------- > lib/librte_pmd_i40e/i40e_ethdev.h | 34 +++++++-------- > lib/librte_pmd_i40e/i40e_fdir.c | 84 ++++++++++++++++++------------------- > 6 files changed, 235 insertions(+), 165 deletions(-) > > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index > 4618b92..80b9c32 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -707,7 +707,7 @@ static void cmd_help_long_parsed(void > *parsed_result, > " get info of a flex filter.\n\n" > > "flow_director_filter (port_id) (add|del)" > - " flow (ip4|ip4-frag|ip6|ip6-frag)" > + " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" > " src (src_ip_address) dst (dst_ip_address)" > " flexbytes (flexbytes_value)" > " (drop|fwd) queue (queue_id) fd_id (fd_id_value)\n" > @@ -733,7 +733,8 @@ static void cmd_help_long_parsed(void > *parsed_result, > " Flush all flow director entries of a device.\n\n" > > "flow_director_flex_mask (port_id)" > - " flow > (ip4|ip4-frag|tcp4|udp4|sctp4|ip6|ip6-frag|tcp6|udp6|sctp6|all)" > + " flow (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" > > @@ -8158,31 +8159,34 @@ parse_flexbytes(const char *q_arg, uint8_t > *flexbytes, uint16_t max_num) > 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[] = { > - {"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", ETH_FLOW_TYPE_IPV4}, > + {"ipv4-frag", ETH_FLOW_TYPE_FRAG_IPV4}, > + {"ipv4-tcp", ETH_FLOW_TYPE_NONFRAG_IPV4_TCP}, > + {"ipv4-udp", ETH_FLOW_TYPE_NONFRAG_IPV4_UDP}, > + {"ipv4-sctp", ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP}, > + {"ipv4-other", ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER}, > + {"ipv6", ETH_FLOW_TYPE_IPV6}, > + {"ipv6-frag", ETH_FLOW_TYPE_FRAG_IPV6}, > + {"ipv6-tcp", ETH_FLOW_TYPE_NONFRAG_IPV6_TCP}, > + {"ipv6-udp", ETH_FLOW_TYPE_NONFRAG_IPV6_UDP}, > + {"ipv6-sctp", ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP}, > + {"ipv6-other", ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER}, > + {"l2_payload", ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_UNKNOWN; > } > > #define IPV4_ADDR_TO_UINT(ip_addr, ip) \ @@ -8235,9 +8239,9 @@ > cmd_flow_director_filter_parsed(void *parsed_result, > > 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_UDPV4: > - case RTE_ETH_FLOW_TYPE_TCPV4: > + case ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER: > + case ETH_FLOW_TYPE_NONFRAG_IPV4_UDP: > + case ETH_FLOW_TYPE_NONFRAG_IPV4_TCP: > IPV4_ADDR_TO_UINT(res->ip_dst, > entry.input.flow.ip4_flow.dst_ip); > IPV4_ADDR_TO_UINT(res->ip_src, > @@ -8248,7 +8252,7 @@ cmd_flow_director_filter_parsed(void > *parsed_result, > entry.input.flow.udp4_flow.src_port = > rte_cpu_to_be_16(res->port_src); > break; > - case RTE_ETH_FLOW_TYPE_SCTPV4: > + case ETH_FLOW_TYPE_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, > @@ -8257,9 +8261,9 @@ cmd_flow_director_filter_parsed(void > *parsed_result, > 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_UDPV6: > - case RTE_ETH_FLOW_TYPE_TCPV6: > + case ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER: > + case ETH_FLOW_TYPE_NONFRAG_IPV6_UDP: > + case ETH_FLOW_TYPE_NONFRAG_IPV6_TCP: > IPV6_ADDR_TO_ARRAY(res->ip_dst, > entry.input.flow.ipv6_flow.dst_ip); > IPV6_ADDR_TO_ARRAY(res->ip_src, > @@ -8270,7 +8274,7 @@ cmd_flow_director_filter_parsed(void > *parsed_result, > entry.input.flow.udp6_flow.src_port = > rte_cpu_to_be_16(res->port_src); > break; > - case RTE_ETH_FLOW_TYPE_SCTPV6: > + case ETH_FLOW_TYPE_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, > @@ -8321,9 +8325,8 @@ cmdline_parse_token_string_t > cmd_flow_director_flow = > 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"); > @@ -8511,7 +8514,9 @@ cmd_flow_director_flex_mask_parsed(void > *parsed_result, > struct cmd_flow_director_flex_mask_result *res = parsed_result; > struct rte_eth_fdir_flex_mask flex_mask; > struct rte_port *port; > - enum rte_eth_flow_type i; > + struct rte_eth_fdir_info fdir_info; > + uint32_t flow_type_mask; > + uint16_t i; > int ret; > > if (res->port_id > nb_ports) { > @@ -8534,10 +8539,23 @@ cmd_flow_director_flex_mask_parsed(void > *parsed_result, > printf("error: Cannot parse mask input.\n"); > 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")) { > - for (i = RTE_ETH_FLOW_TYPE_UDPV4; > - i <= RTE_ETH_FLOW_TYPE_FRAG_IPV6; > - i++) { > + if (!flow_type_mask) { > + printf("No flow type supported\n"); > + return; > + } > + for (i = ETH_FLOW_TYPE_UNKNOWN; i < ETH_FLOW_TYPE_MAX; i++) > { > + if (!(flow_type_mask & (1 << i))) > + continue; > flex_mask.flow_type = i; > fdir_set_flex_mask(res->port_id, &flex_mask); > } > @@ -8545,6 +8563,11 @@ cmd_flow_director_flex_mask_parsed(void > *parsed_result, > 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); } @@ -8561,9 +8584,8 > @@ cmdline_parse_token_string_t cmd_flow_director_flexmask_flow = > 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, > - "ip4#ip4-frag#tcp4#udp4#sctp4#" > - "ip6#ip6-frag#tcp6#udp6#sctp6#all"); > + flow_type, "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); > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index > 87dedf9..4c61a07 100644 > --- a/app/test-pmd/config.c > +++ b/app/test-pmd/config.c > @@ -96,19 +96,7 @@ > > #include "testpmd.h" > > -static const char *flowtype_str[RTE_ETH_FLOW_TYPE_MAX] = { > - NULL, > - "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) @@ -1843,15 > +1831,50 @@ print_fdir_flex_payload(struct rte_eth_fdir_flex_conf *flex_conf) > 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[] = { > + {"ipv4", ETH_FLOW_TYPE_IPV4}, > + {"ipv4-frag", ETH_FLOW_TYPE_FRAG_IPV4}, > + {"ipv4-tcp", ETH_FLOW_TYPE_NONFRAG_IPV4_TCP}, > + {"ipv4-udp", ETH_FLOW_TYPE_NONFRAG_IPV4_UDP}, > + {"ipv4-sctp", ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP}, > + {"ipv4-other", ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER}, > + {"ipv6", ETH_FLOW_TYPE_IPV6}, > + {"ipv6-frag", ETH_FLOW_TYPE_FRAG_IPV6}, > + {"ipv6-tcp", ETH_FLOW_TYPE_NONFRAG_IPV6_TCP}, > + {"ipv6-udp", ETH_FLOW_TYPE_NONFRAG_IPV6_UDP}, > + {"ipv6-sctp", ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP}, > + {"ipv6-other", ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER}, > + {"l2_payload", ETH_FLOW_TYPE_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) { > struct rte_eth_fdir_flex_mask *mask; > int 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 < RTE_ETH_FDIR_MAX_FLEXLEN; j++) > printf(" %02x", mask->mask[j]); > } > @@ -1861,13 +1884,17 @@ print_fdir_flex_mask(struct > rte_eth_fdir_flex_conf *flex_conf) 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 = ETH_FLOW_TYPE_UNKNOWN; i < ETH_FLOW_TYPE_MAX; i++) { > + if (!(flow_types_mask & (1 << i))) > + continue; > + p = flowtype_to_str(i); > + if (p) > + printf(" %s", p); > + else > + printf(" unknown"); > } > printf("\n"); > } > @@ -2028,13 +2055,13 @@ fdir_set_flex_mask(portid_t port_id, struct > rte_eth_fdir_flex_mask *cfg) > > 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 < ETH_FLOW_TYPE_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 >= ETH_FLOW_TYPE_MAX) { > if (flex_conf->nb_flexmasks < RTE_DIM(flex_conf->flex_mask)) { > idx = flex_conf->nb_flexmasks; > flex_conf->nb_flexmasks++; > diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index > 1c15ed0..f2b39fc 100644 > --- a/lib/librte_ether/rte_eth_ctrl.h > +++ b/lib/librte_ether/rte_eth_ctrl.h > @@ -46,6 +46,35 @@ > 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 > + * 'ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_UNKNOWN 0 > +#define ETH_FLOW_TYPE_IPV4 1 > +#define ETH_FLOW_TYPE_FRAG_IPV4 2 > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_TCP 3 > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_UDP 4 > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP 5 #define > +ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER 6 > +#define ETH_FLOW_TYPE_IPV6 7 > +#define ETH_FLOW_TYPE_FRAG_IPV6 8 > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_TCP 9 > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_UDP 10 > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP 11 #define > +ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER 12 > +#define ETH_FLOW_TYPE_L2_PAYLOAD 13 > +#define ETH_FLOW_TYPE_IPV6_EX 14 > +#define ETH_FLOW_TYPE_IPV6_TCP_EX 15 > +#define ETH_FLOW_TYPE_IPV6_UDP_EX 16 > +#define ETH_FLOW_TYPE_MAX 17 > + > /** > * Feature filter types > */ > @@ -179,24 +208,6 @@ struct rte_eth_tunnel_filter_conf { > #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_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 > */ > struct rte_eth_ipv4_flow { > @@ -291,7 +302,7 @@ struct rte_eth_fdir_flow_ext { > * 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; /**< Type of flow */ > union rte_eth_fdir_flow flow; > /**< Flow fields to match, dependent on flow_type */ > struct rte_eth_fdir_flow_ext flow_ext; @@ -371,7 +382,7 @@ struct > rte_eth_flex_payload_cfg { > * for each flow type > */ > struct rte_eth_fdir_flex_mask { > - enum rte_eth_flow_type flow_type; /**< Flow type */ > + uint16_t flow_type; /**< Flow type */ > uint8_t mask[RTE_ETH_FDIR_MAX_FLEXLEN]; > /**< Mask for the whole flexible payload */ }; @@ -385,7 +396,7 @@ > struct rte_eth_fdir_flex_conf { > 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[ETH_FLOW_TYPE_MAX]; > /**< Flex mask configuration for each flow type */ }; > > @@ -400,7 +411,7 @@ enum rte_fdir_mode { > > #define UINT32_BIT (CHAR_BIT * sizeof(uint32_t)) #define > RTE_FLOW_TYPE_MASK_ARRAY_SIZE \ > - (RTE_ALIGN(RTE_ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT) > + (RTE_ALIGN(ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT) > > /** > * A structure used to get the information of flow director filter. > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c > b/lib/librte_pmd_i40e/i40e_ethdev.c > index b47a3d2..de1eff4 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.c > +++ b/lib/librte_pmd_i40e/i40e_ethdev.c > @@ -5261,46 +5261,56 @@ i40e_dev_filter_ctrl(struct rte_eth_dev *dev, } > > enum i40e_filter_pctype > -i40e_flowtype_to_pctype(enum rte_eth_flow_type flow_type) > +i40e_flowtype_to_pctype(uint16_t flow_type) > { > static const enum i40e_filter_pctype pctype_table[] = { > - [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, > + [ETH_FLOW_TYPE_FRAG_IPV4] = I40E_FILTER_PCTYPE_FRAG_IPV4, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_UDP] = > + I40E_FILTER_PCTYPE_NONF_IPV4_UDP, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_TCP] = > + I40E_FILTER_PCTYPE_NONF_IPV4_TCP, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP] = > + I40E_FILTER_PCTYPE_NONF_IPV4_SCTP, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER] = > + I40E_FILTER_PCTYPE_NONF_IPV4_OTHER, > + [ETH_FLOW_TYPE_FRAG_IPV6] = I40E_FILTER_PCTYPE_FRAG_IPV6, > + [ETH_FLOW_TYPE_NONFRAG_IPV6_UDP] = > + I40E_FILTER_PCTYPE_NONF_IPV6_UDP, > + [ETH_FLOW_TYPE_NONFRAG_IPV6_TCP] = > + I40E_FILTER_PCTYPE_NONF_IPV6_TCP, > + [ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP] = > + I40E_FILTER_PCTYPE_NONF_IPV6_SCTP, > + [ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER] = > + I40E_FILTER_PCTYPE_NONF_IPV6_OTHER, > + [ETH_FLOW_TYPE_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[] = { > - [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] = ETH_FLOW_TYPE_FRAG_IPV4, > + [I40E_FILTER_PCTYPE_NONF_IPV4_UDP] = > + ETH_FLOW_TYPE_NONFRAG_IPV4_UDP, > + [I40E_FILTER_PCTYPE_NONF_IPV4_TCP] = > + ETH_FLOW_TYPE_NONFRAG_IPV4_TCP, > + [I40E_FILTER_PCTYPE_NONF_IPV4_SCTP] = > + ETH_FLOW_TYPE_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, > + ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER, > + [I40E_FILTER_PCTYPE_FRAG_IPV6] = ETH_FLOW_TYPE_FRAG_IPV6, > + [I40E_FILTER_PCTYPE_NONF_IPV6_UDP] = > + ETH_FLOW_TYPE_NONFRAG_IPV6_UDP, > + [I40E_FILTER_PCTYPE_NONF_IPV6_TCP] = > + ETH_FLOW_TYPE_NONFRAG_IPV6_TCP, > + [I40E_FILTER_PCTYPE_NONF_IPV6_SCTP] = > + ETH_FLOW_TYPE_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, > + ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER, > + [I40E_FILTER_PCTYPE_L2_PAYLOAD] = > ETH_FLOW_TYPE_L2_PAYLOAD, > }; > > return flowtype_table[pctype]; > diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h > b/lib/librte_pmd_i40e/i40e_ethdev.h > index f913ea9..e2a8db3 100644 > --- a/lib/librte_pmd_i40e/i40e_ethdev.h > +++ b/lib/librte_pmd_i40e/i40e_ethdev.h > @@ -471,10 +471,8 @@ const struct rte_memzone > *i40e_memzone_reserve(const char *name, > 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); > @@ -541,27 +539,29 @@ i40e_init_adminq_parameter(struct i40e_hw > *hw) } > > #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) > + ((flow_type) == ETH_FLOW_TYPE_FRAG_IPV4 || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_TCP || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_UDP || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER || \ > + (flow_type) == ETH_FLOW_TYPE_FRAG_IPV6 || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_TCP || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_UDP || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP || \ > + (flow_type) == ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER || \ > + (flow_type) == ETH_FLOW_TYPE_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_ */ > diff --git a/lib/librte_pmd_i40e/i40e_fdir.c b/lib/librte_pmd_i40e/i40e_fdir.c > index c9e535b..9bdcabf 100644 > --- a/lib/librte_pmd_i40e/i40e_fdir.c > +++ b/lib/librte_pmd_i40e/i40e_fdir.c > @@ -95,16 +95,16 @@ > 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)) > + (1 << ETH_FLOW_TYPE_FRAG_IPV4) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_UDP) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_TCP) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER) | \ > + (1 << ETH_FLOW_TYPE_FRAG_IPV6) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_UDP) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_TCP) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP) | \ > + (1 << ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER)) > > #define I40E_FLEX_WORD_MASK(off) (0x80 >> (off)) > > @@ -498,7 +498,7 @@ i40e_check_fdir_flex_conf(const struct > rte_eth_fdir_flex_conf *conf) > } > > /* check flex mask setting configuration */ > - if (conf->nb_flexmasks > RTE_ETH_FLOW_TYPE_FRAG_IPV6) { > + if (conf->nb_flexmasks >= ETH_FLOW_TYPE_MAX) { > PMD_DRV_LOG(ERR, "invalid number of flex masks."); > return -EINVAL; > } > @@ -692,24 +692,24 @@ i40e_fdir_fill_eth_ip_head(const struct > rte_eth_fdir_input *fdir_input, > 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, > + [ETH_FLOW_TYPE_FRAG_IPV4] = IPPROTO_IP, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_TCP] = IPPROTO_TCP, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_UDP] = IPPROTO_UDP, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP] = IPPROTO_SCTP, > + [ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER] = IPPROTO_IP, > + [ETH_FLOW_TYPE_FRAG_IPV6] = IPPROTO_NONE, > + [ETH_FLOW_TYPE_NONFRAG_IPV6_TCP] = IPPROTO_TCP, > + [ETH_FLOW_TYPE_NONFRAG_IPV6_UDP] = IPPROTO_UDP, > + [ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP] = IPPROTO_SCTP, > + [ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_NONFRAG_IPV4_TCP: > + case ETH_FLOW_TYPE_NONFRAG_IPV4_UDP: > + case ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP: > + case ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER: > + case ETH_FLOW_TYPE_FRAG_IPV4: > ip = (struct ipv4_hdr *)(raw_pkt + sizeof(struct ether_hdr)); > > ether->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv4); > @@ -726,11 +726,11 @@ i40e_fdir_fill_eth_ip_head(const struct > rte_eth_fdir_input *fdir_input, > 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 ETH_FLOW_TYPE_NONFRAG_IPV6_TCP: > + case ETH_FLOW_TYPE_NONFRAG_IPV6_UDP: > + case ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP: > + case ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER: > + case ETH_FLOW_TYPE_FRAG_IPV6: > ip6 = (struct ipv6_hdr *)(raw_pkt + sizeof(struct ether_hdr)); > > ether->ether_type = rte_cpu_to_be_16(ETHER_TYPE_IPv6); > @@ -784,7 +784,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, > > /* fill the L4 head */ > switch (fdir_input->flow_type) { > - case RTE_ETH_FLOW_TYPE_UDPV4: > + case ETH_FLOW_TYPE_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); @@ -798,7 > +798,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, > udp->dgram_len = > rte_cpu_to_be_16(I40E_FDIR_UDP_DEFAULT_LEN); > break; > > - case RTE_ETH_FLOW_TYPE_TCPV4: > + case ETH_FLOW_TYPE_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); @@ -812,21 > +812,21 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, > tcp->data_off = I40E_FDIR_TCP_DEFAULT_DATAOFF; > break; > > - case RTE_ETH_FLOW_TYPE_SCTPV4: > + case ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER: > + case ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_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); @@ -840,7 > +840,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, > udp->dgram_len = > rte_cpu_to_be_16(I40E_FDIR_IPv6_PAYLOAD_LEN); > break; > > - case RTE_ETH_FLOW_TYPE_TCPV6: > + case ETH_FLOW_TYPE_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); @@ -854,15 > +854,15 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, > tcp->dst_port = fdir_input->flow.udp6_flow.src_port; > break; > > - case RTE_ETH_FLOW_TYPE_SCTPV6: > + case ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER: > + case ETH_FLOW_TYPE_FRAG_IPV6: > payload = raw_pkt + sizeof(struct ether_hdr) + > sizeof(struct ipv6_hdr); > set_idx = I40E_FLXPLD_L3_IDX; > @@ -1214,7 +1214,7 @@ i40e_fdir_info_get_flex_mask(struct i40e_pf *pf, { > 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; > > -- > 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
[parent not found: <5329819.johOmNX3Da@xps13>]
* Re: [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types [not found] ` <5329819.johOmNX3Da@xps13> @ 2015-02-03 5:40 ` Zhang, Helin 0 siblings, 0 replies; 24+ messages in thread From: Zhang, Helin @ 2015-02-03 5:40 UTC (permalink / raw) To: Thomas Monjalon; +Cc: dev > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Monday, February 2, 2015 11:39 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types > > Hi Helin, > > 2015-01-19 14:56, Helin Zhang: > > Flow types was defined actually for i40e hardware specifically, and > > wasn't able to be used for defining RSS offload types of all PMDs. It > > removed the enum flow types, and uses macros instead with new names. > > The new macros can be used for defining RSS offload types later. Also > > modifications are made in i40e and testpmd accordingly. > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > [...] > > --- a/lib/librte_ether/rte_eth_ctrl.h > > +++ b/lib/librte_ether/rte_eth_ctrl.h > > @@ -46,6 +46,35 @@ > > 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 > > + * 'ETH_FLOW_TYPE_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 ETH_FLOW_TYPE_UNKNOWN 0 > > +#define ETH_FLOW_TYPE_IPV4 1 > > +#define ETH_FLOW_TYPE_FRAG_IPV4 2 > > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_TCP 3 > > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_UDP 4 > > +#define ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP 5 #define > > +ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER 6 > > +#define ETH_FLOW_TYPE_IPV6 7 > > +#define ETH_FLOW_TYPE_FRAG_IPV6 8 > > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_TCP 9 > > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_UDP 10 > > +#define ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP 11 #define > > +ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER 12 > > +#define ETH_FLOW_TYPE_L2_PAYLOAD 13 > > +#define ETH_FLOW_TYPE_IPV6_EX 14 > > +#define ETH_FLOW_TYPE_IPV6_TCP_EX 15 > > +#define ETH_FLOW_TYPE_IPV6_UDP_EX 16 > > +#define ETH_FLOW_TYPE_MAX 17 > > Why not using an enum? Enum is 'int' which needs 32 bits, while flow_type is just 16 bits. The old one which is not enum was in rte_ethdev.h, the enum one was added recently in rte_eth_ctrl.h. > Nitpicking: numbers from 0 to 9 should be right aligned. In my source file, they are right aligned. > > > /** > > * Feature filter types > > */ > > @@ -179,24 +208,6 @@ struct rte_eth_tunnel_filter_conf { > > #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_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, > > -}; > > You are renaming the prefix RTE_ETH_FLOW_TYPE_ to ETH_FLOW_TYPE. > As this is an exported enum (in the API), we should keep RTE_ prefix. > If you are trying to shorten the names, I suggest RTE_ETH_FLOW_. OK. Started with RTE_ETH_FLOW_ is good for me. I will modified it in v2. > > [...] > > struct rte_eth_fdir_input { > > - enum rte_eth_flow_type flow_type; /**< Type of flow */ > > + uint16_t flow_type; /**< Type of flow */ > [...] > > struct rte_eth_fdir_flex_mask { > > - enum rte_eth_flow_type flow_type; /**< Flow type */ > > + uint16_t flow_type; /**< Flow type */ > > I think this comment is useless ;) OK. I will remove it. Thanks! Regards, Helin > > -- > Thomas ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH 6/7] ethdev: unification of RSS offload types 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang ` (4 preceding siblings ...) 2015-01-19 6:56 ` [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types Helin Zhang @ 2015-01-19 6:56 ` Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 7/7] app/testpmd: support new rss offloads Helin Zhang ` (2 subsequent siblings) 8 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev RSS offload types were defined seperately for 1/10G and 40G NICs, and have no relationship with flow types. The modifications are to unify all RSS offload types for all PMDs. Unified RSS offload types have new and common names which can be used for any PMD or applications, and decouple from specific hardwares. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pipeline/init.c | 2 +- app/test-pmd/config.c | 60 +++++++++---- examples/distributor/main.c | 9 +- examples/ip_pipeline/init.c | 2 +- examples/l3fwd-acl/main.c | 7 +- lib/librte_ether/rte_ethdev.h | 147 +++++++++++++------------------- lib/librte_pmd_e1000/e1000_ethdev.h | 11 +++ lib/librte_pmd_e1000/igb_ethdev.c | 1 + lib/librte_pmd_e1000/igb_rxtx.c | 27 ++---- lib/librte_pmd_i40e/i40e_ethdev.c | 58 ++++++------- lib/librte_pmd_i40e/i40e_ethdev.h | 16 ++-- lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1 + lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 1 + lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 11 +++ lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 27 ++---- lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 1 + lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h | 6 ++ lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 10 +-- 18 files changed, 198 insertions(+), 199 deletions(-) diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c index 17b6d23..cd2ebc4 100644 --- a/app/test-pipeline/init.c +++ b/app/test-pipeline/init.c @@ -112,7 +112,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 4c61a07..e6c34d0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -347,6 +347,21 @@ port_infos_display(portid_t port_id) rte_eth_dev_info_get(port_id, &dev_info); if (dev_info.reta_size > 0) printf("Redirection table size: %u\n", dev_info.reta_size); + if (!dev_info.flow_type_rss_offloads) + printf("No flow type is supported.\n"); + else { + uint16_t i; + char *p; + + printf("Supported flow types:\n"); + for (i = ETH_FLOW_TYPE_UNKNOWN + 1; i < ETH_FLOW_TYPE_MAX; + i++) { + if (!(dev_info.flow_type_rss_offloads & (1ULL << i))) + continue; + p = flowtype_to_str(i); + printf(" %s\n", (p ? p : "unknown")); + } + } } int @@ -810,6 +825,29 @@ port_rss_reta_info(portid_t port_id, void port_rss_hash_conf_show(portid_t port_id, int show_rss_key) { + struct rss_type_info { + char str[32]; + uint64_t rss_type; + }; + static const struct rss_type_info rss_type_table[] = { + {"ipv4", ETH_RSS_IPV4}, + {"ipv4-frag", ETH_RSS_FRAG_IPV4}, + {"ipv4-tcp", ETH_RSS_NONFRAG_IPV4_TCP}, + {"ipv4-udp", ETH_RSS_NONFRAG_IPV4_UDP}, + {"ipv4-sctp", ETH_RSS_NONFRAG_IPV4_SCTP}, + {"ipv4-other", ETH_RSS_NONFRAG_IPV4_OTHER}, + {"ipv6", ETH_RSS_IPV6}, + {"ipv6-frag", ETH_RSS_FRAG_IPV6}, + {"ipv6-tcp", ETH_RSS_NONFRAG_IPV6_TCP}, + {"ipv6-udp", ETH_RSS_NONFRAG_IPV6_UDP}, + {"ipv6-sctp", ETH_RSS_NONFRAG_IPV6_SCTP}, + {"ipv6-other", ETH_RSS_NONFRAG_IPV6_OTHER}, + {"l2-payload", ETH_RSS_L2_PAYLOAD}, + {"ipv6-ex", ETH_RSS_IPV6_EX}, + {"ipv6-tcp-ex", ETH_RSS_IPV6_TCP_EX}, + {"ipv6-udp-ex", ETH_RSS_IPV6_UDP_EX}, + }; + struct rte_eth_rss_conf rss_conf; uint8_t rss_key[10 * 4]; uint64_t rss_hf; @@ -841,24 +879,10 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key) return; } printf("RSS functions:\n "); - if (rss_hf & ETH_RSS_IPV4) - printf("ip4"); - if (rss_hf & ETH_RSS_IPV4_TCP) - printf(" tcp4"); - if (rss_hf & ETH_RSS_IPV4_UDP) - printf(" udp4"); - if (rss_hf & ETH_RSS_IPV6) - printf(" ip6"); - if (rss_hf & ETH_RSS_IPV6_EX) - printf(" ip6-ex"); - if (rss_hf & ETH_RSS_IPV6_TCP) - printf(" tcp6"); - if (rss_hf & ETH_RSS_IPV6_TCP_EX) - printf(" tcp6-ex"); - if (rss_hf & ETH_RSS_IPV6_UDP) - printf(" udp6"); - if (rss_hf & ETH_RSS_IPV6_UDP_EX) - printf(" udp6-ex"); + for (i = 0; i < RTE_DIM(rss_type_table); i++) { + if (rss_hf & rss_type_table[i].rss_type) + printf("%s ", rss_type_table[i].str); + } printf("\n"); if (!show_rss_key) return; diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 89d82bb..13fb04d 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -94,11 +94,10 @@ static const struct rte_eth_conf port_conf_default = { .mq_mode = ETH_MQ_TX_NONE, }, .rx_adv_conf = { - .rss_conf = { - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6 | - ETH_RSS_IPV4_TCP | ETH_RSS_IPV4_UDP | - ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_UDP, - } + .rss_conf = { + .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | + ETH_RSS_TCP | ETH_RSS_SCTP, + } }, }; diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c index e0c0464..e7ff86a 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -113,7 +113,7 @@ struct app_params app = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index 022ccab..5e56a1b 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -174,11 +174,8 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV4_TCP - | ETH_RSS_IPV4_UDP - | ETH_RSS_IPV6 | ETH_RSS_IPV6_EX - | ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_TCP_EX - | ETH_RSS_IPV6_UDP | ETH_RSS_IPV6_UDP_EX, + .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | + ETH_RSS_TCP | ETH_RSS_SCTP, }, }, .txmode = { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index ce0528f..812f7f2 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -351,97 +351,70 @@ struct rte_eth_rss_conf { uint64_t rss_hf; /**< Hash functions to apply - see below. */ }; -/* Supported RSS offloads */ -/* for 1G & 10G */ -#define ETH_RSS_IPV4_SHIFT 0 -#define ETH_RSS_IPV4_TCP_SHIFT 1 -#define ETH_RSS_IPV6_SHIFT 2 -#define ETH_RSS_IPV6_EX_SHIFT 3 -#define ETH_RSS_IPV6_TCP_SHIFT 4 -#define ETH_RSS_IPV6_TCP_EX_SHIFT 5 -#define ETH_RSS_IPV4_UDP_SHIFT 6 -#define ETH_RSS_IPV6_UDP_SHIFT 7 -#define ETH_RSS_IPV6_UDP_EX_SHIFT 8 -/* for 40G only */ -#define ETH_RSS_NONF_IPV4_UDP_SHIFT 31 -#define ETH_RSS_NONF_IPV4_TCP_SHIFT 33 -#define ETH_RSS_NONF_IPV4_SCTP_SHIFT 34 -#define ETH_RSS_NONF_IPV4_OTHER_SHIFT 35 -#define ETH_RSS_FRAG_IPV4_SHIFT 36 -#define ETH_RSS_NONF_IPV6_UDP_SHIFT 41 -#define ETH_RSS_NONF_IPV6_TCP_SHIFT 43 -#define ETH_RSS_NONF_IPV6_SCTP_SHIFT 44 -#define ETH_RSS_NONF_IPV6_OTHER_SHIFT 45 -#define ETH_RSS_FRAG_IPV6_SHIFT 46 -#define ETH_RSS_FCOE_OX_SHIFT 48 -#define ETH_RSS_FCOE_RX_SHIFT 49 -#define ETH_RSS_FCOE_OTHER_SHIFT 50 -#define ETH_RSS_L2_PAYLOAD_SHIFT 63 - -/* for 1G & 10G */ -#define ETH_RSS_IPV4 (1 << ETH_RSS_IPV4_SHIFT) -#define ETH_RSS_IPV4_TCP (1 << ETH_RSS_IPV4_TCP_SHIFT) -#define ETH_RSS_IPV6 (1 << ETH_RSS_IPV6_SHIFT) -#define ETH_RSS_IPV6_EX (1 << ETH_RSS_IPV6_EX_SHIFT) -#define ETH_RSS_IPV6_TCP (1 << ETH_RSS_IPV6_TCP_SHIFT) -#define ETH_RSS_IPV6_TCP_EX (1 << ETH_RSS_IPV6_TCP_EX_SHIFT) -#define ETH_RSS_IPV4_UDP (1 << ETH_RSS_IPV4_UDP_SHIFT) -#define ETH_RSS_IPV6_UDP (1 << ETH_RSS_IPV6_UDP_SHIFT) -#define ETH_RSS_IPV6_UDP_EX (1 << ETH_RSS_IPV6_UDP_EX_SHIFT) -/* for 40G only */ -#define ETH_RSS_NONF_IPV4_UDP (1ULL << ETH_RSS_NONF_IPV4_UDP_SHIFT) -#define ETH_RSS_NONF_IPV4_TCP (1ULL << ETH_RSS_NONF_IPV4_TCP_SHIFT) -#define ETH_RSS_NONF_IPV4_SCTP (1ULL << ETH_RSS_NONF_IPV4_SCTP_SHIFT) -#define ETH_RSS_NONF_IPV4_OTHER (1ULL << ETH_RSS_NONF_IPV4_OTHER_SHIFT) -#define ETH_RSS_FRAG_IPV4 (1ULL << ETH_RSS_FRAG_IPV4_SHIFT) -#define ETH_RSS_NONF_IPV6_UDP (1ULL << ETH_RSS_NONF_IPV6_UDP_SHIFT) -#define ETH_RSS_NONF_IPV6_TCP (1ULL << ETH_RSS_NONF_IPV6_TCP_SHIFT) -#define ETH_RSS_NONF_IPV6_SCTP (1ULL << ETH_RSS_NONF_IPV6_SCTP_SHIFT) -#define ETH_RSS_NONF_IPV6_OTHER (1ULL << ETH_RSS_NONF_IPV6_OTHER_SHIFT) -#define ETH_RSS_FRAG_IPV6 (1ULL << ETH_RSS_FRAG_IPV6_SHIFT) -/* FCOE relevant should not be used */ -#define ETH_RSS_FCOE_OX (1ULL << ETH_RSS_FCOE_OX_SHIFT) -#define ETH_RSS_FCOE_RX (1ULL << ETH_RSS_FCOE_RX_SHIFT) -#define ETH_RSS_FCOE_OTHER (1ULL << ETH_RSS_FCOE_OTHER_SHIFT) -#define ETH_RSS_L2_PAYLOAD (1ULL << ETH_RSS_L2_PAYLOAD_SHIFT) +/* + * The RSS offload types are defined based on flow types which are defined + * in rte_eth_ctrl.h. Different NIC hardwares may support different RSS offload + * types. The supported flow types or RSS offload types can be queried by + * rte_eth_dev_info_get(). + */ +#define ETH_RSS_IPV4 (1ULL << ETH_FLOW_TYPE_IPV4) +#define ETH_RSS_FRAG_IPV4 (1ULL << ETH_FLOW_TYPE_FRAG_IPV4) +#define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV4_TCP) +#define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV4_UDP) +#define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV4_SCTP) +#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV4_OTHER) +#define ETH_RSS_IPV6 (1ULL << ETH_FLOW_TYPE_IPV6) +#define ETH_RSS_FRAG_IPV6 (1ULL << ETH_FLOW_TYPE_FRAG_IPV6) +#define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV6_TCP) +#define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV6_UDP) +#define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV6_SCTP) +#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << ETH_FLOW_TYPE_NONFRAG_IPV6_OTHER) +#define ETH_RSS_L2_PAYLOAD (1ULL << ETH_FLOW_TYPE_L2_PAYLOAD) +#define ETH_RSS_IPV6_EX (1ULL << ETH_FLOW_TYPE_IPV6_EX) +#define ETH_RSS_IPV6_TCP_EX (1ULL << ETH_FLOW_TYPE_IPV6_TCP_EX) +#define ETH_RSS_IPV6_UDP_EX (1ULL << ETH_FLOW_TYPE_IPV6_UDP_EX) #define ETH_RSS_IP ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV6 | \ - ETH_RSS_NONF_IPV4_OTHER | \ - ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONF_IPV6_OTHER | \ - ETH_RSS_FRAG_IPV6) + ETH_RSS_IPV4 | \ + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_OTHER | \ + ETH_RSS_IPV6 | \ + ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_OTHER | \ + ETH_RSS_IPV6_EX) + #define ETH_RSS_UDP ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX | \ - ETH_RSS_NONF_IPV4_UDP | \ - ETH_RSS_NONF_IPV6_UDP) + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_IPV6_UDP_EX) + +#define ETH_RSS_TCP ( \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_IPV6_TCP_EX) + +#define ETH_RSS_SCTP ( \ + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_NONFRAG_IPV6_SCTP) + /**< Mask of valid RSS hash protocols */ #define ETH_RSS_PROTO_MASK ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_EX | \ - ETH_RSS_IPV6_TCP | \ - ETH_RSS_IPV6_TCP_EX | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX | \ - ETH_RSS_NONF_IPV4_UDP | \ - ETH_RSS_NONF_IPV4_TCP | \ - ETH_RSS_NONF_IPV4_SCTP | \ - ETH_RSS_NONF_IPV4_OTHER | \ - ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONF_IPV6_UDP | \ - ETH_RSS_NONF_IPV6_TCP | \ - ETH_RSS_NONF_IPV6_SCTP | \ - ETH_RSS_NONF_IPV6_OTHER | \ - ETH_RSS_FRAG_IPV6 | \ - ETH_RSS_L2_PAYLOAD) + ETH_RSS_IPV4 | \ + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_NONFRAG_IPV4_OTHER | \ + ETH_RSS_IPV6 | \ + ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_NONFRAG_IPV6_SCTP | \ + ETH_RSS_NONFRAG_IPV6_OTHER | \ + ETH_RSS_L2_PAYLOAD | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV6_UDP_EX) /* * Definitions used for redirection table entry size. @@ -935,6 +908,8 @@ struct rte_eth_dev_info { uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ uint16_t reta_size; /**< Device redirection table size, the total number of entries. */ + /** Bit mask of RSS offloads, the bit offset also means flow type */ + uint64_t flow_type_rss_offloads; struct rte_eth_rxconf default_rxconf; /**< Default RX configuration */ struct rte_eth_txconf default_txconf; /**< Default TX configuration */ uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */ diff --git a/lib/librte_pmd_e1000/e1000_ethdev.h b/lib/librte_pmd_e1000/e1000_ethdev.h index 71eb5fb..e201279 100644 --- a/lib/librte_pmd_e1000/e1000_ethdev.h +++ b/lib/librte_pmd_e1000/e1000_ethdev.h @@ -105,6 +105,17 @@ #define E1000_FTQF_QUEUE_SHIFT 16 #define E1000_FTQF_QUEUE_ENABLE 0x00000100 +#define IGB_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV6_UDP_EX) + /* structure for interrupt relative data */ struct e1000_interrupt { uint32_t flags; diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index 873d65e..49bf866 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -1346,6 +1346,7 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) break; } dev_info->reta_size = ETH_RSS_RETA_SIZE_128; + dev_info->flow_type_rss_offloads = IGB_RSS_OFFLOAD_ALL; dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index 5c394a9..cdf2cac 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -73,17 +73,6 @@ #include "e1000/e1000_api.h" #include "e1000_ethdev.h" -#define IGB_RSS_OFFLOAD_ALL ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_EX | \ - ETH_RSS_IPV6_TCP | \ - ETH_RSS_IPV6_TCP_EX | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX) - /* Bit Mask to indicate what bits required for building TX context */ #define IGB_TX_OFFLOAD_MASK ( \ PKT_TX_VLAN_PKT | \ @@ -1582,19 +1571,19 @@ igb_hw_rss_hash_set(struct e1000_hw *hw, struct rte_eth_rss_conf *rss_conf) mrqc = E1000_MRQC_ENABLE_RSS_4Q; /* RSS enabled. */ if (rss_hf & ETH_RSS_IPV4) mrqc |= E1000_MRQC_RSS_FIELD_IPV4; - if (rss_hf & ETH_RSS_IPV4_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) mrqc |= E1000_MRQC_RSS_FIELD_IPV4_TCP; if (rss_hf & ETH_RSS_IPV6) mrqc |= E1000_MRQC_RSS_FIELD_IPV6; if (rss_hf & ETH_RSS_IPV6_EX) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_EX; - if (rss_hf & ETH_RSS_IPV6_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_TCP; if (rss_hf & ETH_RSS_IPV6_TCP_EX) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_TCP_EX; - if (rss_hf & ETH_RSS_IPV4_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) mrqc |= E1000_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hf & ETH_RSS_IPV6_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hf & ETH_RSS_IPV6_UDP_EX) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_UDP_EX; @@ -1664,19 +1653,19 @@ int eth_igb_rss_hash_conf_get(struct rte_eth_dev *dev, if (mrqc & E1000_MRQC_RSS_FIELD_IPV4) rss_hf |= ETH_RSS_IPV4; if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_TCP) - rss_hf |= ETH_RSS_IPV4_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6) rss_hf |= ETH_RSS_IPV6; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_EX) rss_hf |= ETH_RSS_IPV6_EX; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP) - rss_hf |= ETH_RSS_IPV6_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP_EX) rss_hf |= ETH_RSS_IPV6_TCP_EX; if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_UDP) - rss_hf |= ETH_RSS_IPV4_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP) - rss_hf |= ETH_RSS_IPV6_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP_EX) rss_hf |= ETH_RSS_IPV6_UDP_EX; rss_conf->rss_hf = rss_hf; diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index de1eff4..ed58d08 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -1518,6 +1518,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM; dev_info->reta_size = pf->hash_lut_size; + dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL; dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { @@ -4574,26 +4575,26 @@ i40e_config_hena(uint64_t flags) if (!flags) return hena; - if (flags & ETH_RSS_NONF_IPV4_UDP) - hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP; - if (flags & ETH_RSS_NONF_IPV4_TCP) + if (flags & ETH_RSS_FRAG_IPV4) + hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4; + if (flags & ETH_RSS_NONFRAG_IPV4_TCP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_TCP; - if (flags & ETH_RSS_NONF_IPV4_SCTP) + if (flags & ETH_RSS_NONFRAG_IPV4_UDP) + hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP; + if (flags & ETH_RSS_NONFRAG_IPV4_SCTP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP; - if (flags & ETH_RSS_NONF_IPV4_OTHER) + if (flags & ETH_RSS_NONFRAG_IPV4_OTHER) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER; - if (flags & ETH_RSS_FRAG_IPV4) - hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4; - if (flags & ETH_RSS_NONF_IPV6_UDP) - hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP; - if (flags & ETH_RSS_NONF_IPV6_TCP) + if (flags & ETH_RSS_FRAG_IPV6) + hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6; + if (flags & ETH_RSS_NONFRAG_IPV6_TCP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_TCP; - if (flags & ETH_RSS_NONF_IPV6_SCTP) + if (flags & ETH_RSS_NONFRAG_IPV6_UDP) + hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP; + if (flags & ETH_RSS_NONFRAG_IPV6_SCTP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_SCTP; - if (flags & ETH_RSS_NONF_IPV6_OTHER) + if (flags & ETH_RSS_NONFRAG_IPV6_OTHER) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER; - if (flags & ETH_RSS_FRAG_IPV6) - hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6; if (flags & ETH_RSS_L2_PAYLOAD) hena |= 1ULL << I40E_FILTER_PCTYPE_L2_PAYLOAD; @@ -4608,27 +4609,26 @@ i40e_parse_hena(uint64_t flags) if (!flags) return rss_hf; - - if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP)) - rss_hf |= ETH_RSS_NONF_IPV4_UDP; + if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4)) + rss_hf |= ETH_RSS_FRAG_IPV4; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_TCP)) - rss_hf |= ETH_RSS_NONF_IPV4_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP; + if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP)) + rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP)) - rss_hf |= ETH_RSS_NONF_IPV4_SCTP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_SCTP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER)) - rss_hf |= ETH_RSS_NONF_IPV4_OTHER; - if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4)) - rss_hf |= ETH_RSS_FRAG_IPV4; - if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP)) - rss_hf |= ETH_RSS_NONF_IPV6_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_OTHER; + if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6)) + rss_hf |= ETH_RSS_FRAG_IPV6; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_TCP)) - rss_hf |= ETH_RSS_NONF_IPV6_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP; + if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP)) + rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_SCTP)) - rss_hf |= ETH_RSS_NONF_IPV6_SCTP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_SCTP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER)) - rss_hf |= ETH_RSS_NONF_IPV6_OTHER; - if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6)) - rss_hf |= ETH_RSS_FRAG_IPV6; + rss_hf |= ETH_RSS_NONFRAG_IPV6_OTHER; if (flags & (1ULL << I40E_FILTER_PCTYPE_L2_PAYLOAD)) rss_hf |= ETH_RSS_L2_PAYLOAD; diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h index e2a8db3..b8bf92a 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.h +++ b/lib/librte_pmd_i40e/i40e_ethdev.h @@ -120,16 +120,16 @@ enum i40e_flxpld_layer_idx { I40E_FLAG_VXLAN) #define I40E_RSS_OFFLOAD_ALL ( \ - ETH_RSS_NONF_IPV4_UDP | \ - ETH_RSS_NONF_IPV4_TCP | \ - ETH_RSS_NONF_IPV4_SCTP | \ - ETH_RSS_NONF_IPV4_OTHER | \ ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONF_IPV6_UDP | \ - ETH_RSS_NONF_IPV6_TCP | \ - ETH_RSS_NONF_IPV6_SCTP | \ - ETH_RSS_NONF_IPV6_OTHER | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_NONFRAG_IPV4_OTHER | \ ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_NONFRAG_IPV6_SCTP | \ + ETH_RSS_NONFRAG_IPV6_OTHER | \ ETH_RSS_L2_PAYLOAD) /* All bits of RSS hash enable */ diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c index fe46cf1..911835f 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c +++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c @@ -1646,6 +1646,7 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN; dev_info->max_rx_pktlen = I40E_FRAME_SIZE_MAX; dev_info->reta_size = ETH_RSS_RETA_SIZE_64; + dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL; dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index 3fc3738..db55001 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -2014,6 +2014,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) ETH_TXQ_FLAGS_NOOFFLOADS, }; dev_info->reta_size = ETH_RSS_RETA_SIZE_128; + dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL; } static void diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h index 730098d..f9d1c78 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h @@ -98,6 +98,17 @@ #define IXGBE_5TUPLE_MAX_PRI 7 #define IXGBE_5TUPLE_MIN_PRI 1 +#define IXGBE_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV6_UDP_EX) + /* * Information about the fdir mode. */ diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index 840bc07..cb2b9d6 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -80,17 +80,6 @@ #include "ixgbe/ixgbe_common.h" #include "ixgbe_rxtx.h" -#define IXGBE_RSS_OFFLOAD_ALL ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_EX | \ - ETH_RSS_IPV6_TCP | \ - ETH_RSS_IPV6_TCP_EX | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX) - /* Bit Mask to indicate what bits required for building TX context */ #define IXGBE_TX_OFFLOAD_MASK ( \ PKT_TX_VLAN_PKT | \ @@ -2432,19 +2421,19 @@ ixgbe_hw_rss_hash_set(struct ixgbe_hw *hw, struct rte_eth_rss_conf *rss_conf) mrqc = IXGBE_MRQC_RSSEN; /* Enable RSS */ if (rss_hf & ETH_RSS_IPV4) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4; - if (rss_hf & ETH_RSS_IPV4_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_TCP; if (rss_hf & ETH_RSS_IPV6) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6; if (rss_hf & ETH_RSS_IPV6_EX) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX; - if (rss_hf & ETH_RSS_IPV6_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_TCP; if (rss_hf & ETH_RSS_IPV6_TCP_EX) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP; - if (rss_hf & ETH_RSS_IPV4_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hf & ETH_RSS_IPV6_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hf & ETH_RSS_IPV6_UDP_EX) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP; @@ -2518,19 +2507,19 @@ ixgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev, if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV4) rss_hf |= ETH_RSS_IPV4; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV4_TCP) - rss_hf |= ETH_RSS_IPV4_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6) rss_hf |= ETH_RSS_IPV6; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX) rss_hf |= ETH_RSS_IPV6_EX; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_TCP) - rss_hf |= ETH_RSS_IPV6_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP) rss_hf |= ETH_RSS_IPV6_TCP_EX; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV4_UDP) - rss_hf |= ETH_RSS_IPV4_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_UDP) - rss_hf |= ETH_RSS_IPV6_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP) rss_hf |= ETH_RSS_IPV6_UDP_EX; rss_conf->rss_hf = rss_hf; diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c index ef0af16..6068c60 100644 --- a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c +++ b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c @@ -645,6 +645,7 @@ vmxnet3_dev_info_get(__attribute__((unused))struct rte_eth_dev *dev, struct rte_ dev_info->default_txconf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; + dev_info->flow_type_rss_offloads = VMXNET3_RSS_OFFLOAD_ALL; } /* return 0 means link status changed, -1 means not changed */ diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h index 0941cfc..09993cf 100644 --- a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h +++ b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h @@ -61,6 +61,12 @@ #define VMXNET3_RSS_MAX_KEY_SIZE 40 #define VMXNET3_RSS_MAX_IND_TABLE_SIZE 128 +#define VMXNET3_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP) + /* RSS configuration structure - shared with device through GPA */ typedef struct VMXNET3_RSSConf { diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c index 8425f32..4d8a010 100644 --- a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c +++ b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c @@ -998,12 +998,6 @@ static uint8_t rss_intel_key[40] = { int vmxnet3_rss_configure(struct rte_eth_dev *dev) { -#define VMXNET3_RSS_OFFLOAD_ALL ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_TCP) - struct vmxnet3_hw *hw = dev->data->dev_private; struct VMXNET3_RSSConf *dev_rss_conf; struct rte_eth_rss_conf *port_rss_conf; @@ -1042,11 +1036,11 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev) rss_hf = port_rss_conf->rss_hf & VMXNET3_RSS_OFFLOAD_ALL; if (rss_hf & ETH_RSS_IPV4) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV4; - if (rss_hf & ETH_RSS_IPV4_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV4; if (rss_hf & ETH_RSS_IPV6) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6; - if (rss_hf & ETH_RSS_IPV6_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6; return VMXNET3_SUCCESS; -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH 7/7] app/testpmd: support new rss offloads 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang ` (5 preceding siblings ...) 2015-01-19 6:56 ` [dpdk-dev] [PATCH 6/7] ethdev: unification of RSS offload types Helin Zhang @ 2015-01-19 6:56 ` Helin Zhang 2015-01-22 7:48 ` [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Wu, Jingjing 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang 8 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-01-19 6:56 UTC (permalink / raw) To: dev RSS offloads supported 'ip' and 'udp' only, which did not demonstrate all of the hardware capabilities. The modifications adds support of new RSS offloads of 'tcp', 'sctp', 'ether' and 'all'. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/cmdline.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 80b9c32..02cd5b2 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -588,7 +588,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Set crc-strip/rx-checksum/hardware-vlan/drop_en" " for ports.\n\n" - "port config all rss (ip|udp|none)\n" + "port config all rss (all|ip|tcp|udp|sctp|ether|none)\n" " Set the RSS mode.\n\n" "port config port-id rss reta (hash,queue)[,(hash,queue)]\n" @@ -1382,10 +1382,20 @@ cmd_config_rss_parsed(void *parsed_result, struct rte_eth_rss_conf rss_conf; uint8_t i; - if (!strcmp(res->value, "ip")) + if (!strcmp(res->value, "all")) + rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP | + ETH_RSS_UDP | ETH_RSS_SCTP | + ETH_RSS_L2_PAYLOAD; + else if (!strcmp(res->value, "ip")) rss_conf.rss_hf = ETH_RSS_IP; else if (!strcmp(res->value, "udp")) rss_conf.rss_hf = ETH_RSS_UDP; + else if (!strcmp(res->value, "tcp")) + rss_conf.rss_hf = ETH_RSS_TCP; + else if (!strcmp(res->value, "sctp")) + rss_conf.rss_hf = ETH_RSS_SCTP; + else if (!strcmp(res->value, "ether")) + rss_conf.rss_hf = ETH_RSS_L2_PAYLOAD; else if (!strcmp(res->value, "none")) rss_conf.rss_hf = 0; else { @@ -1406,12 +1416,13 @@ cmdline_parse_token_string_t cmd_config_rss_all = cmdline_parse_token_string_t cmd_config_rss_name = TOKEN_STRING_INITIALIZER(struct cmd_config_rss, name, "rss"); cmdline_parse_token_string_t cmd_config_rss_value = - TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value, "ip#udp#none"); + TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value, + "all#ip#tcp#udp#sctp#ether#none"); cmdline_parse_inst_t cmd_config_rss = { .f = cmd_config_rss_parsed, .data = NULL, - .help_str = "port config all rss ip|udp|none", + .help_str = "port config all rss all|ip|tcp|udp|sctp|ether|none", .tokens = { (void *)&cmd_config_rss_port, (void *)&cmd_config_rss_keyword, -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang ` (6 preceding siblings ...) 2015-01-19 6:56 ` [dpdk-dev] [PATCH 7/7] app/testpmd: support new rss offloads Helin Zhang @ 2015-01-22 7:48 ` Wu, Jingjing 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang 8 siblings, 0 replies; 24+ messages in thread From: Wu, Jingjing @ 2015-01-22 7:48 UTC (permalink / raw) To: Zhang, Helin, dev > -----Original Message----- > From: Zhang, Helin > Sent: Monday, January 19, 2015 2:56 PM > To: dev@dpdk.org > Cc: Wu, Jingjing; Cao, Waterman; Zhang, Helin > Subject: [PATCH 0/7] unification of flow types and RSS offload types > > It unifies the flow types and RSS offload types for all PMDs. Previously flow > types are defined actually for i40e, and there has different RSS offloads tyeps > for 1/10G and 40G seperately. This is not so convenient for application > development, and not good for adding new PMDs. In addition, it enables > new RSS offloads of 'tcp' and 'all' in testpmd. > > > Helin Zhang (7): > app/test-pmd: code style fix > ethdev: code style fix > i40e: code style fix > ethdev: fix of calculating the size of flow type mask array > ethdev: unification of flow types > ethdev: unification of RSS offload types > app/testpmd: support new rss offloads > > app/test-pipeline/init.c | 2 +- > app/test-pmd/cmdline.c | 107 +++++++++++++++-------- > app/test-pmd/config.c | 137 +++++++++++++++++++---------- > examples/distributor/main.c | 9 +- > examples/ip_pipeline/init.c | 2 +- > examples/l3fwd-acl/main.c | 7 +- > lib/librte_ether/rte_eth_ctrl.h | 91 +++++++++++--------- > lib/librte_ether/rte_ethdev.h | 147 +++++++++++++------------------- > lib/librte_pmd_e1000/e1000_ethdev.h | 11 +++ > lib/librte_pmd_e1000/igb_ethdev.c | 1 + > lib/librte_pmd_e1000/igb_rxtx.c | 27 ++---- > lib/librte_pmd_i40e/i40e_ethdev.c | 126 ++++++++++++++------------- > lib/librte_pmd_i40e/i40e_ethdev.h | 50 +++++------ > lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1 + > lib/librte_pmd_i40e/i40e_fdir.c | 91 ++++++++++---------- > lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 1 + > lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 11 +++ > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 27 ++---- > lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 1 + > lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h | 6 ++ > lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 10 +-- > 21 files changed, 473 insertions(+), 392 deletions(-) > > -- > 1.9.3 Acked-by: Jingjing Wu <jingjing.wu@intel.com> ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang ` (7 preceding siblings ...) 2015-01-22 7:48 ` [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Wu, Jingjing @ 2015-02-04 7:16 ` Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 1/7] app/test-pmd: code style fix Helin Zhang ` (7 more replies) 8 siblings, 8 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev It unifies the flow types and RSS offload types for all PMDs. Previously flow types are defined specifically for i40e, and there has different RSS offloads tyeps for 1/10G and 40G seperately. This is not so convenient for application development, and not good for adding new PMDs. In addition, it enables new RSS offloads of 'tcp' and 'all' in testpmd. v2 changes: * Integrated with configuring hash functions. * Corrected the wrong help string of flow director parameters. * Renamed the flow types from ETH_FLOW_TYPE_ to RTE_ETH_FLOW_. * Removed useless annotations for flow type elements in rte_eth_ctrl.h. Helin Zhang (7): app/test-pmd: code style fix ethdev: code style fix i40e: code style fix ethdev: fix of calculating the size of flow type mask array ethdev: unification of flow types ethdev: unification of RSS offload types app/testpmd: support new rss offloads app/test-pipeline/init.c | 2 +- app/test-pmd/cmdline.c | 154 +++++++++++++++++++----------- app/test-pmd/config.c | 137 +++++++++++++++++--------- examples/distributor/main.c | 9 +- examples/ip_pipeline/init.c | 2 +- examples/l3fwd-acl/main.c | 7 +- lib/librte_ether/rte_eth_ctrl.h | 94 ++++++++++-------- lib/librte_ether/rte_ethdev.h | 147 ++++++++++++---------------- lib/librte_pmd_e1000/e1000_ethdev.h | 11 +++ lib/librte_pmd_e1000/igb_ethdev.c | 1 + lib/librte_pmd_e1000/igb_rxtx.c | 27 ++---- lib/librte_pmd_i40e/i40e_ethdev.c | 164 +++++++++++++++++--------------- lib/librte_pmd_i40e/i40e_ethdev.h | 52 +++++----- lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1 + lib/librte_pmd_i40e/i40e_fdir.c | 99 ++++++++++--------- lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 1 + lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 11 +++ lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 27 ++---- lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 1 + lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h | 6 ++ lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 10 +- 21 files changed, 525 insertions(+), 438 deletions(-) -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 1/7] app/test-pmd: code style fix 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang @ 2015-02-04 7:16 ` Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 2/7] ethdev: " Helin Zhang ` (6 subsequent siblings) 7 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev Added code style fixes. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/config.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index c40f819..ba394e4 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -1918,11 +1918,11 @@ fdir_get_infos(portid_t port_id) fdir_stats_border, port_id, fdir_stats_border); printf(" MODE: "); if (fdir_info.mode == RTE_FDIR_MODE_PERFECT) - printf(" PERFECT\n"); + printf(" PERFECT\n"); else if (fdir_info.mode == RTE_FDIR_MODE_SIGNATURE) - printf(" SIGNATURE\n"); + printf(" SIGNATURE\n"); else - printf(" DISABLE\n"); + printf(" DISABLE\n"); printf(" SUPPORTED FLOW TYPE: "); print_fdir_flow_type(fdir_info.flow_types_mask[0]); printf(" FLEX PAYLOAD INFO:\n"); -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 2/7] ethdev: code style fix 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 1/7] app/test-pmd: code style fix Helin Zhang @ 2015-02-04 7:16 ` Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 3/7] i40e: " Helin Zhang ` (5 subsequent siblings) 7 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev Added code style fixes. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 0ce241e..e936f3a 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -406,29 +406,29 @@ enum rte_fdir_mode { * It can be gotten to help taking specific configurations per device. */ struct rte_eth_fdir_info { - enum rte_fdir_mode mode; /**< Flow director mode */ + enum rte_fdir_mode mode; /**< Flow director mode */ + /** Flex payload configuration information */ struct rte_eth_fdir_flex_conf flex_conf; - /**< Flex payload configuration information */ - uint32_t guarant_spc; /**< Guaranteed spaces.*/ - uint32_t best_spc; /**< Best effort spaces.*/ + uint32_t guarant_spc; /**< Guaranteed spaces.*/ + uint32_t best_spc; /**< Best effort spaces.*/ + /** Bit mask for every supported flow type. */ uint32_t flow_types_mask[RTE_ETH_FLOW_TYPE_MAX / sizeof(uint32_t)]; - /**< Bit mask for every supported flow type. */ - uint32_t max_flexpayload; /**< Total flex payload in bytes. */ + uint32_t max_flexpayload; /**< Total flex payload in bytes. */ + /** Flexible payload unit in bytes. Size and alignments of all flex + payload segments should be multiplies of this value. */ uint32_t flex_payload_unit; - /**< Flexible payload unit in bytes. Size and alignments of all flex - payload segments should be multiplies of this value. */ + /** Max number of flexible payload continuous segments. + Each segment should be a multiple of flex_payload_unit.*/ uint32_t max_flex_payload_segment_num; - /**< Max number of flexible payload continuous segments. - Each segment should be a multiple of flex_payload_unit.*/ + /** Maximum src_offset in bytes allowed. It indicates that + src_offset[i] in struct rte_eth_flex_payload_cfg should be less + than this value. */ uint16_t flex_payload_limit; - /**< Maximum src_offset in bytes allowed. It indicates that - src_offset[i] in struct rte_eth_flex_payload_cfg should be - less than this value. */ + /** Flex bitmask unit in bytes. Size of flex bitmasks should be a + multiply of this value. */ uint32_t flex_bitmask_unit; - /**< Flex bitmask unit in bytes. Size of flex bitmasks should - be a multiply of this value. */ + /** Max supported size of flex bitmasks in flex_bitmask_unit */ uint32_t max_flex_bitmask_num; - /**< Max supported size of flex bitmasks in flex_bitmask_unit */ }; /** -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 3/7] i40e: code style fix 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 1/7] app/test-pmd: code style fix Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 2/7] ethdev: " Helin Zhang @ 2015-02-04 7:16 ` Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang ` (4 subsequent siblings) 7 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev Added code style fixes. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_pmd_i40e/i40e_fdir.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/librte_pmd_i40e/i40e_fdir.c b/lib/librte_pmd_i40e/i40e_fdir.c index 68511c8..c9e535b 100644 --- a/lib/librte_pmd_i40e/i40e_fdir.c +++ b/lib/librte_pmd_i40e/i40e_fdir.c @@ -677,11 +677,8 @@ i40e_fdir_configure(struct rte_eth_dev *dev) i40e_set_flx_pld_cfg(pf, &conf->flex_set[i]); /* configure flex mask*/ for (i = 0; i < conf->nb_flexmasks; i++) { - pctype = i40e_flowtype_to_pctype( - conf->flex_mask[i].flow_type); - i40e_set_flex_mask_on_pctype(pf, - pctype, - &conf->flex_mask[i]); + pctype = i40e_flowtype_to_pctype(conf->flex_mask[i].flow_type); + i40e_set_flex_mask_on_pctype(pf, pctype, &conf->flex_mask[i]); } return ret; -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 4/7] ethdev: fix of calculating the size of flow type mask array 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang ` (2 preceding siblings ...) 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 3/7] i40e: " Helin Zhang @ 2015-02-04 7:16 ` Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 5/7] ethdev: unification of flow types Helin Zhang ` (3 subsequent siblings) 7 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev It wrongly calculates the size of the flow type mask array. The fix is to align the flow type maximum index ID with the number of element bit width, and then divide the number of element bit width. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_ether/rte_eth_ctrl.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index e936f3a..cbd36ea 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -398,6 +398,10 @@ enum rte_fdir_mode { RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode. */ }; +#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) + /** * A structure used to get the information of flow director filter. * It supports RTE_ETH_FILTER_FDIR with RTE_ETH_FILTER_INFO operation. @@ -412,7 +416,7 @@ struct rte_eth_fdir_info { uint32_t guarant_spc; /**< Guaranteed spaces.*/ uint32_t best_spc; /**< Best effort spaces.*/ /** Bit mask for every supported flow type. */ - uint32_t flow_types_mask[RTE_ETH_FLOW_TYPE_MAX / sizeof(uint32_t)]; + uint32_t flow_types_mask[RTE_FLOW_MASK_ARRAY_SIZE]; uint32_t max_flexpayload; /**< Total flex payload in bytes. */ /** Flexible payload unit in bytes. Size and alignments of all flex payload segments should be multiplies of this value. */ @@ -477,7 +481,6 @@ enum rte_eth_hash_function { RTE_ETH_HASH_FUNCTION_MAX, }; -#define UINT32_BIT (CHAR_BIT * sizeof(uint32_t)) #define RTE_SYM_HASH_MASK_ARRAY_SIZE \ (RTE_ALIGN(RTE_ETH_FLOW_TYPE_MAX, UINT32_BIT)/UINT32_BIT) /** -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 5/7] ethdev: unification of flow types 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang ` (3 preceding siblings ...) 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang @ 2015-02-04 7:16 ` Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 6/7] ethdev: unification of RSS offload types Helin Zhang ` (2 subsequent siblings) 7 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev Flow types was defined actually for i40e hardware specifically, and wasn't able to be used for defining RSS offload types of all PMDs. It removed the enum flow types, and uses macros instead with new names. The new macros can be used for defining RSS offload types later. Also modifications are made in i40e and testpmd accordingly. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/cmdline.c | 135 +++++++++++++++++++++++--------------- app/test-pmd/config.c | 71 +++++++++++++------- lib/librte_ether/rte_eth_ctrl.h | 57 +++++++++------- lib/librte_pmd_i40e/i40e_ethdev.c | 106 ++++++++++++++++-------------- lib/librte_pmd_i40e/i40e_ethdev.h | 36 +++++----- lib/librte_pmd_i40e/i40e_fdir.c | 92 +++++++++++++------------- 6 files changed, 287 insertions(+), 210 deletions(-) v2 changes: * Integrated with configuring hash functions. * Corrected the wrong help string of flow director parameters. * Renamed the flow types from ETH_FLOW_TYPE_ to RTE_ETH_FLOW_. * Removed useless annotations for flow type elements in rte_eth_ctrl.h. diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 590e427..679ea07 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -703,14 +703,14 @@ static void cmd_help_long_parsed(void *parsed_result, " get info of a flex filter.\n\n" "flow_director_filter (port_id) (add|del)" - " flow (ip4|ip4-frag|ip6|ip6-frag)" + " flow (ipv4-other|ipv4-frag|ipv6-other|ipv6-frag)" " src (src_ip_address) dst (dst_ip_address)" " 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)" - " 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)" " flexbytes (flexbytes_value)" @@ -718,7 +718,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Add/Del an UDP/TCP type flow director filter.\n\n" "flow_director_filter (port_id) (add|del)" - " flow (sctp4|sctp6)" + " flow (ipv4-sctp|ipv6-sctp)" " src (src_ip_address) dst (dst_ip_address)" " tag (verification_tag)" " flexbytes (flexbytes_value) (drop|fwd)" @@ -729,7 +729,8 @@ static void cmd_help_long_parsed(void *parsed_result, " Flush all flow director entries of a device.\n\n" "flow_director_flex_mask (port_id)" - " flow (ip4|ip4-frag|tcp4|udp4|sctp4|ip6|ip6-frag|tcp6|udp6|sctp6|all)" + " flow (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" @@ -748,7 +749,8 @@ static void cmd_help_long_parsed(void *parsed_result, " 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" ); @@ -8147,31 +8149,34 @@ parse_flexbytes(const char *q_arg, uint8_t *flexbytes, uint16_t max_num) 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[] = { - {"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(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) \ @@ -8224,9 +8229,9 @@ cmd_flow_director_filter_parsed(void *parsed_result, 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_UDPV4: - case RTE_ETH_FLOW_TYPE_TCPV4: + 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, @@ -8237,7 +8242,7 @@ cmd_flow_director_filter_parsed(void *parsed_result, 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, @@ -8246,9 +8251,9 @@ cmd_flow_director_filter_parsed(void *parsed_result, 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_UDPV6: - case RTE_ETH_FLOW_TYPE_TCPV6: + 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, @@ -8259,7 +8264,7 @@ cmd_flow_director_filter_parsed(void *parsed_result, 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, @@ -8310,9 +8315,8 @@ cmdline_parse_token_string_t cmd_flow_director_flow = 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"); @@ -8500,7 +8504,9 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result, struct cmd_flow_director_flex_mask_result *res = parsed_result; struct rte_eth_fdir_flex_mask flex_mask; struct rte_port *port; - enum rte_eth_flow_type i; + struct rte_eth_fdir_info fdir_info; + uint32_t flow_type_mask; + uint16_t i; int ret; if (res->port_id > nb_ports) { @@ -8523,10 +8529,23 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result, printf("error: Cannot parse mask input.\n"); 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")) { - for (i = RTE_ETH_FLOW_TYPE_UDPV4; - i <= RTE_ETH_FLOW_TYPE_FRAG_IPV6; - 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))) + continue; flex_mask.flow_type = i; fdir_set_flex_mask(res->port_id, &flex_mask); } @@ -8534,6 +8553,11 @@ cmd_flow_director_flex_mask_parsed(void *parsed_result, 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); } @@ -8550,9 +8574,8 @@ cmdline_parse_token_string_t cmd_flow_director_flexmask_flow = 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, - "ip4#ip4-frag#tcp4#udp4#sctp4#" - "ip6#ip6-frag#tcp6#udp6#sctp6#all"); + flow_type, "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); @@ -8809,23 +8832,26 @@ struct cmd_get_hash_global_config_result { }; 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++) { @@ -8843,7 +8869,8 @@ cmd_get_hash_global_config_parsed(void *parsed_result, { 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; @@ -8876,13 +8903,13 @@ cmd_get_hash_global_config_parsed(void *parsed_result, 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 " @@ -8977,7 +9004,8 @@ cmdline_parse_token_string_t cmd_set_hash_global_config_hash_func = 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"); @@ -8987,7 +9015,8 @@ cmdline_parse_inst_t cmd_set_hash_global_config = { .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, diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index ba394e4..3e5583b 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -96,19 +96,7 @@ #include "testpmd.h" -static const char *flowtype_str[RTE_ETH_FLOW_TYPE_MAX] = { - NULL, - "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) @@ -1843,15 +1831,50 @@ print_fdir_flex_payload(struct rte_eth_fdir_flex_conf *flex_conf) 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[] = { + {"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) { struct rte_eth_fdir_flex_mask *mask; int 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 < RTE_ETH_FDIR_MAX_FLEXLEN; j++) printf(" %02x", mask->mask[j]); } @@ -1861,13 +1884,17 @@ print_fdir_flex_mask(struct rte_eth_fdir_flex_conf *flex_conf) 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"); } @@ -2028,13 +2055,13 @@ fdir_set_flex_mask(portid_t port_id, struct rte_eth_fdir_flex_mask *cfg) 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++; diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index cbd36ea..0b2275d 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -46,6 +46,35 @@ 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_IPV4 1 +#define RTE_ETH_FLOW_FRAG_IPV4 2 +#define RTE_ETH_FLOW_NONFRAG_IPV4_TCP 3 +#define RTE_ETH_FLOW_NONFRAG_IPV4_UDP 4 +#define RTE_ETH_FLOW_NONFRAG_IPV4_SCTP 5 +#define RTE_ETH_FLOW_NONFRAG_IPV4_OTHER 6 +#define RTE_ETH_FLOW_IPV6 7 +#define RTE_ETH_FLOW_FRAG_IPV6 8 +#define RTE_ETH_FLOW_NONFRAG_IPV6_TCP 9 +#define RTE_ETH_FLOW_NONFRAG_IPV6_UDP 10 +#define RTE_ETH_FLOW_NONFRAG_IPV6_SCTP 11 +#define RTE_ETH_FLOW_NONFRAG_IPV6_OTHER 12 +#define RTE_ETH_FLOW_L2_PAYLOAD 13 +#define RTE_ETH_FLOW_IPV6_EX 14 +#define RTE_ETH_FLOW_IPV6_TCP_EX 15 +#define RTE_ETH_FLOW_IPV6_UDP_EX 16 +#define RTE_ETH_FLOW_MAX 17 + /** * Feature filter types */ @@ -179,24 +208,6 @@ struct rte_eth_tunnel_filter_conf { #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_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 */ struct rte_eth_ipv4_flow { @@ -291,7 +302,7 @@ struct rte_eth_fdir_flow_ext { * 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; @@ -371,7 +382,7 @@ struct rte_eth_flex_payload_cfg { * 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 */ }; @@ -385,7 +396,7 @@ struct rte_eth_fdir_flex_conf { 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 */ }; @@ -400,7 +411,7 @@ enum rte_fdir_mode { #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. @@ -482,7 +493,7 @@ enum rte_eth_hash_function { }; #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. diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index 9fa6bec..7fe6178 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -94,16 +94,17 @@ 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, @@ -5196,7 +5197,7 @@ i40e_get_hash_filter_global_config(struct i40e_hw *hw, 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)); @@ -5208,13 +5209,13 @@ i40e_get_hash_filter_global_config(struct i40e_hw *hw, 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); @@ -5271,7 +5272,8 @@ i40e_set_hash_filter_global_config(struct i40e_hw *hw, 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; @@ -5284,7 +5286,7 @@ i40e_set_hash_filter_global_config(struct i40e_hw *hw, 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); @@ -5549,48 +5551,56 @@ i40e_hw_init(struct i40e_hw *hw) } 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]; diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h index f913ea9..cda032d 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.h +++ b/lib/librte_pmd_i40e/i40e_ethdev.h @@ -471,10 +471,8 @@ const struct rte_memzone *i40e_memzone_reserve(const char *name, 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); @@ -540,28 +538,30 @@ i40e_init_adminq_parameter(struct i40e_hw *hw) 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_ */ diff --git a/lib/librte_pmd_i40e/i40e_fdir.c b/lib/librte_pmd_i40e/i40e_fdir.c index c9e535b..5bb6217 100644 --- a/lib/librte_pmd_i40e/i40e_fdir.c +++ b/lib/librte_pmd_i40e/i40e_fdir.c @@ -94,17 +94,17 @@ 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)) @@ -498,13 +498,13 @@ i40e_check_fdir_flex_conf(const struct rte_eth_fdir_flex_conf *conf) } /* 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; } @@ -692,24 +692,24 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input, 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); @@ -726,11 +726,11 @@ i40e_fdir_fill_eth_ip_head(const struct rte_eth_fdir_input *fdir_input, 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); @@ -784,7 +784,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, /* 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); @@ -798,7 +798,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, 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); @@ -812,21 +812,21 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, 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); @@ -840,7 +840,7 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, 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); @@ -854,15 +854,15 @@ i40e_fdir_construct_pkt(struct i40e_pf *pf, 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; @@ -983,7 +983,7 @@ i40e_add_del_fdir_filter(struct rte_eth_dev *dev, 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; } @@ -1214,7 +1214,7 @@ i40e_fdir_info_get_flex_mask(struct i40e_pf *pf, { 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; @@ -1270,7 +1270,7 @@ i40e_fdir_info_get(struct rte_eth_dev *dev, struct rte_eth_fdir_info *fdir) 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; -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 6/7] ethdev: unification of RSS offload types 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang ` (4 preceding siblings ...) 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 5/7] ethdev: unification of flow types Helin Zhang @ 2015-02-04 7:16 ` Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 7/7] app/testpmd: support new rss offloads Helin Zhang 2015-02-15 5:03 ` [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types Wu, Jingjing 7 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev RSS offload types were defined seperately for 1/10G and 40G NICs, and have no relationship with flow types. The modifications are to unify all RSS offload types for all PMDs. Unified RSS offload types have new and common names which can be used for any PMD or applications, and decouple from specific hardwares. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pipeline/init.c | 2 +- app/test-pmd/config.c | 60 +++++++++---- examples/distributor/main.c | 9 +- examples/ip_pipeline/init.c | 2 +- examples/l3fwd-acl/main.c | 7 +- lib/librte_ether/rte_ethdev.h | 147 +++++++++++++------------------- lib/librte_pmd_e1000/e1000_ethdev.h | 11 +++ lib/librte_pmd_e1000/igb_ethdev.c | 1 + lib/librte_pmd_e1000/igb_rxtx.c | 27 ++---- lib/librte_pmd_i40e/i40e_ethdev.c | 58 ++++++------- lib/librte_pmd_i40e/i40e_ethdev.h | 16 ++-- lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1 + lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 1 + lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 11 +++ lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 27 ++---- lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 1 + lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h | 6 ++ lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 10 +-- 18 files changed, 198 insertions(+), 199 deletions(-) v2 changes: * Renamed flow types from ETH_FLOW_TYPE_ to RTE_ETH_FLOW_. diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c index 17b6d23..cd2ebc4 100644 --- a/app/test-pipeline/init.c +++ b/app/test-pipeline/init.c @@ -112,7 +112,7 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 3e5583b..588101b 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -347,6 +347,21 @@ port_infos_display(portid_t port_id) rte_eth_dev_info_get(port_id, &dev_info); if (dev_info.reta_size > 0) printf("Redirection table size: %u\n", dev_info.reta_size); + if (!dev_info.flow_type_rss_offloads) + printf("No flow type is supported.\n"); + else { + uint16_t i; + char *p; + + printf("Supported flow types:\n"); + for (i = RTE_ETH_FLOW_UNKNOWN + 1; i < RTE_ETH_FLOW_MAX; + i++) { + if (!(dev_info.flow_type_rss_offloads & (1ULL << i))) + continue; + p = flowtype_to_str(i); + printf(" %s\n", (p ? p : "unknown")); + } + } } int @@ -810,6 +825,29 @@ port_rss_reta_info(portid_t port_id, void port_rss_hash_conf_show(portid_t port_id, int show_rss_key) { + struct rss_type_info { + char str[32]; + uint64_t rss_type; + }; + static const struct rss_type_info rss_type_table[] = { + {"ipv4", ETH_RSS_IPV4}, + {"ipv4-frag", ETH_RSS_FRAG_IPV4}, + {"ipv4-tcp", ETH_RSS_NONFRAG_IPV4_TCP}, + {"ipv4-udp", ETH_RSS_NONFRAG_IPV4_UDP}, + {"ipv4-sctp", ETH_RSS_NONFRAG_IPV4_SCTP}, + {"ipv4-other", ETH_RSS_NONFRAG_IPV4_OTHER}, + {"ipv6", ETH_RSS_IPV6}, + {"ipv6-frag", ETH_RSS_FRAG_IPV6}, + {"ipv6-tcp", ETH_RSS_NONFRAG_IPV6_TCP}, + {"ipv6-udp", ETH_RSS_NONFRAG_IPV6_UDP}, + {"ipv6-sctp", ETH_RSS_NONFRAG_IPV6_SCTP}, + {"ipv6-other", ETH_RSS_NONFRAG_IPV6_OTHER}, + {"l2-payload", ETH_RSS_L2_PAYLOAD}, + {"ipv6-ex", ETH_RSS_IPV6_EX}, + {"ipv6-tcp-ex", ETH_RSS_IPV6_TCP_EX}, + {"ipv6-udp-ex", ETH_RSS_IPV6_UDP_EX}, + }; + struct rte_eth_rss_conf rss_conf; uint8_t rss_key[10 * 4]; uint64_t rss_hf; @@ -841,24 +879,10 @@ port_rss_hash_conf_show(portid_t port_id, int show_rss_key) return; } printf("RSS functions:\n "); - if (rss_hf & ETH_RSS_IPV4) - printf("ip4"); - if (rss_hf & ETH_RSS_IPV4_TCP) - printf(" tcp4"); - if (rss_hf & ETH_RSS_IPV4_UDP) - printf(" udp4"); - if (rss_hf & ETH_RSS_IPV6) - printf(" ip6"); - if (rss_hf & ETH_RSS_IPV6_EX) - printf(" ip6-ex"); - if (rss_hf & ETH_RSS_IPV6_TCP) - printf(" tcp6"); - if (rss_hf & ETH_RSS_IPV6_TCP_EX) - printf(" tcp6-ex"); - if (rss_hf & ETH_RSS_IPV6_UDP) - printf(" udp6"); - if (rss_hf & ETH_RSS_IPV6_UDP_EX) - printf(" udp6-ex"); + for (i = 0; i < RTE_DIM(rss_type_table); i++) { + if (rss_hf & rss_type_table[i].rss_type) + printf("%s ", rss_type_table[i].str); + } printf("\n"); if (!show_rss_key) return; diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 89d82bb..13fb04d 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -94,11 +94,10 @@ static const struct rte_eth_conf port_conf_default = { .mq_mode = ETH_MQ_TX_NONE, }, .rx_adv_conf = { - .rss_conf = { - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6 | - ETH_RSS_IPV4_TCP | ETH_RSS_IPV4_UDP | - ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_UDP, - } + .rss_conf = { + .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | + ETH_RSS_TCP | ETH_RSS_SCTP, + } }, }; diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c index e0c0464..e7ff86a 100644 --- a/examples/ip_pipeline/init.c +++ b/examples/ip_pipeline/init.c @@ -113,7 +113,7 @@ struct app_params app = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV6, + .rss_hf = ETH_RSS_IP, }, }, .txmode = { diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index f1f7601..e851768 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -174,11 +174,8 @@ static struct rte_eth_conf port_conf = { .rx_adv_conf = { .rss_conf = { .rss_key = NULL, - .rss_hf = ETH_RSS_IPV4 | ETH_RSS_IPV4_TCP - | ETH_RSS_IPV4_UDP - | ETH_RSS_IPV6 | ETH_RSS_IPV6_EX - | ETH_RSS_IPV6_TCP | ETH_RSS_IPV6_TCP_EX - | ETH_RSS_IPV6_UDP | ETH_RSS_IPV6_UDP_EX, + .rss_hf = ETH_RSS_IP | ETH_RSS_UDP | + ETH_RSS_TCP | ETH_RSS_SCTP, }, }, .txmode = { diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 1200c1c..f463633 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -351,97 +351,70 @@ struct rte_eth_rss_conf { uint64_t rss_hf; /**< Hash functions to apply - see below. */ }; -/* Supported RSS offloads */ -/* for 1G & 10G */ -#define ETH_RSS_IPV4_SHIFT 0 -#define ETH_RSS_IPV4_TCP_SHIFT 1 -#define ETH_RSS_IPV6_SHIFT 2 -#define ETH_RSS_IPV6_EX_SHIFT 3 -#define ETH_RSS_IPV6_TCP_SHIFT 4 -#define ETH_RSS_IPV6_TCP_EX_SHIFT 5 -#define ETH_RSS_IPV4_UDP_SHIFT 6 -#define ETH_RSS_IPV6_UDP_SHIFT 7 -#define ETH_RSS_IPV6_UDP_EX_SHIFT 8 -/* for 40G only */ -#define ETH_RSS_NONF_IPV4_UDP_SHIFT 31 -#define ETH_RSS_NONF_IPV4_TCP_SHIFT 33 -#define ETH_RSS_NONF_IPV4_SCTP_SHIFT 34 -#define ETH_RSS_NONF_IPV4_OTHER_SHIFT 35 -#define ETH_RSS_FRAG_IPV4_SHIFT 36 -#define ETH_RSS_NONF_IPV6_UDP_SHIFT 41 -#define ETH_RSS_NONF_IPV6_TCP_SHIFT 43 -#define ETH_RSS_NONF_IPV6_SCTP_SHIFT 44 -#define ETH_RSS_NONF_IPV6_OTHER_SHIFT 45 -#define ETH_RSS_FRAG_IPV6_SHIFT 46 -#define ETH_RSS_FCOE_OX_SHIFT 48 -#define ETH_RSS_FCOE_RX_SHIFT 49 -#define ETH_RSS_FCOE_OTHER_SHIFT 50 -#define ETH_RSS_L2_PAYLOAD_SHIFT 63 - -/* for 1G & 10G */ -#define ETH_RSS_IPV4 (1 << ETH_RSS_IPV4_SHIFT) -#define ETH_RSS_IPV4_TCP (1 << ETH_RSS_IPV4_TCP_SHIFT) -#define ETH_RSS_IPV6 (1 << ETH_RSS_IPV6_SHIFT) -#define ETH_RSS_IPV6_EX (1 << ETH_RSS_IPV6_EX_SHIFT) -#define ETH_RSS_IPV6_TCP (1 << ETH_RSS_IPV6_TCP_SHIFT) -#define ETH_RSS_IPV6_TCP_EX (1 << ETH_RSS_IPV6_TCP_EX_SHIFT) -#define ETH_RSS_IPV4_UDP (1 << ETH_RSS_IPV4_UDP_SHIFT) -#define ETH_RSS_IPV6_UDP (1 << ETH_RSS_IPV6_UDP_SHIFT) -#define ETH_RSS_IPV6_UDP_EX (1 << ETH_RSS_IPV6_UDP_EX_SHIFT) -/* for 40G only */ -#define ETH_RSS_NONF_IPV4_UDP (1ULL << ETH_RSS_NONF_IPV4_UDP_SHIFT) -#define ETH_RSS_NONF_IPV4_TCP (1ULL << ETH_RSS_NONF_IPV4_TCP_SHIFT) -#define ETH_RSS_NONF_IPV4_SCTP (1ULL << ETH_RSS_NONF_IPV4_SCTP_SHIFT) -#define ETH_RSS_NONF_IPV4_OTHER (1ULL << ETH_RSS_NONF_IPV4_OTHER_SHIFT) -#define ETH_RSS_FRAG_IPV4 (1ULL << ETH_RSS_FRAG_IPV4_SHIFT) -#define ETH_RSS_NONF_IPV6_UDP (1ULL << ETH_RSS_NONF_IPV6_UDP_SHIFT) -#define ETH_RSS_NONF_IPV6_TCP (1ULL << ETH_RSS_NONF_IPV6_TCP_SHIFT) -#define ETH_RSS_NONF_IPV6_SCTP (1ULL << ETH_RSS_NONF_IPV6_SCTP_SHIFT) -#define ETH_RSS_NONF_IPV6_OTHER (1ULL << ETH_RSS_NONF_IPV6_OTHER_SHIFT) -#define ETH_RSS_FRAG_IPV6 (1ULL << ETH_RSS_FRAG_IPV6_SHIFT) -/* FCOE relevant should not be used */ -#define ETH_RSS_FCOE_OX (1ULL << ETH_RSS_FCOE_OX_SHIFT) -#define ETH_RSS_FCOE_RX (1ULL << ETH_RSS_FCOE_RX_SHIFT) -#define ETH_RSS_FCOE_OTHER (1ULL << ETH_RSS_FCOE_OTHER_SHIFT) -#define ETH_RSS_L2_PAYLOAD (1ULL << ETH_RSS_L2_PAYLOAD_SHIFT) +/* + * The RSS offload types are defined based on flow types which are defined + * in rte_eth_ctrl.h. Different NIC hardwares may support different RSS offload + * types. The supported flow types or RSS offload types can be queried by + * rte_eth_dev_info_get(). + */ +#define ETH_RSS_IPV4 (1ULL << RTE_ETH_FLOW_IPV4) +#define ETH_RSS_FRAG_IPV4 (1ULL << RTE_ETH_FLOW_FRAG_IPV4) +#define ETH_RSS_NONFRAG_IPV4_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_TCP) +#define ETH_RSS_NONFRAG_IPV4_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_UDP) +#define ETH_RSS_NONFRAG_IPV4_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_SCTP) +#define ETH_RSS_NONFRAG_IPV4_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV4_OTHER) +#define ETH_RSS_IPV6 (1ULL << RTE_ETH_FLOW_IPV6) +#define ETH_RSS_FRAG_IPV6 (1ULL << RTE_ETH_FLOW_FRAG_IPV6) +#define ETH_RSS_NONFRAG_IPV6_TCP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_TCP) +#define ETH_RSS_NONFRAG_IPV6_UDP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_UDP) +#define ETH_RSS_NONFRAG_IPV6_SCTP (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_SCTP) +#define ETH_RSS_NONFRAG_IPV6_OTHER (1ULL << RTE_ETH_FLOW_NONFRAG_IPV6_OTHER) +#define ETH_RSS_L2_PAYLOAD (1ULL << RTE_ETH_FLOW_L2_PAYLOAD) +#define ETH_RSS_IPV6_EX (1ULL << RTE_ETH_FLOW_IPV6_EX) +#define ETH_RSS_IPV6_TCP_EX (1ULL << RTE_ETH_FLOW_IPV6_TCP_EX) +#define ETH_RSS_IPV6_UDP_EX (1ULL << RTE_ETH_FLOW_IPV6_UDP_EX) #define ETH_RSS_IP ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV6 | \ - ETH_RSS_NONF_IPV4_OTHER | \ - ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONF_IPV6_OTHER | \ - ETH_RSS_FRAG_IPV6) + ETH_RSS_IPV4 | \ + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_OTHER | \ + ETH_RSS_IPV6 | \ + ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_OTHER | \ + ETH_RSS_IPV6_EX) + #define ETH_RSS_UDP ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX | \ - ETH_RSS_NONF_IPV4_UDP | \ - ETH_RSS_NONF_IPV6_UDP) + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_IPV6_UDP_EX) + +#define ETH_RSS_TCP ( \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_IPV6_TCP_EX) + +#define ETH_RSS_SCTP ( \ + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_NONFRAG_IPV6_SCTP) + /**< Mask of valid RSS hash protocols */ #define ETH_RSS_PROTO_MASK ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_EX | \ - ETH_RSS_IPV6_TCP | \ - ETH_RSS_IPV6_TCP_EX | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX | \ - ETH_RSS_NONF_IPV4_UDP | \ - ETH_RSS_NONF_IPV4_TCP | \ - ETH_RSS_NONF_IPV4_SCTP | \ - ETH_RSS_NONF_IPV4_OTHER | \ - ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONF_IPV6_UDP | \ - ETH_RSS_NONF_IPV6_TCP | \ - ETH_RSS_NONF_IPV6_SCTP | \ - ETH_RSS_NONF_IPV6_OTHER | \ - ETH_RSS_FRAG_IPV6 | \ - ETH_RSS_L2_PAYLOAD) + ETH_RSS_IPV4 | \ + ETH_RSS_FRAG_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_NONFRAG_IPV4_OTHER | \ + ETH_RSS_IPV6 | \ + ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_NONFRAG_IPV6_SCTP | \ + ETH_RSS_NONFRAG_IPV6_OTHER | \ + ETH_RSS_L2_PAYLOAD | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV6_UDP_EX) /* * Definitions used for redirection table entry size. @@ -935,6 +908,8 @@ struct rte_eth_dev_info { uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ uint16_t reta_size; /**< Device redirection table size, the total number of entries. */ + /** Bit mask of RSS offloads, the bit offset also means flow type */ + uint64_t flow_type_rss_offloads; struct rte_eth_rxconf default_rxconf; /**< Default RX configuration */ struct rte_eth_txconf default_txconf; /**< Default TX configuration */ uint16_t vmdq_queue_base; /**< First queue ID for VMDQ pools. */ diff --git a/lib/librte_pmd_e1000/e1000_ethdev.h b/lib/librte_pmd_e1000/e1000_ethdev.h index d155e77..261d3c7 100644 --- a/lib/librte_pmd_e1000/e1000_ethdev.h +++ b/lib/librte_pmd_e1000/e1000_ethdev.h @@ -105,6 +105,17 @@ #define E1000_FTQF_QUEUE_SHIFT 16 #define E1000_FTQF_QUEUE_ENABLE 0x00000100 +#define IGB_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV6_UDP_EX) + /* structure for interrupt relative data */ struct e1000_interrupt { uint32_t flags; diff --git a/lib/librte_pmd_e1000/igb_ethdev.c b/lib/librte_pmd_e1000/igb_ethdev.c index 2a268b8..7737155 100644 --- a/lib/librte_pmd_e1000/igb_ethdev.c +++ b/lib/librte_pmd_e1000/igb_ethdev.c @@ -1347,6 +1347,7 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) break; } dev_info->reta_size = ETH_RSS_RETA_SIZE_128; + dev_info->flow_type_rss_offloads = IGB_RSS_OFFLOAD_ALL; dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { diff --git a/lib/librte_pmd_e1000/igb_rxtx.c b/lib/librte_pmd_e1000/igb_rxtx.c index 5c394a9..cdf2cac 100644 --- a/lib/librte_pmd_e1000/igb_rxtx.c +++ b/lib/librte_pmd_e1000/igb_rxtx.c @@ -73,17 +73,6 @@ #include "e1000/e1000_api.h" #include "e1000_ethdev.h" -#define IGB_RSS_OFFLOAD_ALL ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_EX | \ - ETH_RSS_IPV6_TCP | \ - ETH_RSS_IPV6_TCP_EX | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX) - /* Bit Mask to indicate what bits required for building TX context */ #define IGB_TX_OFFLOAD_MASK ( \ PKT_TX_VLAN_PKT | \ @@ -1582,19 +1571,19 @@ igb_hw_rss_hash_set(struct e1000_hw *hw, struct rte_eth_rss_conf *rss_conf) mrqc = E1000_MRQC_ENABLE_RSS_4Q; /* RSS enabled. */ if (rss_hf & ETH_RSS_IPV4) mrqc |= E1000_MRQC_RSS_FIELD_IPV4; - if (rss_hf & ETH_RSS_IPV4_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) mrqc |= E1000_MRQC_RSS_FIELD_IPV4_TCP; if (rss_hf & ETH_RSS_IPV6) mrqc |= E1000_MRQC_RSS_FIELD_IPV6; if (rss_hf & ETH_RSS_IPV6_EX) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_EX; - if (rss_hf & ETH_RSS_IPV6_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_TCP; if (rss_hf & ETH_RSS_IPV6_TCP_EX) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_TCP_EX; - if (rss_hf & ETH_RSS_IPV4_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) mrqc |= E1000_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hf & ETH_RSS_IPV6_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hf & ETH_RSS_IPV6_UDP_EX) mrqc |= E1000_MRQC_RSS_FIELD_IPV6_UDP_EX; @@ -1664,19 +1653,19 @@ int eth_igb_rss_hash_conf_get(struct rte_eth_dev *dev, if (mrqc & E1000_MRQC_RSS_FIELD_IPV4) rss_hf |= ETH_RSS_IPV4; if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_TCP) - rss_hf |= ETH_RSS_IPV4_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6) rss_hf |= ETH_RSS_IPV6; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_EX) rss_hf |= ETH_RSS_IPV6_EX; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP) - rss_hf |= ETH_RSS_IPV6_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_TCP_EX) rss_hf |= ETH_RSS_IPV6_TCP_EX; if (mrqc & E1000_MRQC_RSS_FIELD_IPV4_UDP) - rss_hf |= ETH_RSS_IPV4_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP) - rss_hf |= ETH_RSS_IPV6_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP; if (mrqc & E1000_MRQC_RSS_FIELD_IPV6_UDP_EX) rss_hf |= ETH_RSS_IPV6_UDP_EX; rss_conf->rss_hf = rss_hf; diff --git a/lib/librte_pmd_i40e/i40e_ethdev.c b/lib/librte_pmd_i40e/i40e_ethdev.c index 7fe6178..a33682d 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.c +++ b/lib/librte_pmd_i40e/i40e_ethdev.c @@ -1532,6 +1532,7 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) DEV_TX_OFFLOAD_TCP_CKSUM | DEV_TX_OFFLOAD_SCTP_CKSUM; dev_info->reta_size = pf->hash_lut_size; + dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL; dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { @@ -4588,26 +4589,26 @@ i40e_config_hena(uint64_t flags) if (!flags) return hena; - if (flags & ETH_RSS_NONF_IPV4_UDP) - hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP; - if (flags & ETH_RSS_NONF_IPV4_TCP) + if (flags & ETH_RSS_FRAG_IPV4) + hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4; + if (flags & ETH_RSS_NONFRAG_IPV4_TCP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_TCP; - if (flags & ETH_RSS_NONF_IPV4_SCTP) + if (flags & ETH_RSS_NONFRAG_IPV4_UDP) + hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP; + if (flags & ETH_RSS_NONFRAG_IPV4_SCTP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP; - if (flags & ETH_RSS_NONF_IPV4_OTHER) + if (flags & ETH_RSS_NONFRAG_IPV4_OTHER) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER; - if (flags & ETH_RSS_FRAG_IPV4) - hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4; - if (flags & ETH_RSS_NONF_IPV6_UDP) - hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP; - if (flags & ETH_RSS_NONF_IPV6_TCP) + if (flags & ETH_RSS_FRAG_IPV6) + hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6; + if (flags & ETH_RSS_NONFRAG_IPV6_TCP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_TCP; - if (flags & ETH_RSS_NONF_IPV6_SCTP) + if (flags & ETH_RSS_NONFRAG_IPV6_UDP) + hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP; + if (flags & ETH_RSS_NONFRAG_IPV6_SCTP) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_SCTP; - if (flags & ETH_RSS_NONF_IPV6_OTHER) + if (flags & ETH_RSS_NONFRAG_IPV6_OTHER) hena |= 1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER; - if (flags & ETH_RSS_FRAG_IPV6) - hena |= 1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6; if (flags & ETH_RSS_L2_PAYLOAD) hena |= 1ULL << I40E_FILTER_PCTYPE_L2_PAYLOAD; @@ -4622,27 +4623,26 @@ i40e_parse_hena(uint64_t flags) if (!flags) return rss_hf; - - if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP)) - rss_hf |= ETH_RSS_NONF_IPV4_UDP; + if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4)) + rss_hf |= ETH_RSS_FRAG_IPV4; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_TCP)) - rss_hf |= ETH_RSS_NONF_IPV4_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP; + if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_UDP)) + rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_SCTP)) - rss_hf |= ETH_RSS_NONF_IPV4_SCTP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_SCTP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER)) - rss_hf |= ETH_RSS_NONF_IPV4_OTHER; - if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV4)) - rss_hf |= ETH_RSS_FRAG_IPV4; - if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP)) - rss_hf |= ETH_RSS_NONF_IPV6_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_OTHER; + if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6)) + rss_hf |= ETH_RSS_FRAG_IPV6; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_TCP)) - rss_hf |= ETH_RSS_NONF_IPV6_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP; + if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_UDP)) + rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_SCTP)) - rss_hf |= ETH_RSS_NONF_IPV6_SCTP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_SCTP; if (flags & (1ULL << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER)) - rss_hf |= ETH_RSS_NONF_IPV6_OTHER; - if (flags & (1ULL << I40E_FILTER_PCTYPE_FRAG_IPV6)) - rss_hf |= ETH_RSS_FRAG_IPV6; + rss_hf |= ETH_RSS_NONFRAG_IPV6_OTHER; if (flags & (1ULL << I40E_FILTER_PCTYPE_L2_PAYLOAD)) rss_hf |= ETH_RSS_L2_PAYLOAD; diff --git a/lib/librte_pmd_i40e/i40e_ethdev.h b/lib/librte_pmd_i40e/i40e_ethdev.h index cda032d..b9bed5a 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev.h +++ b/lib/librte_pmd_i40e/i40e_ethdev.h @@ -120,16 +120,16 @@ enum i40e_flxpld_layer_idx { I40E_FLAG_VXLAN) #define I40E_RSS_OFFLOAD_ALL ( \ - ETH_RSS_NONF_IPV4_UDP | \ - ETH_RSS_NONF_IPV4_TCP | \ - ETH_RSS_NONF_IPV4_SCTP | \ - ETH_RSS_NONF_IPV4_OTHER | \ ETH_RSS_FRAG_IPV4 | \ - ETH_RSS_NONF_IPV6_UDP | \ - ETH_RSS_NONF_IPV6_TCP | \ - ETH_RSS_NONF_IPV6_SCTP | \ - ETH_RSS_NONF_IPV6_OTHER | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_NONFRAG_IPV4_SCTP | \ + ETH_RSS_NONFRAG_IPV4_OTHER | \ ETH_RSS_FRAG_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_NONFRAG_IPV6_SCTP | \ + ETH_RSS_NONFRAG_IPV6_OTHER | \ ETH_RSS_L2_PAYLOAD) /* All bits of RSS hash enable */ diff --git a/lib/librte_pmd_i40e/i40e_ethdev_vf.c b/lib/librte_pmd_i40e/i40e_ethdev_vf.c index 7d8d8ef..f031c19 100644 --- a/lib/librte_pmd_i40e/i40e_ethdev_vf.c +++ b/lib/librte_pmd_i40e/i40e_ethdev_vf.c @@ -1646,6 +1646,7 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN; dev_info->max_rx_pktlen = I40E_FRAME_SIZE_MAX; dev_info->reta_size = ETH_RSS_RETA_SIZE_64; + dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL; dev_info->default_rxconf = (struct rte_eth_rxconf) { .rx_thresh = { diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c index b341dd0..d977596 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.c +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.c @@ -2023,6 +2023,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) ETH_TXQ_FLAGS_NOOFFLOADS, }; dev_info->reta_size = ETH_RSS_RETA_SIZE_128; + dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL; } static void diff --git a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h index 1383194..685f49b 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_ethdev.h +++ b/lib/librte_pmd_ixgbe/ixgbe_ethdev.h @@ -98,6 +98,17 @@ #define IXGBE_5TUPLE_MAX_PRI 7 #define IXGBE_5TUPLE_MIN_PRI 1 +#define IXGBE_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_NONFRAG_IPV4_UDP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP | \ + ETH_RSS_NONFRAG_IPV6_UDP | \ + ETH_RSS_IPV6_EX | \ + ETH_RSS_IPV6_TCP_EX | \ + ETH_RSS_IPV6_UDP_EX) + /* * Information about the fdir mode. */ diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c index e6766b3..3059375 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx.c @@ -80,17 +80,6 @@ #include "ixgbe/ixgbe_common.h" #include "ixgbe_rxtx.h" -#define IXGBE_RSS_OFFLOAD_ALL ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_EX | \ - ETH_RSS_IPV6_TCP | \ - ETH_RSS_IPV6_TCP_EX | \ - ETH_RSS_IPV4_UDP | \ - ETH_RSS_IPV6_UDP | \ - ETH_RSS_IPV6_UDP_EX) - /* Bit Mask to indicate what bits required for building TX context */ #define IXGBE_TX_OFFLOAD_MASK ( \ PKT_TX_VLAN_PKT | \ @@ -2432,19 +2421,19 @@ ixgbe_hw_rss_hash_set(struct ixgbe_hw *hw, struct rte_eth_rss_conf *rss_conf) mrqc = IXGBE_MRQC_RSSEN; /* Enable RSS */ if (rss_hf & ETH_RSS_IPV4) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4; - if (rss_hf & ETH_RSS_IPV4_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_TCP; if (rss_hf & ETH_RSS_IPV6) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6; if (rss_hf & ETH_RSS_IPV6_EX) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX; - if (rss_hf & ETH_RSS_IPV6_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_TCP; if (rss_hf & ETH_RSS_IPV6_TCP_EX) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP; - if (rss_hf & ETH_RSS_IPV4_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_UDP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV4_UDP; - if (rss_hf & ETH_RSS_IPV6_UDP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_UDP) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_UDP; if (rss_hf & ETH_RSS_IPV6_UDP_EX) mrqc |= IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP; @@ -2518,19 +2507,19 @@ ixgbe_dev_rss_hash_conf_get(struct rte_eth_dev *dev, if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV4) rss_hf |= ETH_RSS_IPV4; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV4_TCP) - rss_hf |= ETH_RSS_IPV4_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_TCP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6) rss_hf |= ETH_RSS_IPV6; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX) rss_hf |= ETH_RSS_IPV6_EX; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_TCP) - rss_hf |= ETH_RSS_IPV6_TCP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_TCP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX_TCP) rss_hf |= ETH_RSS_IPV6_TCP_EX; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV4_UDP) - rss_hf |= ETH_RSS_IPV4_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV4_UDP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_UDP) - rss_hf |= ETH_RSS_IPV6_UDP; + rss_hf |= ETH_RSS_NONFRAG_IPV6_UDP; if (mrqc & IXGBE_MRQC_RSS_FIELD_IPV6_EX_UDP) rss_hf |= ETH_RSS_IPV6_UDP_EX; rss_conf->rss_hf = rss_hf; diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c index ef0af16..6068c60 100644 --- a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c +++ b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c @@ -645,6 +645,7 @@ vmxnet3_dev_info_get(__attribute__((unused))struct rte_eth_dev *dev, struct rte_ dev_info->default_txconf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; + dev_info->flow_type_rss_offloads = VMXNET3_RSS_OFFLOAD_ALL; } /* return 0 means link status changed, -1 means not changed */ diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h index 0941cfc..09993cf 100644 --- a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h +++ b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h @@ -61,6 +61,12 @@ #define VMXNET3_RSS_MAX_KEY_SIZE 40 #define VMXNET3_RSS_MAX_IND_TABLE_SIZE 128 +#define VMXNET3_RSS_OFFLOAD_ALL ( \ + ETH_RSS_IPV4 | \ + ETH_RSS_NONFRAG_IPV4_TCP | \ + ETH_RSS_IPV6 | \ + ETH_RSS_NONFRAG_IPV6_TCP) + /* RSS configuration structure - shared with device through GPA */ typedef struct VMXNET3_RSSConf { diff --git a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c index 8425f32..4d8a010 100644 --- a/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c +++ b/lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c @@ -998,12 +998,6 @@ static uint8_t rss_intel_key[40] = { int vmxnet3_rss_configure(struct rte_eth_dev *dev) { -#define VMXNET3_RSS_OFFLOAD_ALL ( \ - ETH_RSS_IPV4 | \ - ETH_RSS_IPV4_TCP | \ - ETH_RSS_IPV6 | \ - ETH_RSS_IPV6_TCP) - struct vmxnet3_hw *hw = dev->data->dev_private; struct VMXNET3_RSSConf *dev_rss_conf; struct rte_eth_rss_conf *port_rss_conf; @@ -1042,11 +1036,11 @@ vmxnet3_rss_configure(struct rte_eth_dev *dev) rss_hf = port_rss_conf->rss_hf & VMXNET3_RSS_OFFLOAD_ALL; if (rss_hf & ETH_RSS_IPV4) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV4; - if (rss_hf & ETH_RSS_IPV4_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV4_TCP) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV4; if (rss_hf & ETH_RSS_IPV6) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_IPV6; - if (rss_hf & ETH_RSS_IPV6_TCP) + if (rss_hf & ETH_RSS_NONFRAG_IPV6_TCP) dev_rss_conf->hashType |= VMXNET3_RSS_HASH_TYPE_TCP_IPV6; return VMXNET3_SUCCESS; -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* [dpdk-dev] [PATCH v2 7/7] app/testpmd: support new rss offloads 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang ` (5 preceding siblings ...) 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 6/7] ethdev: unification of RSS offload types Helin Zhang @ 2015-02-04 7:16 ` Helin Zhang 2015-02-15 5:03 ` [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types Wu, Jingjing 7 siblings, 0 replies; 24+ messages in thread From: Helin Zhang @ 2015-02-04 7:16 UTC (permalink / raw) To: dev RSS offloads supported 'ip' and 'udp' only, which did not demonstrate all of the hardware capabilities. The modifications adds support of new RSS offloads of 'tcp', 'sctp', 'ether' and 'all'. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/cmdline.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 679ea07..7a004cb 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -589,7 +589,7 @@ static void cmd_help_long_parsed(void *parsed_result, " Set crc-strip/rx-checksum/hardware-vlan/drop_en" " for ports.\n\n" - "port config all rss (ip|udp|none)\n" + "port config all rss (all|ip|tcp|udp|sctp|ether|none)\n" " Set the RSS mode.\n\n" "port config port-id rss reta (hash,queue)[,(hash,queue)]\n" @@ -1394,10 +1394,20 @@ cmd_config_rss_parsed(void *parsed_result, struct rte_eth_rss_conf rss_conf; uint8_t i; - if (!strcmp(res->value, "ip")) + if (!strcmp(res->value, "all")) + rss_conf.rss_hf = ETH_RSS_IP | ETH_RSS_TCP | + ETH_RSS_UDP | ETH_RSS_SCTP | + ETH_RSS_L2_PAYLOAD; + else if (!strcmp(res->value, "ip")) rss_conf.rss_hf = ETH_RSS_IP; else if (!strcmp(res->value, "udp")) rss_conf.rss_hf = ETH_RSS_UDP; + else if (!strcmp(res->value, "tcp")) + rss_conf.rss_hf = ETH_RSS_TCP; + else if (!strcmp(res->value, "sctp")) + rss_conf.rss_hf = ETH_RSS_SCTP; + else if (!strcmp(res->value, "ether")) + rss_conf.rss_hf = ETH_RSS_L2_PAYLOAD; else if (!strcmp(res->value, "none")) rss_conf.rss_hf = 0; else { @@ -1418,12 +1428,13 @@ cmdline_parse_token_string_t cmd_config_rss_all = cmdline_parse_token_string_t cmd_config_rss_name = TOKEN_STRING_INITIALIZER(struct cmd_config_rss, name, "rss"); cmdline_parse_token_string_t cmd_config_rss_value = - TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value, "ip#udp#none"); + TOKEN_STRING_INITIALIZER(struct cmd_config_rss, value, + "all#ip#tcp#udp#sctp#ether#none"); cmdline_parse_inst_t cmd_config_rss = { .f = cmd_config_rss_parsed, .data = NULL, - .help_str = "port config all rss ip|udp|none", + .help_str = "port config all rss all|ip|tcp|udp|sctp|ether|none", .tokens = { (void *)&cmd_config_rss_port, (void *)&cmd_config_rss_keyword, -- 1.9.3 ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang ` (6 preceding siblings ...) 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 7/7] app/testpmd: support new rss offloads Helin Zhang @ 2015-02-15 5:03 ` Wu, Jingjing 2015-02-22 22:58 ` Thomas Monjalon 7 siblings, 1 reply; 24+ messages in thread From: Wu, Jingjing @ 2015-02-15 5:03 UTC (permalink / raw) To: Zhang, Helin, dev > -----Original Message----- > From: Zhang, Helin > Sent: Wednesday, February 04, 2015 3:16 PM > To: dev@dpdk.org > Cc: Wu, Jingjing; Cao, Waterman; Zhang, Helin > Subject: [PATCH v2 0/7] unified flow types and RSS offload types > > It unifies the flow types and RSS offload types for all PMDs. Previously flow > types are defined specifically for i40e, and there has different RSS offloads > tyeps for 1/10G and 40G seperately. This is not so convenient for application > development, and not good for adding new PMDs. > In addition, it enables new RSS offloads of 'tcp' and 'all' in testpmd. > > v2 changes: > * Integrated with configuring hash functions. > * Corrected the wrong help string of flow director parameters. > * Renamed the flow types from ETH_FLOW_TYPE_ to RTE_ETH_FLOW_. > * Removed useless annotations for flow type elements in rte_eth_ctrl.h. > > Helin Zhang (7): > app/test-pmd: code style fix > ethdev: code style fix > i40e: code style fix > ethdev: fix of calculating the size of flow type mask array > ethdev: unification of flow types > ethdev: unification of RSS offload types > app/testpmd: support new rss offloads > > app/test-pipeline/init.c | 2 +- > app/test-pmd/cmdline.c | 154 +++++++++++++++++++----------- > app/test-pmd/config.c | 137 +++++++++++++++++--------- > examples/distributor/main.c | 9 +- > examples/ip_pipeline/init.c | 2 +- > examples/l3fwd-acl/main.c | 7 +- > lib/librte_ether/rte_eth_ctrl.h | 94 ++++++++++-------- > lib/librte_ether/rte_ethdev.h | 147 ++++++++++++---------------- > lib/librte_pmd_e1000/e1000_ethdev.h | 11 +++ > lib/librte_pmd_e1000/igb_ethdev.c | 1 + > lib/librte_pmd_e1000/igb_rxtx.c | 27 ++---- > lib/librte_pmd_i40e/i40e_ethdev.c | 164 +++++++++++++++++------------ > --- > lib/librte_pmd_i40e/i40e_ethdev.h | 52 +++++----- > lib/librte_pmd_i40e/i40e_ethdev_vf.c | 1 + > lib/librte_pmd_i40e/i40e_fdir.c | 99 ++++++++++--------- > lib/librte_pmd_ixgbe/ixgbe_ethdev.c | 1 + > lib/librte_pmd_ixgbe/ixgbe_ethdev.h | 11 +++ > lib/librte_pmd_ixgbe/ixgbe_rxtx.c | 27 ++---- > lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 1 + > lib/librte_pmd_vmxnet3/vmxnet3_ethdev.h | 6 ++ > lib/librte_pmd_vmxnet3/vmxnet3_rxtx.c | 10 +- > 21 files changed, 525 insertions(+), 438 deletions(-) > > -- > 1.9.3 Acked-by: Jingjing Wu <jingjing.wu@intel.com> ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types 2015-02-15 5:03 ` [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types Wu, Jingjing @ 2015-02-22 22:58 ` Thomas Monjalon 2015-02-24 13:45 ` Zhang, Helin 0 siblings, 1 reply; 24+ messages in thread From: Thomas Monjalon @ 2015-02-22 22:58 UTC (permalink / raw) To: Zhang, Helin; +Cc: dev > > It unifies the flow types and RSS offload types for all PMDs. Previously flow > > types are defined specifically for i40e, and there has different RSS offloads > > tyeps for 1/10G and 40G seperately. This is not so convenient for application > > development, and not good for adding new PMDs. > > In addition, it enables new RSS offloads of 'tcp' and 'all' in testpmd. > > > > v2 changes: > > * Integrated with configuring hash functions. > > * Corrected the wrong help string of flow director parameters. > > * Renamed the flow types from ETH_FLOW_TYPE_ to RTE_ETH_FLOW_. > > * Removed useless annotations for flow type elements in rte_eth_ctrl.h. > > > > Helin Zhang (7): > > app/test-pmd: code style fix > > ethdev: code style fix > > i40e: code style fix > > ethdev: fix of calculating the size of flow type mask array > > ethdev: unification of flow types > > ethdev: unification of RSS offload types > > app/testpmd: support new rss offloads > > Acked-by: Jingjing Wu <jingjing.wu@intel.com> Applied, thanks There were some difficult merges with new flow director API and fm10K. Please check everything is OK. ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types 2015-02-22 22:58 ` Thomas Monjalon @ 2015-02-24 13:45 ` Zhang, Helin 2015-02-24 15:01 ` Wu, Jingjing 0 siblings, 1 reply; 24+ messages in thread From: Zhang, Helin @ 2015-02-24 13:45 UTC (permalink / raw) To: Thomas Monjalon; +Cc: dev > -----Original Message----- > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > Sent: Monday, February 23, 2015 6:59 AM > To: Zhang, Helin > Cc: dev@dpdk.org; Wu, Jingjing; Chen, Jing D > Subject: Re: [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types > > > > It unifies the flow types and RSS offload types for all PMDs. > > > Previously flow types are defined specifically for i40e, and there > > > has different RSS offloads tyeps for 1/10G and 40G seperately. This > > > is not so convenient for application development, and not good for adding > new PMDs. > > > In addition, it enables new RSS offloads of 'tcp' and 'all' in testpmd. > > > > > > v2 changes: > > > * Integrated with configuring hash functions. > > > * Corrected the wrong help string of flow director parameters. > > > * Renamed the flow types from ETH_FLOW_TYPE_ to RTE_ETH_FLOW_. > > > * Removed useless annotations for flow type elements in rte_eth_ctrl.h. > > > > > > Helin Zhang (7): > > > app/test-pmd: code style fix > > > ethdev: code style fix > > > i40e: code style fix > > > ethdev: fix of calculating the size of flow type mask array > > > ethdev: unification of flow types > > > ethdev: unification of RSS offload types > > > app/testpmd: support new rss offloads > > > > Acked-by: Jingjing Wu <jingjing.wu@intel.com> > > Applied, thanks > There were some difficult merges with new flow director API and fm10K. > Please check everything is OK. Thank you very much! We expected that merges would be difficult, and Jingjing planned to work out a new version. But, you had done that for us! Thanks for your great helps to get it being merged! We will check the master branch as a double check! Regards, Helin ^ permalink raw reply [flat|nested] 24+ messages in thread
* Re: [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types 2015-02-24 13:45 ` Zhang, Helin @ 2015-02-24 15:01 ` Wu, Jingjing 0 siblings, 0 replies; 24+ messages in thread From: Wu, Jingjing @ 2015-02-24 15:01 UTC (permalink / raw) To: Zhang, Helin, Thomas Monjalon; +Cc: dev > -----Original Message----- > From: Zhang, Helin > Sent: Tuesday, February 24, 2015 9:45 PM > To: Thomas Monjalon > Cc: dev@dpdk.org; Wu, Jingjing; Chen, Jing D > Subject: RE: [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types > > > > > -----Original Message----- > > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] > > Sent: Monday, February 23, 2015 6:59 AM > > To: Zhang, Helin > > Cc: dev@dpdk.org; Wu, Jingjing; Chen, Jing D > > Subject: Re: [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types > > > > > > It unifies the flow types and RSS offload types for all PMDs. > > > > Previously flow types are defined specifically for i40e, and there > > > > has different RSS offloads tyeps for 1/10G and 40G seperately. This > > > > is not so convenient for application development, and not good for adding > > new PMDs. > > > > In addition, it enables new RSS offloads of 'tcp' and 'all' in testpmd. > > > > > > > > v2 changes: > > > > * Integrated with configuring hash functions. > > > > * Corrected the wrong help string of flow director parameters. > > > > * Renamed the flow types from ETH_FLOW_TYPE_ to RTE_ETH_FLOW_. > > > > * Removed useless annotations for flow type elements in rte_eth_ctrl.h. > > > > > > > > Helin Zhang (7): > > > > app/test-pmd: code style fix > > > > ethdev: code style fix > > > > i40e: code style fix > > > > ethdev: fix of calculating the size of flow type mask array > > > > ethdev: unification of flow types > > > > ethdev: unification of RSS offload types > > > > app/testpmd: support new rss offloads > > > > > > Acked-by: Jingjing Wu <jingjing.wu@intel.com> > > > > Applied, thanks > > There were some difficult merges with new flow director API and fm10K. > > Please check everything is OK. > > Thank you very much! We expected that merges would be difficult, and Jingjing planned to > work out a new version. > But, you had done that for us! Thanks for your great helps to get it being merged! > We will check the master branch as a double check! > > Regards, > Helin [Wu, Jingjing] add my great appreciation too. Thanks a lot. ^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2015-02-24 15:02 UTC | newest] Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-01-19 6:56 [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 1/7] app/test-pmd: code style fix Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 2/7] ethdev: " Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 3/7] i40e: " Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang [not found] ` <2108624.Ik2ARBIxyb@xps13> 2015-02-03 5:24 ` Zhang, Helin 2015-01-19 6:56 ` [dpdk-dev] [PATCH 5/7] ethdev: unification of flow types Helin Zhang [not found] ` <98DB008FA2AC6644B40AD8C766FAB271014BDED15D@BOREAL.arubanetworks.com> 2015-01-27 5:20 ` Zhang, Helin [not found] ` <5329819.johOmNX3Da@xps13> 2015-02-03 5:40 ` Zhang, Helin 2015-01-19 6:56 ` [dpdk-dev] [PATCH 6/7] ethdev: unification of RSS offload types Helin Zhang 2015-01-19 6:56 ` [dpdk-dev] [PATCH 7/7] app/testpmd: support new rss offloads Helin Zhang 2015-01-22 7:48 ` [dpdk-dev] [PATCH 0/7] unification of flow types and RSS offload types Wu, Jingjing 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 0/7] unified " Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 1/7] app/test-pmd: code style fix Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 2/7] ethdev: " Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 3/7] i40e: " Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 4/7] ethdev: fix of calculating the size of flow type mask array Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 5/7] ethdev: unification of flow types Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 6/7] ethdev: unification of RSS offload types Helin Zhang 2015-02-04 7:16 ` [dpdk-dev] [PATCH v2 7/7] app/testpmd: support new rss offloads Helin Zhang 2015-02-15 5:03 ` [dpdk-dev] [PATCH v2 0/7] unified flow types and RSS offload types Wu, Jingjing 2015-02-22 22:58 ` Thomas Monjalon 2015-02-24 13:45 ` Zhang, Helin 2015-02-24 15:01 ` Wu, Jingjing
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).