The aggregated compact CQE does not expose a readable RSS hash flags field. To keep the same behavior as the normal CQE, always enable ipv6_ext and tcp_ipv6_ext (every tile supports them) and save the configured RSS hash flags in software state.
Signed-off-by: Jiacheng Ye <[email protected]> --- doc/guides/rel_notes/release_26_11.rst | 1 + drivers/net/hinic3/base/hinic3_nic_cfg.h | 21 +++++++++++++-------- drivers/net/hinic3/hinic3_ethdev.c | 17 +++++------------ drivers/net/hinic3/hinic3_ethdev.h | 2 ++ drivers/net/hinic3/hinic3_rx.c | 12 ++++-------- 5 files changed, 25 insertions(+), 28 deletions(-) diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst index e1132b379a..80530ac25d 100644 --- a/doc/guides/rel_notes/release_26_11.rst +++ b/doc/guides/rel_notes/release_26_11.rst @@ -97,6 +97,7 @@ New Features * Added CIR drop statistics and VF link aggregation (LAG) support. * Added FEC mode get and set support. * Added Class of Service (COS) mask and map support. + * Updated RSS hash type configuration. * **Updated Intel iavf driver.** diff --git a/drivers/net/hinic3/base/hinic3_nic_cfg.h b/drivers/net/hinic3/base/hinic3_nic_cfg.h index 42a7b7010d..ecd410785f 100644 --- a/drivers/net/hinic3/base/hinic3_nic_cfg.h +++ b/drivers/net/hinic3/base/hinic3_nic_cfg.h @@ -73,14 +73,19 @@ HINIC3_SUPPORT_FEATURE(dev, IPXIP_OFFLOAD) struct hinic3_rss_type { - uint8_t tcp_ipv6_ext; - uint8_t ipv6_ext; - uint8_t tcp_ipv6; - uint8_t ipv6; - uint8_t tcp_ipv4; - uint8_t ipv4; - uint8_t udp_ipv6; - uint8_t udp_ipv4; + union { + struct { + uint8_t tcp_ipv6_ext; + uint8_t ipv6_ext; + uint8_t tcp_ipv6; + uint8_t ipv6; + uint8_t tcp_ipv4; + uint8_t ipv4; + uint8_t udp_ipv6; + uint8_t udp_ipv4; + }; + uint64_t val; + }; }; enum hinic3_rss_hash_type { diff --git a/drivers/net/hinic3/hinic3_ethdev.c b/drivers/net/hinic3/hinic3_ethdev.c index d7dbd945bc..9adfe7db41 100644 --- a/drivers/net/hinic3/hinic3_ethdev.c +++ b/drivers/net/hinic3/hinic3_ethdev.c @@ -2671,19 +2671,14 @@ hinic3_rss_hash_update(struct rte_eth_dev *dev, rss_type.tcp_ipv6 = (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_TCP) ? 1 : 0; rss_type.udp_ipv4 = (rss_hf & RTE_ETH_RSS_NONFRAG_IPV4_UDP) ? 1 : 0; rss_type.udp_ipv6 = (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_UDP) ? 1 : 0; - - if (nic_dev->feature_cap & NIC_F_HTN_CMDQ) { - rss_type.ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_EX) ? 1 : 0; - rss_type.tcp_ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_TCP_EX) ? 1 : 0; - } else { - rss_type.ipv6_ext = 0; - rss_type.tcp_ipv6_ext = 0; - } + rss_type.ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_EX) ? 1 : 0; + rss_type.tcp_ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_TCP_EX) ? 1 : 0; err = hinic3_set_rss_type(nic_dev->hwdev, rss_type); if (err) PMD_DRV_LOG(ERR, "Set RSS type failed"); + nic_dev->rss_type = rss_type; return err; } @@ -2739,10 +2734,8 @@ hinic3_rss_conf_get(struct rte_eth_dev *dev, struct rte_eth_rss_conf *rss_conf) rss_conf->rss_hf |= rss_type.tcp_ipv6 ? RTE_ETH_RSS_NONFRAG_IPV6_TCP : 0; rss_conf->rss_hf |= rss_type.udp_ipv4 ? RTE_ETH_RSS_NONFRAG_IPV4_UDP : 0; rss_conf->rss_hf |= rss_type.udp_ipv6 ? RTE_ETH_RSS_NONFRAG_IPV6_UDP : 0; - if (nic_dev->feature_cap & NIC_F_HTN_CMDQ) { - rss_conf->rss_hf |= rss_type.ipv6_ext ? RTE_ETH_RSS_IPV6_EX : 0; - rss_conf->rss_hf |= rss_type.tcp_ipv6_ext ? RTE_ETH_RSS_IPV6_TCP_EX : 0; - } + rss_conf->rss_hf |= rss_type.ipv6_ext ? RTE_ETH_RSS_IPV6_EX : 0; + rss_conf->rss_hf |= rss_type.tcp_ipv6_ext ? RTE_ETH_RSS_IPV6_TCP_EX : 0; return 0; } diff --git a/drivers/net/hinic3/hinic3_ethdev.h b/drivers/net/hinic3/hinic3_ethdev.h index 57f46aa850..b38853f556 100644 --- a/drivers/net/hinic3/hinic3_ethdev.h +++ b/drivers/net/hinic3/hinic3_ethdev.h @@ -9,6 +9,7 @@ #include <rte_ethdev_core.h> #include "hinic3_fdir.h" +#include "base/hinic3_nic_cfg.h" #define HINIC3_PMD_DRV_VERSION "B106" @@ -124,6 +125,7 @@ struct hinic3_nic_dev { uint16_t num_rss; /**< Number of RSS queues. */ uint32_t rx_mode; + struct hinic3_rss_type rss_type; uint8_t rx_queue_list[HINIC3_MAX_QUEUE_NUM]; rte_spinlock_t queue_list_lock; diff --git a/drivers/net/hinic3/hinic3_rx.c b/drivers/net/hinic3/hinic3_rx.c index ed753ba4ec..57e50590cd 100644 --- a/drivers/net/hinic3/hinic3_rx.c +++ b/drivers/net/hinic3/hinic3_rx.c @@ -437,16 +437,11 @@ hinic3_init_rss_type(struct hinic3_nic_dev *nic_dev, rss_type.tcp_ipv6 = (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_TCP) ? 1 : 0; rss_type.udp_ipv4 = (rss_hf & RTE_ETH_RSS_NONFRAG_IPV4_UDP) ? 1 : 0; rss_type.udp_ipv6 = (rss_hf & RTE_ETH_RSS_NONFRAG_IPV6_UDP) ? 1 : 0; - - if (nic_dev->feature_cap & NIC_F_HTN_CMDQ) { - rss_type.ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_EX) ? 1 : 0; - rss_type.tcp_ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_TCP_EX) ? 1 : 0; - } else { - rss_type.ipv6_ext = 0; - rss_type.tcp_ipv6_ext = 0; - } + rss_type.ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_EX) ? 1 : 0; + rss_type.tcp_ipv6_ext = (rss_hf & RTE_ETH_RSS_IPV6_TCP_EX) ? 1 : 0; err = hinic3_set_rss_type(nic_dev->hwdev, rss_type); + nic_dev->rss_type = rss_type; return err; } @@ -1056,6 +1051,7 @@ hinic3_rx_get_compact_cqe_info(struct hinic3_rxq *rxq, volatile struct hinic3_rq cqe_info->pkt_len = HINIC3_RQ_COMPACT_CQE_STATUS_GET(dw0, PKT_LEN); cqe_info->ts_flag = HINIC3_RQ_COMPACT_CQE_STATUS_GET(dw0, TS_FLAG); cqe_info->ptype = HINIC3_RQ_COMPACT_CQE_STATUS_GET(dw0, PTYPE); + cqe_info->rss_type = (rxq->nic_dev->rss_type.val != 0) ? 1 : 0; cqe_info->rss_hash_value = dw1; if (cqe_info->cqe_len == HINIC3_RQ_COMPACT_CQE_16BYTE) { -- 2.33.0

