ethdev: add mbuf RSS update as an offload

Add new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf:#️⃣:rss`.
PMDs notify the validity of `rte_mbuf:#️⃣rss` to the application
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.

Also update testpmd rx_offload command to include RSS_HASH

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
This commit is contained in:
Pavan Nikhilesh 2019-11-11 18:49:06 +05:30 committed by Ferruh Yigit
parent 5d4813acda
commit 5d30897295
6 changed files with 25 additions and 3 deletions

View File

@ -18084,7 +18084,7 @@ cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_offload =
offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#" offload, "vlan_strip#ipv4_cksum#udp_cksum#tcp_cksum#tcp_lro#"
"qinq_strip#outer_ipv4_cksum#macsec_strip#" "qinq_strip#outer_ipv4_cksum#macsec_strip#"
"header_split#vlan_filter#vlan_extend#jumbo_frame#" "header_split#vlan_filter#vlan_extend#jumbo_frame#"
"scatter#timestamp#security#keep_crc"); "scatter#timestamp#security#keep_crc#rss_hash");
cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_on_off = cmdline_parse_token_string_t cmd_config_per_port_rx_offload_result_on_off =
TOKEN_STRING_INITIALIZER TOKEN_STRING_INITIALIZER
(struct cmd_config_per_port_rx_offload_result, (struct cmd_config_per_port_rx_offload_result,
@ -18164,7 +18164,7 @@ cmdline_parse_inst_t cmd_config_per_port_rx_offload = {
.help_str = "port config <port_id> rx_offload vlan_strip|ipv4_cksum|" .help_str = "port config <port_id> rx_offload vlan_strip|ipv4_cksum|"
"udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|" "udp_cksum|tcp_cksum|tcp_lro|qinq_strip|outer_ipv4_cksum|"
"macsec_strip|header_split|vlan_filter|vlan_extend|" "macsec_strip|header_split|vlan_filter|vlan_extend|"
"jumbo_frame|scatter|timestamp|security|keep_crc " "jumbo_frame|scatter|timestamp|security|keep_crc|rss_hash "
"on|off", "on|off",
.tokens = { .tokens = {
(void *)&cmd_config_per_port_rx_offload_result_port, (void *)&cmd_config_per_port_rx_offload_result_port,

View File

@ -274,6 +274,7 @@ Supports RSS hashing on RX.
* **[uses] user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``. * **[uses] user config**: ``dev_conf.rxmode.mq_mode`` = ``ETH_MQ_RX_RSS_FLAG``.
* **[uses] user config**: ``dev_conf.rx_adv_conf.rss_conf``. * **[uses] user config**: ``dev_conf.rx_adv_conf.rss_conf``.
* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
* **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``. * **[provides] rte_eth_dev_info**: ``flow_type_rss_offloads``.
* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``. * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.
@ -286,6 +287,7 @@ Inner RSS
Supports RX RSS hashing on Inner headers. Supports RX RSS hashing on Inner headers.
* **[uses] rte_flow_action_rss**: ``level``. * **[uses] rte_flow_action_rss**: ``level``.
* **[uses] rte_eth_rxconf,rte_eth_rxmode**: ``offloads:DEV_RX_OFFLOAD_RSS_HASH``.
* **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``. * **[provides] mbuf**: ``mbuf.ol_flags:PKT_RX_RSS_HASH``, ``mbuf.rss``.

View File

@ -101,6 +101,13 @@ New Features
* This scheme will allow PMDs to avoid lookup to internal ptype table on Rx * This scheme will allow PMDs to avoid lookup to internal ptype table on Rx
and thereby improve Rx performance if application wishes do so. and thereby improve Rx performance if application wishes do so.
* **Added Rx offload flag to enable or disable RSS update**
* Added new Rx offload flag `DEV_RX_OFFLOAD_RSS_HASH` which can be used to
enable/disable PMDs write to `rte_mbuf::hash::rss`.
* PMDs notify the validity of `rte_mbuf::hash:rss` to the application
by enabling `PKT_RX_RSS_HASH ` flag in `rte_mbuf::ol_flags`.
* **Updated the enic driver.** * **Updated the enic driver.**
* Added support for Geneve with options offload. * Added support for Geneve with options offload.

View File

@ -1680,7 +1680,7 @@ Enable or disable a per port Rx offloading on all Rx queues of a port::
vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro, vlan_strip, ipv4_cksum, udp_cksum, tcp_cksum, tcp_lro,
qinq_strip, outer_ipv4_cksum, macsec_strip, qinq_strip, outer_ipv4_cksum, macsec_strip,
header_split, vlan_filter, vlan_extend, jumbo_frame, header_split, vlan_filter, vlan_extend, jumbo_frame,
scatter, timestamp, security, keep_crc scatter, timestamp, security, keep_crc, rss_hash
This command should be run when the port is stopped, or else it will fail. This command should be run when the port is stopped, or else it will fail.

View File

@ -129,6 +129,7 @@ static const struct {
RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC), RTE_RX_OFFLOAD_BIT2STR(KEEP_CRC),
RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM), RTE_RX_OFFLOAD_BIT2STR(SCTP_CKSUM),
RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM), RTE_RX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),
RTE_RX_OFFLOAD_BIT2STR(RSS_HASH),
}; };
#undef RTE_RX_OFFLOAD_BIT2STR #undef RTE_RX_OFFLOAD_BIT2STR
@ -1305,6 +1306,17 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
goto rollback; goto rollback;
} }
/* Check if Rx RSS distribution is disabled but RSS hash is enabled. */
if (((dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG) == 0) &&
(dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
RTE_ETHDEV_LOG(ERR,
"Ethdev port_id=%u config invalid Rx mq_mode without RSS but %s offload is requested",
port_id,
rte_eth_dev_rx_offload_name(DEV_RX_OFFLOAD_RSS_HASH));
ret = -EINVAL;
goto rollback;
}
/* /*
* Setup new number of RX/TX queues and reconfigure device. * Setup new number of RX/TX queues and reconfigure device.
*/ */

View File

@ -1088,6 +1088,7 @@ struct rte_eth_conf {
#define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000 #define DEV_RX_OFFLOAD_KEEP_CRC 0x00010000
#define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000 #define DEV_RX_OFFLOAD_SCTP_CKSUM 0x00020000
#define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000 #define DEV_RX_OFFLOAD_OUTER_UDP_CKSUM 0x00040000
#define DEV_RX_OFFLOAD_RSS_HASH 0x00080000
#define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \ #define DEV_RX_OFFLOAD_CHECKSUM (DEV_RX_OFFLOAD_IPV4_CKSUM | \
DEV_RX_OFFLOAD_UDP_CKSUM | \ DEV_RX_OFFLOAD_UDP_CKSUM | \