net/ice: show RSS hash configuration
authorTao Zhu <taox.zhu@intel.com>
Thu, 29 Oct 2020 06:37:57 +0000 (14:37 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 3 Nov 2020 22:35:03 +0000 (23:35 +0100)
Implement interface 'ice_rss_hash_conf_get' to support show RSS
hash configuration.

Note:
Only return rss_hf from latest dev_configure or dev_rss_hash_update.
All configures from rte_flow are ignored.

Signed-off-by: Tao Zhu <taox.zhu@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_ethdev.c
drivers/net/ice/ice_ethdev.h

index 3483f99..eaf6024 100644 (file)
@@ -2923,6 +2923,16 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
        struct ice_vsi *vsi = pf->main_vsi;
        int ret;
 
+#define ICE_RSS_HF_ALL ( \
+       ETH_RSS_IPV4 | \
+       ETH_RSS_IPV6 | \
+       ETH_RSS_NONFRAG_IPV4_UDP | \
+       ETH_RSS_NONFRAG_IPV6_UDP | \
+       ETH_RSS_NONFRAG_IPV4_TCP | \
+       ETH_RSS_NONFRAG_IPV6_TCP | \
+       ETH_RSS_NONFRAG_IPV4_SCTP | \
+       ETH_RSS_NONFRAG_IPV6_SCTP)
+
        /* Configure RSS for IPv4 with src/dst addr as input set */
        if (rss_hf & ETH_RSS_IPV4) {
                ret = ice_add_rss_cfg_wrap(pf, vsi->idx, ICE_FLOW_HASH_IPV4,
@@ -3216,6 +3226,8 @@ ice_rss_hash_set(struct ice_pf *pf, uint64_t rss_hf)
                        PMD_DRV_LOG(ERR, "%s GTPU_EH_IPV6_SCTP rss flow fail %d",
                                    __func__, ret);
        }
+
+       pf->rss_hf = rss_hf & ICE_RSS_HF_ALL;
 }
 
 static int ice_init_rss(struct ice_pf *pf)
@@ -4439,8 +4451,7 @@ ice_rss_hash_conf_get(struct rte_eth_dev *dev,
        ice_get_rss_key(vsi, rss_conf->rss_key,
                        &rss_conf->rss_key_len);
 
-       /* TODO: default set to 0 as hf config is not supported now */
-       rss_conf->rss_hf = 0;
+       rss_conf->rss_hf = pf->rss_hf;
        return 0;
 }
 
index 05218af..452fd90 100644 (file)
@@ -457,6 +457,7 @@ struct ice_pf {
        uint64_t old_rx_bytes;
        uint64_t old_tx_bytes;
        uint64_t supported_rxdid; /* bitmap for supported RXDID */
+       uint64_t rss_hf;
 };
 
 #define ICE_MAX_QUEUE_NUM  2048