ethdev: add the hash key size per device
authorHelin Zhang <helin.zhang@intel.com>
Fri, 12 Jun 2015 07:33:56 +0000 (15:33 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 8 Jul 2015 23:14:51 +0000 (01:14 +0200)
To support querying hash key size per port, an new field of
'hash_key_size' was added in 'struct rte_eth_dev_info' for storing
hash key size in bytes.

The correct hash key size in bytes should be filled into the
'struct rte_eth_dev_info', to support querying it.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
drivers/net/e1000/igb_ethdev.c
drivers/net/fm10k/fm10k_ethdev.c
drivers/net/i40e/i40e_ethdev.c
drivers/net/i40e/i40e_ethdev_vf.c
drivers/net/ixgbe/ixgbe_ethdev.c
lib/librte_ether/rte_ethdev.h

index 24c7510..11e8ab8 100644 (file)
@@ -68,6 +68,8 @@
 #define IGB_DEFAULT_TX_HTHRESH      0
 #define IGB_DEFAULT_TX_WTHRESH      0
 
+#define IGB_HKEY_MAX_INDEX 10
+
 /* Bit shift and mask */
 #define IGB_4_BIT_WIDTH  (CHAR_BIT / 2)
 #define IGB_4_BIT_MASK   RTE_LEN2MASK(IGB_4_BIT_WIDTH, uint8_t)
@@ -1383,6 +1385,7 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                /* Should not happen */
                break;
        }
+       dev_info->hash_key_size = IGB_HKEY_MAX_INDEX * sizeof(uint32_t);
        dev_info->reta_size = ETH_RSS_RETA_SIZE_128;
        dev_info->flow_type_rss_offloads = IGB_RSS_OFFLOAD_ALL;
 
index 1058cfd..f12d0c8 100644 (file)
@@ -914,6 +914,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev,
                DEV_RX_OFFLOAD_TCP_CKSUM;
        dev_info->tx_offload_capa =
                DEV_TX_OFFLOAD_VLAN_INSERT;
+       dev_info->hash_key_size = FM10K_RSSRK_SIZE * sizeof(uint32_t);
        dev_info->reta_size = FM10K_MAX_RSS_INDICES;
 
        dev_info->default_rxconf = (struct rte_eth_rxconf) {
index dcf91bb..5fb6b4c 100644 (file)
@@ -1560,6 +1560,8 @@ i40e_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                DEV_TX_OFFLOAD_SCTP_CKSUM |
                DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM |
                DEV_TX_OFFLOAD_TCP_TSO;
+       dev_info->hash_key_size = (I40E_PFQF_HKEY_MAX_INDEX + 1) *
+                                               sizeof(uint32_t);
        dev_info->reta_size = pf->hash_lut_size;
        dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL;
 
index 652ed8d..b150b62 100644 (file)
@@ -1670,6 +1670,7 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        dev_info->max_tx_queues = vf->vsi_res->num_queue_pairs;
        dev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;
        dev_info->max_rx_pktlen = I40E_FRAME_SIZE_MAX;
+       dev_info->hash_key_size = (I40E_VFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t);
        dev_info->reta_size = ETH_RSS_RETA_SIZE_64;
        dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL;
        dev_info->rx_offload_capa =
index 0638302..b7a60b1 100644 (file)
 
 #define IXGBE_QUEUE_STAT_COUNTERS (sizeof(hw_stats->qprc) / sizeof(hw_stats->qprc[0]))
 
+#define IXGBE_HKEY_MAX_INDEX 10
+
 static int eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev);
 static int  ixgbe_dev_configure(struct rte_eth_dev *dev);
 static int  ixgbe_dev_start(struct rte_eth_dev *dev);
@@ -2074,6 +2076,7 @@ ixgbe_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
                .txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS |
                                ETH_TXQ_FLAGS_NOOFFLOADS,
        };
+       dev_info->hash_key_size = IXGBE_HKEY_MAX_INDEX * sizeof(uint32_t);
        dev_info->reta_size = ETH_RSS_RETA_SIZE_128;
        dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL;
 }
index 37d9a2b..438d59a 100644 (file)
@@ -924,6 +924,7 @@ 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. */
+       uint8_t hash_key_size; /**< Hash key size in bytes */
        /** 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 */