Support configuring hash functions
cover Support configuring hash functions
These pathches mainly support configuring hash functions. In detail, it can select Toeplitz and simple XOR hash functions. It can configure symmetric hash function. Also 'ethdev' level interfaces are implemented in i40e, which provides commands for application invoking, and to check if specific capability (command) is supported on a port.
Helin Zhang (5):
ethdev: Rename macros of packet classification type
ethdev: add new ops of 'check_command_supported' and
'rx_classification_filter_ctl'
i40e: support selecting hash functions
i40e: support configuring symmetric hash function app/testpmd: new commands for configuring hash functions
app/test-pmd/cmdline.c | 455 ++++++++++++++++++++++++++++++++++++ config/common_bsdapp | 1 + config/common_linuxapp | 1 + lib/librte_ether/Makefile | 1 + lib/librte_ether/rte_eth_features.h | 65 ++++++ lib/librte_ether/rte_ethdev.c | 31 +++ lib/librte_ether/rte_ethdev.h | 126 +++++++--- lib/librte_pmd_i40e/Makefile | 6 + lib/librte_pmd_i40e/i40e_ethdev.c | 439 ++++++++++++++++++++++++++++++++++ lib/librte_pmd_i40e/rte_i40e.h | 95 ++++++++ 10 files changed, 1183 insertions(+), 37 deletions(-) create mode 100644 lib/librte_ether/rte_eth_features.h create mode 100644 lib/librte_pmd_i40e/rte_i40e.h
Signature · 1 line
1.8.1.4
PATCH 1/5 ethdev: Rename macros of packet classification type
In reply to a message not in the archiveFor better understanding, 'PCTYPE' was added to the name of i40e RSS shift macros.
--- lib/librte_ether/rte_ethdev.h | 74 +++++++++++++++++++++---------------------- 1 file changed, 37 insertions(+), 37 deletions(-)
lib/librte_ether/rte_ethdev.h +37 -37
@@ -346,46 +346,46 @@ struct rte_eth_rss_conf {#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 +#define ETH_PCTYPE_NONF_IPV4_UDP 31 +#define ETH_PCTYPE_NONF_IPV4_TCP 33 +#define ETH_PCTYPE_NONF_IPV4_SCTP 34 +#define ETH_PCTYPE_NONF_IPV4_OTHER 35 +#define ETH_PCTYPE_FRAG_IPV4 36 +#define ETH_PCTYPE_NONF_IPV6_UDP 41 +#define ETH_PCTYPE_NONF_IPV6_TCP 43 +#define ETH_PCTYPE_NONF_IPV6_SCTP 44 +#define ETH_PCTYPE_NONF_IPV6_OTHER 45 +#define ETH_PCTYPE_FRAG_IPV6 46 +#define ETH_PCTYPE_FCOE_OX 48/* not used */ +#define ETH_PCTYPE_FCOE_RX 49/* not used */ +#define ETH_PCTYPE_FCOE_OTHER 50/* not used */ +#define ETH_PCTYPE_L2_PAYLOAD 63/* for 1G & 10G */ -#define ETH_RSS_IPV4 ((uint16_t)1 << ETH_RSS_IPV4_SHIFT) -#define ETH_RSS_IPV4_TCP ((uint16_t)1 << ETH_RSS_IPV4_TCP_SHIFT) -#define ETH_RSS_IPV6 ((uint16_t)1 << ETH_RSS_IPV6_SHIFT) -#define ETH_RSS_IPV6_EX ((uint16_t)1 << ETH_RSS_IPV6_EX_SHIFT) -#define ETH_RSS_IPV6_TCP ((uint16_t)1 << ETH_RSS_IPV6_TCP_SHIFT) -#define ETH_RSS_IPV6_TCP_EX ((uint16_t)1 << ETH_RSS_IPV6_TCP_EX_SHIFT) -#define ETH_RSS_IPV4_UDP ((uint16_t)1 << ETH_RSS_IPV4_UDP_SHIFT) -#define ETH_RSS_IPV6_UDP ((uint16_t)1 << ETH_RSS_IPV6_UDP_SHIFT) -#define ETH_RSS_IPV6_UDP_EX ((uint16_t)1 << ETH_RSS_IPV6_UDP_EX_SHIFT) +#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 ((uint64_t)1 << ETH_RSS_NONF_IPV4_UDP_SHIFT) -#define ETH_RSS_NONF_IPV4_TCP ((uint64_t)1 << ETH_RSS_NONF_IPV4_TCP_SHIFT) -#define ETH_RSS_NONF_IPV4_SCTP ((uint64_t)1 << ETH_RSS_NONF_IPV4_SCTP_SHIFT) -#define ETH_RSS_NONF_IPV4_OTHER ((uint64_t)1 << ETH_RSS_NONF_IPV4_OTHER_SHIFT) -#define ETH_RSS_FRAG_IPV4 ((uint64_t)1 << ETH_RSS_FRAG_IPV4_SHIFT) -#define ETH_RSS_NONF_IPV6_UDP ((uint64_t)1 << ETH_RSS_NONF_IPV6_UDP_SHIFT) -#define ETH_RSS_NONF_IPV6_TCP ((uint64_t)1 << ETH_RSS_NONF_IPV6_TCP_SHIFT) -#define ETH_RSS_NONF_IPV6_SCTP ((uint64_t)1 << ETH_RSS_NONF_IPV6_SCTP_SHIFT) -#define ETH_RSS_NONF_IPV6_OTHER ((uint64_t)1 << ETH_RSS_NONF_IPV6_OTHER_SHIFT) -#define ETH_RSS_FRAG_IPV6 ((uint64_t)1 << ETH_RSS_FRAG_IPV6_SHIFT) -#define ETH_RSS_FCOE_OX ((uint64_t)1 << ETH_RSS_FCOE_OX_SHIFT)/* not used */ -#define ETH_RSS_FCOE_RX ((uint64_t)1 << ETH_RSS_FCOE_RX_SHIFT)/* not used */ -#define ETH_RSS_FCOE_OTHER ((uint64_t)1 << ETH_RSS_FCOE_OTHER_SHIFT)/* not used */ -#define ETH_RSS_L2_PAYLOAD ((uint64_t)1 << ETH_RSS_L2_PAYLOAD_SHIFT) +#define ETH_RSS_NONF_IPV4_UDP (1ULL << ETH_PCTYPE_NONF_IPV4_UDP) +#define ETH_RSS_NONF_IPV4_TCP (1ULL << ETH_PCTYPE_NONF_IPV4_TCP) +#define ETH_RSS_NONF_IPV4_SCTP (1ULL << ETH_PCTYPE_NONF_IPV4_SCTP) +#define ETH_RSS_NONF_IPV4_OTHER (1ULL << ETH_PCTYPE_NONF_IPV4_OTHER) +#define ETH_RSS_FRAG_IPV4 (1ULL << ETH_PCTYPE_FRAG_IPV4) +#define ETH_RSS_NONF_IPV6_UDP (1ULL << ETH_PCTYPE_NONF_IPV6_UDP) +#define ETH_RSS_NONF_IPV6_TCP (1ULL << ETH_PCTYPE_NONF_IPV6_TCP) +#define ETH_RSS_NONF_IPV6_SCTP (1ULL << ETH_PCTYPE_NONF_IPV6_SCTP) +#define ETH_RSS_NONF_IPV6_OTHER (1ULL << ETH_PCTYPE_NONF_IPV6_OTHER) +#define ETH_RSS_FRAG_IPV6 (1ULL << ETH_PCTYPE_FRAG_IPV6) +#define ETH_RSS_FCOE_OX (1ULL << ETH_PCTYPE_FCOE_OX) +#define ETH_RSS_FCOE_RX (1ULL << ETH_PCTYPE_FCOE_RX) +#define ETH_RSS_FCOE_OTHER (1ULL << ETH_PCTYPE_FCOE_OTHER) +#define ETH_RSS_L2_PAYLOAD (1ULL << ETH_PCTYPE_L2_PAYLOAD)#define ETH_RSS_IP ( \ ETH_RSS_IPV4 | \
Signature · 1 line
1.8.1.4
PATCH 2/5 ethdev: add new ops of 'check_command_supported' and 'rx_classification_filter_ctl'
In reply to a message not in the archiveTwo ops of 'check_command_supported' and 'rx_classification_filter_ctl' are added.
* 'check_command_supported' is for capability discovery. In anothoer word, it is to check if specific feature/command is supported by the specific port.
* 'rx_classification_filter_ctl' is for receive classifcation filter configuring. e.g. hash function configuration, flow director configuration. It is a common API where a lot of commands can be implemented for different sub features.
--- lib/librte_ether/rte_ethdev.c | 31 ++++++++++++++++++++++++++ lib/librte_ether/rte_ethdev.h | 52 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+)
lib/librte_ether/rte_ethdev.c +31 -0
@@ -3002,3 +3002,34 @@ rte_eth_dev_get_flex_filter(uint8_t port_id, uint16_t index,return (*dev->dev_ops->get_flex_filter)(dev, index, filter, rx_queue); } + +int +rte_eth_dev_check_command_supported (uint8_t port_id,uint32_t cmd) +{ +struct rte_eth_dev *dev; + +if (port_id >= nb_ports) { +PMD_DEBUG_TRACE ("Invalid port_id=%d\n" , port_id); +return -ENODEV ; + } + dev = &rte_eth_devices[port_id]; +FUNC_PTR_OR_ERR_RET (*dev->dev_ops->check_command_supported, -ENOTSUP ); +return (*dev->dev_ops->check_command_supported)(dev, cmd); +} + +int +rte_eth_dev_rx_classification_filter_ctl (uint8_t port_id, +uint32_t cmd, +void *args) +{ +struct rte_eth_dev *dev; + +if (port_id >= nb_ports) { +PMD_DEBUG_TRACE ("Invalid port_id=%d\n" , port_id); +return -ENODEV ; + } + dev = &rte_eth_devices[port_id]; +FUNC_PTR_OR_ERR_RET (*dev->dev_ops->rx_classification_filter_ctl, + -ENOTSUP ); +return (*dev->dev_ops->rx_classification_filter_ctl)(dev, cmd, args); +}
lib/librte_ether/rte_ethdev.h +52 -0
70 lines not on this page · raw message
Signature · 1 line
1.8.1.4
PATCH 3/5 i40e: support selecting hash functions
In reply to a message not in the archiveToeplitz and simple XOR hash functions are supported by hardware, code changes are to tell the hardware which hash function is selected according to the configuration.
--- config/common_bsdapp | 1 + config/common_linuxapp | 1 + lib/librte_pmd_i40e/i40e_ethdev.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+)
config/common_bsdapp +1 -0
@@ -187,6 +187,7 @@ CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4 # interval up to 8160 us, aligned to 2 (or default value) CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 +CONFIG_RTE_LIBRTE_I40E_HASH_FUNC_TOEPLITZ=y # # Compile burst-oriented VIRTIO PMD driver
config/common_linuxapp +1 -0
@@ -210,6 +210,7 @@ CONFIG_RTE_LIBRTE_I40E_16BYTE_RX_DESC=n CONFIG_RTE_LIBRTE_I40E_QUEUE_NUM_PER_VF=4 # interval up to 8160 us, aligned to 2 (or default value) CONFIG_RTE_LIBRTE_I40E_ITR_INTERVAL=-1 +CONFIG_RTE_LIBRTE_I40E_HASH_FUNC_TOEPLITZ=y # # Compile burst-oriented VIRTIO PMD driver
lib/librte_pmd_i40e/i40e_ethdev.c +30 -0
@@ -203,6 +203,7 @@ static int i40e_dev_rss_hash_update(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf);static int i40e_dev_rss_hash_conf_get (struct rte_eth_dev *dev,struct rte_eth_rss_conf *rss_conf); +static void i40e_select_hash_function (struct i40e_hw *hw);/* Default hash key buffer for RSS */ static uint32_t rss_key_default[I40E_PFQF_HKEY_MAX_INDEX +1 ];
@@ -384,6 +385,9 @@ eth_i40e_dev_init(__rte_unused struct eth_driver *eth_drv,return ret; } +/* Select hash functions */ +i40e_select_hash_function (hw); +/* Initialize the shared code (base driver) */ ret =i40e_init_shared_code (hw);if (ret) {
@@ -3956,3 +3960,29 @@ i40e_pf_config_mq_rx(struct i40e_pf *pf)return 0 ; } + +static void +i40e_select_hash_function (struct i40e_hw *hw) +{ +uint32_t reg; + + reg =I40E_READ_REG (hw,I40E_GLQF_CTL ); +#ifdef RTE_LIBRTE_I40E_HASH_FUNC_TOEPLITZ +if (reg &I40E_GLQF_CTL_HTOEP_MASK ) { +PMD_DRV_LOG (DEBUG ,"Hash function already set to Hoeplitz\n" ); +return ; + } + reg |=I40E_GLQF_CTL_HTOEP_MASK ; +#else +if (!(reg &I40E_GLQF_CTL_HTOEP_MASK )) { +PMD_DRV_LOG (DEBUG ,"Hash function already set to " +"Simple XOR\n" ); +return ; + } + reg &= ~I40E_GLQF_CTL_HTOEP_MASK ; +#endif +PMD_DRV_LOG (INFO ,"Hash function set to %s\n" , + (reg &I40E_GLQF_CTL_HTOEP_MASK ) ?"Toeplitz" :"XOR" ); +I40E_WRITE_REG (hw,I40E_GLQF_CTL , reg); +I40E_WRITE_FLUSH (hw); +}
Signature · 1 line
1.8.1.4
PATCH 4/5 i40e: support configuring symmetric hash function
In reply to a message not in the archiveSymmetric hash function can be configured:
* Set symmetric hash enable per port.
* Set symmetric hash enable per pctype (packet classification type).
* Set the swap configurations.
Commands are implemented for 'rx_classification_filter_ctl' to support above operations which can be called in applications. Also 'check_command_supported' is also implemented to check if a specific capability(command) is supported or not.
--- lib/librte_ether/Makefile | 1 + lib/librte_ether/rte_eth_features.h | 65 ++++++ lib/librte_pmd_i40e/Makefile | 6 + lib/librte_pmd_i40e/i40e_ethdev.c | 409 ++++++++++++++++++++++++++++++++++++ lib/librte_pmd_i40e/rte_i40e.h | 95 +++++++++ 5 files changed, 576 insertions(+) create mode 100644 lib/librte_ether/rte_eth_features.h create mode 100644 lib/librte_pmd_i40e/rte_i40e.h
lib/librte_ether/Makefile +1 -0
@@ -46,6 +46,7 @@ SRCS-y += rte_ethdev.c # SYMLINK-y-include += rte_ether.h SYMLINK-y-include += rte_ethdev.h +SYMLINK-y-include += rte_eth_features.h # this lib depends upon: DEPDIRS-y += lib/librte_eal lib/librte_mempool lib/librte_ring lib/librte_mbuf
lib/librte_ether/rte_eth_features.h new file +65 -0
65 lines not on this page · raw message
lib/librte_pmd_i40e/Makefile +6 -0
@@ -87,6 +87,12 @@ SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_ethdev.c SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_rxtx.c SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_ethdev_vf.c SRCS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += i40e_pf.c + +# +# Export include file +# +SYMLINK-$(CONFIG_RTE_LIBRTE_I40E_PMD)-include += rte_i40e.h + # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_eal lib/librte_ether DEPDIRS-$(CONFIG_RTE_LIBRTE_I40E_PMD) += lib/librte_mempool lib/librte_mbuf
lib/librte_pmd_i40e/i40e_ethdev.c +409 -0
443 lines not on this page · raw message
lib/librte_pmd_i40e/rte_i40e.h new file +95 -0
95 lines not on this page · raw message
Signature · 1 line
1.8.1.4
PATCH 5/5 app/testpmd: new commands for configuring hash functions
In reply to a message not in the archiveSix commands are added in testpmd to support configuring hash functions. They are,
* i40e_get_sym_hash_ena_per_port
* i40e_set_sym_hash_ena_per_port
* i40e_get_sym_hash_ena_per_pctype
* i40e_set_sym_hash_ena_per_pctype
* i40e_get_filter_swap
* i40e_set_filter_swap
--- app/test-pmd/cmdline.c | 455 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 455 insertions(+)
app/test-pmd/cmdline.c +455 -0
@@ -74,6 +74,10 @@#include <rte_ethdev.h> #include <rte_string_fns.h> #include <rte_devargs.h> +#include <rte_eth_features.h> +#ifdef RTE_LIBRTE_I40E_PMD +#include <rte_i40e.h> +#endif #include <cmdline_rdline.h> #include <cmdline_parse.h>
@@ -655,6 +659,34 @@ static void cmd_help_long_parsed(void *parsed_result,"get_flex_filter (port_id) index (idx)\n" " get info of a flex filter.\n\n" + +#ifdef RTE_LIBRTE_I40E_PMD +"i40e_get_sym_hash_ena_per_port (port_id)\n" +" get symmetric hash enable configuration per port," +" on i40e only\n\n" + +"i40e_set_sym_hash_ena_per_port (port_id)" +" enable|disable\n" +" set symmetric hash enable configuration per port" +" to enable or disable, on i40e only\n\n" + +"i40e_get_sym_hash_ena_per_pctype (port_id) (pctype)\n" +" get symmetric hash enable configuration per port," +" on i40e only\n\n" + +"i40e_set_sym_hash_ena_per_pctype (port_id) (pctype)" +" enable|disable\n" +" set symmetric hash enable configuration per" +" pctype to enable or disable, on i40e only\n\n" + +"i40e_get_filter_swap (port_id) (pctype)\n" +" get filter swap configurations on i40e," +" on i40e only\n\n" + +"i40e_set_filter_swap (port_id) (pctype) (off0_src0)" +" (off0_src1) (len0) (off1_src0) (off1_src1) (len1)\n" +" set filter swap configurations, on i40e only\n\n" +#endif /* RTE_LIBRTE_I40E_PMD */ ); } }
@@ -7304,6 +7336,421 @@ cmdline_parse_inst_t cmd_get_flex_filter = { }, }; +/* *** Classification Filters Control *** */ +#ifdef RTE_LIBRTE_I40E_PMD +/* *** Get symmetric hash enable per port *** */ +struct cmd_i40e_get_sym_hash_ena_per_port_result { +cmdline_fixed_string_t i40e_get_sym_hash_ena_per_port; +uint8_t port_id; +}; + +static void +cmd_i40e_get_sym_hash_per_port_parsed (void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ +struct cmd_i40e_get_sym_hash_ena_per_port_result *res = parsed_result; +uint8_t enable =0 ; +int ret; + +if (rte_eth_dev_check_command_supported (res->port_id, +RTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT ) <=0 ) { +printf ("Command of RTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT " +"not supported on port: %d\n" , res->port_id); +return ; + } + + ret =rte_eth_dev_rx_classification_filter_ctl (res->port_id, +RTE_CMD_GET_SYM_HASH_ENABLE_PER_PORT , &enable); +if (ret <0 ) { +printf ("Cannot get symmetric hash enable per port " +"on i40e port %u\n" , res->port_id); +return ; + } + +printf ("Symmetric hash is %s on i40e port %u\n" , + enable ?"enabled" :"disabled" , res->port_id); +} + +cmdline_parse_token_string_t cmd_i40e_get_sym_hash_ena_per_port_all = +TOKEN_STRING_INITIALIZER ( + struct cmd_i40e_get_sym_hash_ena_per_port_result, + i40e_get_sym_hash_ena_per_port, +"i40e_get_sym_hash_ena_per_port" ); +cmdline_parse_token_num_t cmd_i40e_get_sym_hash_ena_per_port_port_id = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_get_sym_hash_ena_per_port_result, + port_id,UINT8 ); + +cmdline_parse_inst_t cmd_i40e_get_sym_hash_ena_per_port = { + .f = cmd_i40e_get_sym_hash_per_port_parsed, + .data =NULL , + .help_str ="i40e_get_sym_hash_ena_per_port port_id" , + .tokens = { + (void *)&cmd_i40e_get_sym_hash_ena_per_port_all, + (void *)&cmd_i40e_get_sym_hash_ena_per_port_port_id, +NULL , + }, +}; + +/* *** Set symmetric hash enable per port *** */ +struct cmd_i40e_set_sym_hash_ena_per_port_result { +cmdline_fixed_string_t i40e_set_sym_hash_ena_per_port; +cmdline_fixed_string_t enable; +uint8_t port_id; +}; + +static void +cmd_i40e_set_sym_hash_per_port_parsed (void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ +struct cmd_i40e_set_sym_hash_ena_per_port_result *res = parsed_result; +uint8_t enable =0 ; +int ret; + +if (rte_eth_dev_check_command_supported (res->port_id, +RTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT ) <=0 ) { +printf ("Command of RTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT " +"not supported on port: %d\n" , res->port_id); +return ; + } + +if (!strcmp (res->enable,"enable" )) + enable =1 ; + ret =rte_eth_dev_rx_classification_filter_ctl (res->port_id, +RTE_CMD_SET_SYM_HASH_ENABLE_PER_PORT , &enable); +if (ret <0 ) { +printf ("Cannot set symmetric hash enable per port " +"on i40e port %u\n" , res->port_id); +return ; + } + +printf ("Symmetric hash has been set to %s on i40e port %u\n" , + res->enable, res->port_id); +} + +cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_port_all = +TOKEN_STRING_INITIALIZER ( + struct cmd_i40e_set_sym_hash_ena_per_port_result, + i40e_set_sym_hash_ena_per_port, +"i40e_set_sym_hash_ena_per_port" ); +cmdline_parse_token_num_t cmd_i40e_set_sym_hash_ena_per_port_port_id = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_sym_hash_ena_per_port_result, + port_id,UINT8 ); +cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_port_enable = +TOKEN_STRING_INITIALIZER ( + struct cmd_i40e_set_sym_hash_ena_per_port_result, + enable,"enable#disable" ); + +cmdline_parse_inst_t cmd_i40e_set_sym_hash_ena_per_port = { + .f = cmd_i40e_set_sym_hash_per_port_parsed, + .data =NULL , + .help_str ="i40e_set_sym_hash_ena_per_port port_id enable|disable" , + .tokens = { + (void *)&cmd_i40e_set_sym_hash_ena_per_port_all, + (void *)&cmd_i40e_set_sym_hash_ena_per_port_port_id, + (void *)&cmd_i40e_set_sym_hash_ena_per_port_enable, +NULL , + }, +}; + +/* *** Get symmetric hash enable per pctype *** */ +struct cmd_i40e_get_sym_hash_ena_per_pctype_result { +cmdline_fixed_string_t i40e_get_sym_hash_ena_per_pctype; +uint8_t port_id; +uint8_t pctype; +}; + +static void +cmd_i40e_get_sym_hash_per_pctype_parsed (void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ +struct cmd_i40e_get_sym_hash_ena_per_pctype_result *res = + parsed_result; +struct rte_i40e_sym_hash_enable_info info; +int ret; + +if (rte_eth_dev_check_command_supported (res->port_id, +RTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE ) <=0 ) { +printf ("Command of RTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE " +"not supported on port: %d\n" , res->port_id); +return ; + } + +memset (&info,0 ,sizeof (info)); + info.pctype = res->pctype; + ret =rte_eth_dev_rx_classification_filter_ctl (res->port_id, +RTE_CMD_GET_SYM_HASH_ENABLE_PER_PCTYPE , &info); +if (ret <0 ) { +printf ("Cannot get symmetric hash enable per pctype on i40e " +"port %u, pctype %u\n" , res->port_id, res->pctype); +return ; + } +printf ("Symmetric hash is %s on i40e port %u, pctype %u\n" , + info.enable ?"enabled" :"disabled" , + res->port_id, res->pctype); +} + +cmdline_parse_token_string_t cmd_i40e_get_sym_hash_ena_per_pctype_all = +TOKEN_STRING_INITIALIZER ( + struct cmd_i40e_get_sym_hash_ena_per_pctype_result, + i40e_get_sym_hash_ena_per_pctype, +"i40e_get_sym_hash_ena_per_pctype" ); +cmdline_parse_token_num_t cmd_i40e_get_sym_hash_ena_per_pctype_port_id = +TOKEN_NUM_INITIALIZER ( + struct cmd_i40e_get_sym_hash_ena_per_pctype_result, + port_id,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_get_sym_hash_ena_per_pctype_pctype = +TOKEN_NUM_INITIALIZER ( + struct cmd_i40e_get_sym_hash_ena_per_pctype_result, + pctype,UINT8 ); + +cmdline_parse_inst_t cmd_i40e_get_sym_hash_ena_per_pctype = { + .f = cmd_i40e_get_sym_hash_per_pctype_parsed, + .data =NULL , + .help_str ="i40e_get_sym_hash_ena_per_pctype port_id pctype" , + .tokens = { + (void *)&cmd_i40e_get_sym_hash_ena_per_pctype_all, + (void *)&cmd_i40e_get_sym_hash_ena_per_pctype_port_id, + (void *)&cmd_i40e_get_sym_hash_ena_per_pctype_pctype, +NULL , + }, +}; + +/* *** Set symmetric hash enable per pctype *** */ +struct cmd_i40e_set_sym_hash_ena_per_pctype_result { +cmdline_fixed_string_t i40e_set_sym_hash_ena_per_pctype; +cmdline_fixed_string_t enable; +uint8_t port_id; +uint8_t pctype; +}; + +static void +cmd_i40e_set_sym_hash_per_pctype_parsed (void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ +struct cmd_i40e_set_sym_hash_ena_per_pctype_result *res = + parsed_result; +struct rte_i40e_sym_hash_enable_info info; +int ret; + +if (rte_eth_dev_check_command_supported (res->port_id, +RTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE ) <=0 ) { +printf ("Command of RTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE " +"not supported on port: %d\n" , res->port_id); +return ; + } + +memset (&info,0 ,sizeof (info)); + info.pctype = res->pctype; +if (!strcmp (res->enable,"enable" )) + info.enable =1 ; + ret =rte_eth_dev_rx_classification_filter_ctl (res->port_id, +RTE_CMD_SET_SYM_HASH_ENABLE_PER_PCTYPE , &info); +if (ret <0 ) { +printf ("Cannot set symmetric hash enable per pctype to %s " +"on i40e port %u, pctype %u\n" , res->enable ? +"enabled" :"disabled" , res->port_id, res->pctype); +return ; + } +printf ("Symmetic hash has been set to %s on i40e port %u, pctype %u\n" , + res->enable, res->port_id, res->pctype); +} + +cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_pctype_all = +TOKEN_STRING_INITIALIZER ( + struct cmd_i40e_set_sym_hash_ena_per_pctype_result, + i40e_set_sym_hash_ena_per_pctype, +"i40e_set_sym_hash_ena_per_pctype" ); +cmdline_parse_token_num_t cmd_i40e_set_sym_hash_ena_per_pctype_port_id = +TOKEN_NUM_INITIALIZER ( + struct cmd_i40e_set_sym_hash_ena_per_pctype_result, + port_id,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_sym_hash_ena_per_pctype_pctype = +TOKEN_NUM_INITIALIZER ( + struct cmd_i40e_set_sym_hash_ena_per_pctype_result, + pctype,UINT8 ); +cmdline_parse_token_string_t cmd_i40e_set_sym_hash_ena_per_pctype_enable = +TOKEN_STRING_INITIALIZER ( + struct cmd_i40e_set_sym_hash_ena_per_pctype_result, + enable,"enable#disable" ); + +cmdline_parse_inst_t cmd_i40e_set_sym_hash_ena_per_pctype = { + .f = cmd_i40e_set_sym_hash_per_pctype_parsed, + .data =NULL , + .help_str ="i40e_set_sym_hash_ena_per_pctype pord_id " +"pctype enable|disable" , + .tokens = { + (void *)&cmd_i40e_set_sym_hash_ena_per_pctype_all, + (void *)&cmd_i40e_set_sym_hash_ena_per_pctype_port_id, + (void *)&cmd_i40e_set_sym_hash_ena_per_pctype_pctype, + (void *)&cmd_i40e_set_sym_hash_ena_per_pctype_enable, +NULL , + }, +}; + +/* *** Get filter swap *** */ +struct cmd_i40e_get_filter_swap_result { +cmdline_fixed_string_t i40e_get_filter_swap; +uint8_t port_id; +uint8_t pctype; +}; + +static void +cmd_i40e_get_filter_swap_parsed (void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ +struct cmd_i40e_get_filter_swap_result *res = parsed_result; +struct rte_i40e_filter_swap_info info; +int ret; + +if (rte_eth_dev_check_command_supported (res->port_id, +RTE_CMD_GET_FILTER_SWAP ) <=0 ) { +printf ("Command of RTE_CMD_GET_FILTER_SWAP not supported " +"on port: %d\n" , res->port_id); +return ; + } + +memset (&info,0 ,sizeof (info)); + info.pctype = res->pctype; + ret =rte_eth_dev_rx_classification_filter_ctl (res->port_id, +RTE_CMD_GET_FILTER_SWAP , &info); +if (ret <0 ) { +printf ("Cannot get filter swap on i40e port %u, pctype %u\n" , + res->port_id, res->pctype); +return ; + } +printf ("Filter swap of i40e port %u, pctype %u is configured as:\n" +"off0_src0: 0x%02x, off0_src1: 0x%02x, len0: 0x%02x\n" +"off1_src0: 0x%02x, off1_src1: 0x%02x, len1: 0x%02x\n" , + res->port_id, res->pctype, info.off0_src0, info.off0_src1, + info.len0, info.off1_src0, info.off1_src1, info.len1); +} + +cmdline_parse_token_string_t cmd_i40e_get_filter_swap_all = + TOKEN_STRING_INITIALIZER(struct cmd_i40e_get_filter_swap_result, + i40e_get_filter_swap,"i40e_get_filter_swap" ); +cmdline_parse_token_num_t cmd_i40e_get_filter_swap_port_id = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_get_filter_swap_result, + port_id,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_get_filter_swap_pctype = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_get_filter_swap_result, + pctype,UINT8 ); + +cmdline_parse_inst_t cmd_i40e_get_filter_swap = { + .f = cmd_i40e_get_filter_swap_parsed, + .data =NULL , + .help_str ="i40e_get_filter_swap port_id pctype" , + .tokens = { + (void *)&cmd_i40e_get_filter_swap_all, + (void *)&cmd_i40e_get_filter_swap_port_id, + (void *)&cmd_i40e_get_filter_swap_pctype, +NULL , + }, +}; + +/* *** Set filter swap *** */ +struct cmd_i40e_set_filter_swap_result { +cmdline_fixed_string_t i40e_set_filter_swap; +uint8_t port_id; +uint8_t pctype; +uint8_t off0_src0; +uint8_t off0_src1; +uint8_t len0; +uint8_t off1_src0; +uint8_t off1_src1; +uint8_t len1; +}; + +static void +cmd_i40e_set_filter_swap_parsed (void *parsed_result, + __rte_unused struct cmdline *cl, + __rte_unused void *data) +{ +struct cmd_i40e_set_filter_swap_result *res = parsed_result; +struct rte_i40e_filter_swap_info info; +int ret; + +if (rte_eth_dev_check_command_supported (res->port_id, +RTE_CMD_SET_FILTER_SWAP ) <=0 ) { +printf ("Command of RTE_CMD_SET_FILTER_SWAP not supported " +"on port: %d\n" , res->port_id); +return ; + } + +memset (&info,0 ,sizeof (info)); + info.pctype = res->pctype; + info.off0_src0 = res->off0_src0; + info.off0_src1 = res->off0_src1; + info.len0 = res->len0; + info.off1_src0 = res->off1_src0; + info.off1_src1 = res->off1_src1; + info.len1 = res->len1; + ret =rte_eth_dev_rx_classification_filter_ctl (res->port_id, +RTE_CMD_SET_FILTER_SWAP , &info); +if (ret <0 ) { +printf ("Cannot set filter swap on i40e port %u, pctype %u\n" , + res->port_id, res->pctype); +return ; + } +printf ("Filter swap of i40e port %u, pctype %u has been set as:\n" +"off0_src0: 0x%02x, off0_src1: 0x%02x, len0: 0x%02x\n" +"off1_src0: 0x%02x, off1_src1: 0x%02x, len1: 0x%02x\n" , + res->port_id, res->pctype, info.off0_src0, info.off0_src1, + info.len0, info.off1_src0, info.off1_src1, info.len1); +} + +cmdline_parse_token_string_t cmd_i40e_set_filter_swap_all = + TOKEN_STRING_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + i40e_set_filter_swap,"i40e_set_filter_swap" ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_port_id = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + port_id,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_pctype = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + pctype,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off0_src0 = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + off0_src0,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off0_src1 = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + off0_src1,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_len0 = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + len0,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off1_src0 = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + off1_src0,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_off1_src1 = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + off1_src1,UINT8 ); +cmdline_parse_token_num_t cmd_i40e_set_filter_swap_len1 = + TOKEN_NUM_INITIALIZER(struct cmd_i40e_set_filter_swap_result, + len1,UINT8 ); + +cmdline_parse_inst_t cmd_i40e_set_filter_swap = { + .f = cmd_i40e_set_filter_swap_parsed, + .data =NULL , + .help_str ="i40e_set_filter_swap port_id pctype off0_src0 off0_src1 " +"len0 off1_src0 off1_src1 len1" , + .tokens = { + (void *)&cmd_i40e_set_filter_swap_all, + (void *)&cmd_i40e_set_filter_swap_port_id, + (void *)&cmd_i40e_set_filter_swap_pctype, + (void *)&cmd_i40e_set_filter_swap_off0_src0, + (void *)&cmd_i40e_set_filter_swap_off0_src1, + (void *)&cmd_i40e_set_filter_swap_len0, + (void *)&cmd_i40e_set_filter_swap_off1_src0, + (void *)&cmd_i40e_set_filter_swap_off1_src1, + (void *)&cmd_i40e_set_filter_swap_len1, +NULL , + }, +}; +#endif /* RTE_LIBRTE_I40E_PMD */ +/* ******************************************************************************** */ /* list of instructions */
@@ -7429,6 +7876,14 @@ cmdline_parse_ctx_t main_ctx[] = { (cmdline_parse_inst_t *)&cmd_add_flex_filter, (cmdline_parse_inst_t *)&cmd_remove_flex_filter, (cmdline_parse_inst_t *)&cmd_get_flex_filter, +#ifdef RTE_LIBRTE_I40E_PMD + (cmdline_parse_inst_t *)&cmd_i40e_get_sym_hash_ena_per_port, + (cmdline_parse_inst_t *)&cmd_i40e_set_sym_hash_ena_per_port, + (cmdline_parse_inst_t *)&cmd_i40e_get_sym_hash_ena_per_pctype, + (cmdline_parse_inst_t *)&cmd_i40e_set_sym_hash_ena_per_pctype, + (cmdline_parse_inst_t *)&cmd_i40e_get_filter_swap, + (cmdline_parse_inst_t *)&cmd_i40e_set_filter_swap, +#endif /* RTE_LIBRTE_I40E_PMD */ NULL, };
Signature · 1 line
1.8.1.4
Re: [PATCH 1/5] ethdev: Rename macros of packet classification type
In reply to a message not in the archiveHi Helin,
2014-07-24 14:42, Helin Zhang:
lib/librte_ether/rte_ethdev.h struct rte_eth_rss_conf { · line 349
Quoted 7 lines
For better understanding, 'PCTYPE' was added to the name of i40e RSS shift macros.
Signed-off-by Helin Zhang <[email protected]>lib/librte_ether/rte_ethdev.h +1
-1-#define ETH_RSS_NONF_IPV4_UDP_SHIFT 31 +#define ETH_PCTYPE_NONF_IPV4_UDP 31
Why is it clearer? I don't understand what means PCTYPE.
Signature · 1 line
Thomas
Re: [PATCH 2/5] ethdev: add new ops of 'check_command_supported' and 'rx_classification_filter_ctl'
In reply to a message not in the archive2014-07-24 14:42, Helin Zhang:
Quoted 5 lines
Two ops of '
check_command_supported' and 'rx_classification_filter_ctl' are added.
* 'check_command_supported' is for capability discovery. In anothoer word, it is to check if specific feature/command is supported by the specific port.
This generic service is really needed to add NIC-specific functions. I'd suggest to name it "is_supported".
Quoted 4 lines
* '
rx_classification_filter_ctl' is for receive classifcation filter configuring. e.g. hash function configuration, flow director configuration. It is a common API where a lot of commands can be implemented for different sub features.
Not sure about this one. You are hiding specific API in an opaque structure. By the way, it should be in another patch.
Quoted 5 lines
lib/librte_ether/rte_ethdev.h +5
-0+/** +* Check if the command is supported by an Ethernet device. +* +* @param port_id +* The port identifier of the Ethernet device.
lib/librte_ether/rte_ethdev.h int rte_eth_dev_remove_flex_filter(uint8_t port_id, uint16_t index); · line 3587
Quoted 10 lines
lib/librte_ether/rte_ethdev.h +10
-0+* @param cmd +* The command. +* +* @return +* - (> 0) The command is supported. +* - (0) The command is not supported. +* - (-ENOTSUP) if hardware doesn't support. +* - (-ENODEV) if <port_id> is invalid. +*/ +int rte_eth_dev_check_command_supported (uint8_t port_id,uint32_t cmd);
What are the possible commands?
You should define enum/constants here.
Signature · 1 line
Thomas
Re: [PATCH 3/5] i40e: support selecting hash functions
In reply to a message not in the archive2014-07-24 14:42, Helin Zhang:
Quoted 7 lines
Toeplitz and simple XOR hash functions are supported by hardware, code changes are to tell the hardware which hash function is selected according to the configuration.
Signed-off-by Helin Zhang <[email protected]>+CONFIG_RTE_LIBRTE_I40E_HASH_FUNC_TOEPLITZ=y
Is it really a good idea to configure this kind of thing at build time? Maybe yes, I'm not sure.
Signature · 1 line
Thomas
Re: [PATCH 3/5] i40e: support selecting hash functions
Quoted 2 lines · Thomas Monjalon
Is it really a good idea to configure this kind of thing at build time? Maybe yes, I'm not sure.
Whether it's safe to set at runtime probably depends what happens to the card if it gets changed. Do you have to reset the card or the port? Or is it OK if it's more dynamic?
Matthew.
Re: [PATCH 3/5] i40e: support selecting hash functions
In reply to a message not in the archive2014-07-24 01:01, Matthew Hall:
Quoted 7 lines · Thomas Monjalon
Quoted 2 lines
Is it really a good idea to configure this kind of thing at build time? Maybe yes, I'm not sure.
Whether it's safe to set at runtime probably depends what happens to the card if it gets changed. Do you have to reset the card or the port? Or is it OK if it's more dynamic?
No, we can change configuration with rte_eth_dev_configure() before initializing port. So it is truly configurable.
Requiring recompilation means it's not really configurable between 2 runs. And it breaks binary packaging for Linux distributions.
Many things in DPDK are configured at build time. But we should wonder if it's really a good design.
Signature · 1 line
Thomas
Re: [PATCH 1/5] ethdev: Rename macros of packet classification type
In reply to Thomas MonjalonQuoted 18 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, July 24, 2014 3:48 PM
To: Zhang, Helin
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/5] ethdev: Rename macros of packet classification typeHi Helin,
2014-07-24 14:42, Helin Zhang:
Quoted 4 lines
For better understanding, 'PCTYPE' was added to the name of i40e RSS shift macros.
Signed-off-by Helin Zhang <[email protected]>
Quoted 7 lines
lib/librte_ether/rte_ethdev.h struct rte_eth_rss_conf { · line 349
Quoted 2 lines
lib/librte_ether/rte_ethdev.h +1
-1-#define ETH_RSS_NONF_IPV4_UDP_SHIFT 31 +#define ETH_PCTYPE_NONF_IPV4_UDP 31Why is it clearer? I don't understand what means PCTYPE.
--
Thomas
Hi Thomas
It is 'packet classification type' defined in data sheet, and widely used. It is not just for RSS only, it can be used for flow director possibly. That's why I think it would be better to rename it with PCTYPE names. Thank you!
Regards,
Helin
Re: [PATCH 3/5] i40e: support selecting hash functions
In reply to Thomas MonjalonIf no reboot of the card is needed then it's probably better to add it to one of the ethtool style APIs...
Signature · 1 line
Sent from my mobile device.
Quoted 21 lines · Thomas Monjalon
2014-07-24 01:01, Matthew Hall:
Quoted 2 lines · Thomas Monjalon
Quoted 1 line
Is it really a good idea to configure this kind of thing at build
time?
Quoted 3 lines
Quoted 1 line
Maybe yes, I'm not sure.
Whether it's safe to set at runtime probably depends what happens to
the card
Quoted 1 line
if it gets changed. Do you have to reset the card or the port? Or is
it OK if
Quoted 1 line
it's more dynamic?
No, we can change configuration with
rte_eth_dev_configure()before initializing port. So it is truly configurable.
Requiring recompilation means it's not really configurable between 2 runs.
And it breaks binary packaging for Linux distributions.Many things in DPDK are configured at build time. But we should wonder if
it's really a good design.
Re: [PATCH 1/5] ethdev: Rename macros of packet classification type
In reply to a message not in the archive2014-07-24 08:14, Zhang, Helin:
Quoted 5 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 4 lines
2014-07-24 14:42, Helin Zhang:
Quoted 3 lines
For better understanding, 'PCTYPE' was added to the name of i40e RSS shift macros.
Quoted 8 lines
Quoted 6 lines
lib/librte_ether/rte_ethdev.h struct rte_eth_rss_conf { · line 349
Quoted 4 lines
Signed-off-by Helin Zhang <[email protected]>lib/librte_ether/rte_ethdev.h +1
-1-#define ETH_RSS_NONF_IPV4_UDP_SHIFT 31 +#define ETH_PCTYPE_NONF_IPV4_UDP 31Why is it clearer? I don't understand what means PCTYPE.
It is 'packet classification type' defined in data sheet, and widely used.
Widely used? No it seems to be an i40e naming.
Which datasheet are you pointing?
Quoted 2 lines
It is not just for RSS only, it can be used for flow director possibly. That's why I think it would be better to rename it with PCTYPE names.
At least, you should add a comment in the code to explain the meaning.
Thank you
Signature · 1 line
Thomas
Re: [PATCH 1/5] ethdev: Rename macros of packet classification type
Quoted 23 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, July 24, 2014 4:20 PM
To: Zhang, Helin
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 1/5] ethdev: Rename macros of packet classification type2014-07-24 08:14, Zhang, Helin:
Quoted 12 lines
From: Thomas Monjalon [mailto:[email protected]]
Quoted 10 lines
2014-07-24 14:42, Helin Zhang:
lib/librte_ether/rte_ethdev.h struct rte_eth_rss_conf { · line 349
Quoted 7 lines
For better understanding, 'PCTYPE' was added to the name of i40e RSS shift macros.
Signed-off-by Helin Zhang <[email protected]>lib/librte_ether/rte_ethdev.h +1
-1-#define ETH_RSS_NONF_IPV4_UDP_SHIFT 31 +#define ETH_PCTYPE_NONF_IPV4_UDP 31Why is it clearer? I don't understand what means PCTYPE.
Quoted 4 lines
Quoted 1 line
It is 'packet classification type' defined in data sheet, and widely used.
Widely used? No it seems to be an i40e naming.
Which datasheet are you pointing?
Sorry, it is widely used in i40e. That might not so widely for the whole DPDK. The datasheet I mentioned is the Intel(r) 40G NIC datasheet.
Quoted 5 lines
Quoted 3 lines
It is not just for RSS only, it can be used for flow director possibly. That's why I think it would be better to rename it with PCTYPE names.
At least, you should add a comment in the code to explain the meaning.
OK, good comments!
Quoted 4 lines
Thank you
--
Thomas
Re: [PATCH 2/5] ethdev: add new ops of 'check_command_supported' and 'rx_classification_filter_ctl'
In reply to Thomas MonjalonQuoted 11 lines
-----Original Message-----
From: Thomas Monjalon [mailto:[email protected]]
Sent: Thursday, July 24, 2014 3:57 PM
To: Zhang, Helin
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 2/5] ethdev: add new ops of 'check_command_supported' and 'rx_classification_filter_ctl'2014-07-24 14:42, Helin Zhang:
Quoted 9 lines
Quoted 5 lines
Two ops of '
check_command_supported' and 'rx_classification_filter_ctl' are added.
* 'check_command_supported' is for capability discovery. In anothoer word, it is to check if specific feature/command is supported by the specific port.This generic service is really needed to add NIC-specific functions. I'd suggest to name it "
is_supported".
I tried to name it as the same style of rte_cpu_check_supported(). As you indicated, 'is_commmand_supported' might be a better name.
Quoted 8 lines
Quoted 4 lines
* '
rx_classification_filter_ctl' is for receive classifcation filter configuring. e.g. hash function configuration, flow director configuration. It is a common API where a lot of commands can be implemented for different sub features.Not sure about this one. You are hiding specific API in an opaque structure. By the way, it should be in another patch.
We want to implement several common API for NIC specific features, to avoid creating quite a lot of ops in 'struct eth_dev_ops'. The idea came from ioctl.
Quoted 17 lines
Quoted 5 lines
lib/librte_ether/rte_ethdev.h +5
-0+/** +* Check if the command is supported by an Ethernet device. +* +* @param port_id +* The port identifier of the Ethernet device. lib/librte_ether/rte_ethdev.h int rte_eth_dev_remove_flex_filter(uint8_t port_id, uint16_t index);
Quoted 10 lines
lib/librte_ether/rte_ethdev.h +10
-0+* @param cmd +* The command. +* +* @return +* - (> 0) The command is supported. +* - (0) The command is not supported. +* - (-ENOTSUP) if hardware doesn't support. +* - (-ENODEV) if <port_id> is invalid. +*/ +int rte_eth_dev_check_command_supported(uint8_t port_id, uint32_tcmd);
Quoted 3 lines
What are the possible commands?
You should define enum/constants here.
The idea came from ioctl(). Enum could be a choice. The commands was defined in rte_eth_features.h. Comments should be added here for telling that.
Quoted 2 lines
--
Thomas
Re: [PATCH 3/5] i40e: support selecting hash functions
In reply to a message not in the archiveQuoted 9 lines
-----Original Message-----
From: Matthew Hall [mailto:[email protected]]
Sent: Thursday, July 24, 2014 4:15 PM
To: Thomas Monjalon; Zhang, Helin
Cc: [email protected]
Subject: Re: [dpdk-dev] [PATCH 3/5] i40e: support selecting hash functions
Quoted 27 lines
If no reboot of the card is needed then it's probably better to add it to one of the ethtool style APIs...
--
Sent from my mobile device.Quoted 20 lines · Thomas Monjalon
2014-07-24 01:01, Matthew Hall:
Quoted 2 lines · Thomas Monjalon
Quoted 1 line
Is it really a good idea to configure this kind of thing at build
time?
Quoted 3 lines
Quoted 1 line
Maybe yes, I'm not sure.
Whether it's safe to set at runtime probably depends what happens to
the card
Quoted 1 line
if it gets changed. Do you have to reset the card or the port? Or is
it OK if
Quoted 1 line
it's more dynamic?
No, we can change configuration with
rte_eth_dev_configure()before initializing port. So it is truly configurable.
Requiring recompilation means it's not really configurable between 2 runs.
And it breaks binary packaging for Linux distributions.Many things in DPDK are configured at build time. But we should wonder if it's really a good design.
Hi Thomas, Matt
Good points! Thank you guys!
Regards,
Helin