* [dpdk-dev] [PATCH 0/6] query hash key size in byte @ 2015-06-04 1:00 Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size Helin Zhang ` (6 more replies) 0 siblings, 7 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 1:00 UTC (permalink / raw) To: dev As different hardware has different hash key size, querying it (in byte) per port was asked by users. Otherwise there is no convenient way to know the size of hash key should be prepared. Helin Zhang (6): ethdev: add an field for querying hash key size e1000: fill the hash key size fm10k: fill the hash key size i40e: fill the hash key size ixgbe: fill the hash key size app/testpmd: show the hash key size app/test-pmd/config.c | 2 ++ drivers/net/e1000/igb_ethdev.c | 3 +++ drivers/net/fm10k/fm10k_ethdev.c | 1 + drivers/net/i40e/i40e_ethdev.c | 2 ++ drivers/net/i40e/i40e_ethdev_vf.c | 2 ++ drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ lib/librte_ether/rte_ethdev.h | 1 + 7 files changed, 14 insertions(+) -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang @ 2015-06-04 1:00 ` Helin Zhang 2015-06-04 13:05 ` Neil Horman 2015-06-04 1:00 ` [dpdk-dev] [PATCH 2/6] e1000: fill the " Helin Zhang ` (5 subsequent siblings) 6 siblings, 1 reply; 29+ messages in thread From: Helin Zhang @ 2015-06-04 1:00 UTC (permalink / raw) To: dev 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. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_ether/rte_ethdev.h | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 16dbe00..004b05a 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -916,6 +916,7 @@ struct rte_eth_dev_info { uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */ uint32_t rx_offload_capa; /**< Device RX offload capabilities. */ uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ + uint8_t hash_key_size; /**< Hash key size in bytes */ uint16_t reta_size; /**< Device redirection table size, the total number of entries. */ /** Bit mask of RSS offloads, the bit offset also means flow type */ -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size 2015-06-04 1:00 ` [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size Helin Zhang @ 2015-06-04 13:05 ` Neil Horman 2015-06-05 6:21 ` Zhang, Helin 0 siblings, 1 reply; 29+ messages in thread From: Neil Horman @ 2015-06-04 13:05 UTC (permalink / raw) To: Helin Zhang; +Cc: dev On Thu, Jun 04, 2015 at 09:00:33AM +0800, Helin Zhang wrote: > 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. > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > --- > lib/librte_ether/rte_ethdev.h | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 16dbe00..004b05a 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -916,6 +916,7 @@ struct rte_eth_dev_info { > uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */ > uint32_t rx_offload_capa; /**< Device RX offload capabilities. */ > uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ > + uint8_t hash_key_size; /**< Hash key size in bytes */ > uint16_t reta_size; > /**< Device redirection table size, the total number of entries. */ > /** Bit mask of RSS offloads, the bit offset also means flow type */ > -- > 1.9.3 > > You'll need to at least move this to the end of the structure to avoid ABI breakage, but even then, since the examples statically allocate this struct on the stack, you need to worry about previously compiled applications not having enough space allocated. Is there a hole in the struct that this can fit into to avoid changing the other member offsets? Neil ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size 2015-06-04 13:05 ` Neil Horman @ 2015-06-05 6:21 ` Zhang, Helin 2015-06-05 10:30 ` Neil Horman 0 siblings, 1 reply; 29+ messages in thread From: Zhang, Helin @ 2015-06-05 6:21 UTC (permalink / raw) To: Neil Horman; +Cc: dev Hi Neil Yes, thank you very much for the comments! I realized the ABI issue after I sent out the patch. I think even I put the new one the end of this structure, it may also have issue. I'd like to have this change announced and then get it merged. That means I'd like to make this change and follow the policy and process. Regards, Helin > -----Original Message----- > From: Neil Horman [mailto:nhorman@tuxdriver.com] > Sent: Thursday, June 4, 2015 9:05 PM > To: Zhang, Helin > Cc: dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key > size > > On Thu, Jun 04, 2015 at 09:00:33AM +0800, Helin Zhang wrote: > > 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. > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > > --- > > lib/librte_ether/rte_ethdev.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/lib/librte_ether/rte_ethdev.h > > b/lib/librte_ether/rte_ethdev.h index 16dbe00..004b05a 100644 > > --- a/lib/librte_ether/rte_ethdev.h > > +++ b/lib/librte_ether/rte_ethdev.h > > @@ -916,6 +916,7 @@ struct rte_eth_dev_info { > > uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */ > > uint32_t rx_offload_capa; /**< Device RX offload capabilities. */ > > uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ > > + uint8_t hash_key_size; /**< Hash key size in bytes */ > > uint16_t reta_size; > > /**< Device redirection table size, the total number of entries. */ > > /** Bit mask of RSS offloads, the bit offset also means flow type */ > > -- > > 1.9.3 > > > > > > You'll need to at least move this to the end of the structure to avoid ABI breakage, > but even then, since the examples statically allocate this struct on the stack, you > need to worry about previously compiled applications not having enough space > allocated. Is there a hole in the struct that this can fit into to avoid changing the > other member offsets? > Neil ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size 2015-06-05 6:21 ` Zhang, Helin @ 2015-06-05 10:30 ` Neil Horman 0 siblings, 0 replies; 29+ messages in thread From: Neil Horman @ 2015-06-05 10:30 UTC (permalink / raw) To: Zhang, Helin; +Cc: dev On Fri, Jun 05, 2015 at 06:21:52AM +0000, Zhang, Helin wrote: > Hi Neil > > Yes, thank you very much for the comments! > I realized the ABI issue after I sent out the patch. I think even I put the new one the end of this structure, it may also have issue. > I'd like to have this change announced and then get it merged. That means I'd like to make this change and follow the policy and process. > > Regards, > Helin > Ok, sounds good. Thanks! Neil > > -----Original Message----- > > From: Neil Horman [mailto:nhorman@tuxdriver.com] > > Sent: Thursday, June 4, 2015 9:05 PM > > To: Zhang, Helin > > Cc: dev@dpdk.org > > Subject: Re: [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key > > size > > > > On Thu, Jun 04, 2015 at 09:00:33AM +0800, Helin Zhang wrote: > > > 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. > > > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > > > --- > > > lib/librte_ether/rte_ethdev.h | 1 + > > > 1 file changed, 1 insertion(+) > > > > > > diff --git a/lib/librte_ether/rte_ethdev.h > > > b/lib/librte_ether/rte_ethdev.h index 16dbe00..004b05a 100644 > > > --- a/lib/librte_ether/rte_ethdev.h > > > +++ b/lib/librte_ether/rte_ethdev.h > > > @@ -916,6 +916,7 @@ struct rte_eth_dev_info { > > > uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */ > > > uint32_t rx_offload_capa; /**< Device RX offload capabilities. */ > > > uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ > > > + uint8_t hash_key_size; /**< Hash key size in bytes */ > > > uint16_t reta_size; > > > /**< Device redirection table size, the total number of entries. */ > > > /** Bit mask of RSS offloads, the bit offset also means flow type */ > > > -- > > > 1.9.3 > > > > > > > > > > You'll need to at least move this to the end of the structure to avoid ABI breakage, > > but even then, since the examples statically allocate this struct on the stack, you > > need to worry about previously compiled applications not having enough space > > allocated. Is there a hole in the struct that this can fit into to avoid changing the > > other member offsets? > > Neil > > ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH 2/6] e1000: fill the hash key size 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size Helin Zhang @ 2015-06-04 1:00 ` Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 3/6] fm10k: " Helin Zhang ` (4 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 1:00 UTC (permalink / raw) To: dev 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> --- drivers/net/e1000/igb_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index e4b370d..7d388f3 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -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) @@ -1377,6 +1379,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; -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH 3/6] fm10k: fill the hash key size 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 2/6] e1000: fill the " Helin Zhang @ 2015-06-04 1:00 ` Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 4/6] i40e: " Helin Zhang ` (3 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 1:00 UTC (permalink / raw) To: dev 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> --- drivers/net/fm10k/fm10k_ethdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 87852ed..bd626ce 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -767,6 +767,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; dev_info->tx_offload_capa = 0; + 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) { -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH 4/6] i40e: fill the hash key size 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang ` (2 preceding siblings ...) 2015-06-04 1:00 ` [dpdk-dev] [PATCH 3/6] fm10k: " Helin Zhang @ 2015-06-04 1:00 ` Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 5/6] ixgbe: " Helin Zhang ` (2 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 1:00 UTC (permalink / raw) To: dev 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> --- drivers/net/i40e/i40e_ethdev.c | 2 ++ drivers/net/i40e/i40e_ethdev_vf.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index da6c0b5..c699ddb 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1540,6 +1540,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; diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 9f92a2f..eb37d3a 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1641,6 +1641,8 @@ 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; -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH 5/6] ixgbe: fill the hash key size 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang ` (3 preceding siblings ...) 2015-06-04 1:00 ` [dpdk-dev] [PATCH 4/6] i40e: " Helin Zhang @ 2015-06-04 1:00 ` Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 6/6] app/testpmd: show " Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 1:00 UTC (permalink / raw) To: dev 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> --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 0d9f9b2..588ccc0 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -116,6 +116,8 @@ #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); @@ -2052,6 +2054,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; } -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH 6/6] app/testpmd: show the hash key size 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang ` (4 preceding siblings ...) 2015-06-04 1:00 ` [dpdk-dev] [PATCH 5/6] ixgbe: " Helin Zhang @ 2015-06-04 1:00 ` Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 1:00 UTC (permalink / raw) To: dev As querying hash key size in byte was supported, it can be shown in testpmd after getting the device information if not zero. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/config.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f788ed5..800756f 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -361,6 +361,8 @@ port_infos_display(portid_t port_id) memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); + if (dev_info.hash_key_size > 0) + printf("Hash key size in bytes: %u\n", dev_info.hash_key_size); if (dev_info.reta_size > 0) printf("Redirection table size: %u\n", dev_info.reta_size); if (!dev_info.flow_type_rss_offloads) -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v2 0/6] query hash key size in byte 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang ` (5 preceding siblings ...) 2015-06-04 1:00 ` [dpdk-dev] [PATCH 6/6] app/testpmd: show " Helin Zhang @ 2015-06-04 7:33 ` Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size Helin Zhang ` (6 more replies) 6 siblings, 7 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 7:33 UTC (permalink / raw) To: dev As different hardware has different hash key sizes, querying it (in byte) per port was asked by users. Otherwise there is no convenient way to know the size of hash key which should be prepared. v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. Helin Zhang (6): ethdev: add an field for querying hash key size e1000: fill the hash key size fm10k: fill the hash key size i40e: fill the hash key size ixgbe: fill the hash key size app/testpmd: show the hash key size app/test-pmd/config.c | 4 ++++ drivers/net/e1000/igb_ethdev.c | 5 +++++ drivers/net/fm10k/fm10k_ethdev.c | 3 +++ drivers/net/i40e/i40e_ethdev.c | 4 ++++ drivers/net/i40e/i40e_ethdev_vf.c | 4 ++++ drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++ lib/librte_ether/rte_ethdev.h | 3 +++ 7 files changed, 28 insertions(+) -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang @ 2015-06-04 7:33 ` Helin Zhang 2015-06-04 10:38 ` Ananyev, Konstantin 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 2/6] e1000: fill the " Helin Zhang ` (5 subsequent siblings) 6 siblings, 1 reply; 29+ messages in thread From: Helin Zhang @ 2015-06-04 7:33 UTC (permalink / raw) To: dev 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. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_ether/rte_ethdev.h | 3 +++ 1 file changed, 3 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 16dbe00..bdebc87 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -916,6 +916,9 @@ struct rte_eth_dev_info { uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */ uint32_t rx_offload_capa; /**< Device RX offload capabilities. */ uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ +#ifdef RTE_QUERY_HASH_KEY_SIZE + uint8_t hash_key_size; /**< Hash key size in bytes */ +#endif uint16_t reta_size; /**< Device redirection table size, the total number of entries. */ /** Bit mask of RSS offloads, the bit offset also means flow type */ -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size Helin Zhang @ 2015-06-04 10:38 ` Ananyev, Konstantin 2015-06-12 6:06 ` Zhang, Helin 0 siblings, 1 reply; 29+ messages in thread From: Ananyev, Konstantin @ 2015-06-04 10:38 UTC (permalink / raw) To: Zhang, Helin, dev Hi Helin, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang > Sent: Thursday, June 04, 2015 8:34 AM > To: dev@dpdk.org > Subject: [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size > > 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. > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > --- > lib/librte_ether/rte_ethdev.h | 3 +++ > 1 file changed, 3 insertions(+) > > v2 changes: > * Disabled the code changes by default, to avoid breaking ABI compatibility. > > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 16dbe00..bdebc87 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -916,6 +916,9 @@ struct rte_eth_dev_info { > uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */ > uint32_t rx_offload_capa; /**< Device RX offload capabilities. */ > uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ > +#ifdef RTE_QUERY_HASH_KEY_SIZE > + uint8_t hash_key_size; /**< Hash key size in bytes */ > +#endif > uint16_t reta_size; > /**< Device redirection table size, the total number of entries. */ > /** Bit mask of RSS offloads, the bit offset also means flow type */ Why do you need to introduce an #ifdef RTE_QUERY_HASH_KEY_SIZE around your code? Why not to have it always on? Is it because of not breaking ABI for 2.1? But here, I suppose there would be no breakage anyway: 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. */ /** Bit mask of RSS offloads, the bit offset also means flow type */ uint64_t flow_type_rss_offloads; struct rte_eth_rxconf default_rxconf; so between 'reta_size' and 'flow_type_rss_offloads', there is a 2 bytes gap. Wonder, why not put it there? Konstantin > -- > 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size 2015-06-04 10:38 ` Ananyev, Konstantin @ 2015-06-12 6:06 ` Zhang, Helin 0 siblings, 0 replies; 29+ messages in thread From: Zhang, Helin @ 2015-06-12 6:06 UTC (permalink / raw) To: Ananyev, Konstantin; +Cc: dev > -----Original Message----- > From: Ananyev, Konstantin > Sent: Thursday, June 4, 2015 6:38 PM > To: Zhang, Helin; dev@dpdk.org > Subject: RE: [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash > key size > > Hi Helin, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Helin Zhang > > Sent: Thursday, June 04, 2015 8:34 AM > > To: dev@dpdk.org > > Subject: [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying > > hash key size > > > > 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. > > > > Signed-off-by: Helin Zhang <helin.zhang@intel.com> > > --- > > lib/librte_ether/rte_ethdev.h | 3 +++ > > 1 file changed, 3 insertions(+) > > > > v2 changes: > > * Disabled the code changes by default, to avoid breaking ABI compatibility. > > > > diff --git a/lib/librte_ether/rte_ethdev.h > > b/lib/librte_ether/rte_ethdev.h index 16dbe00..bdebc87 100644 > > --- a/lib/librte_ether/rte_ethdev.h > > +++ b/lib/librte_ether/rte_ethdev.h > > @@ -916,6 +916,9 @@ struct rte_eth_dev_info { > > uint16_t max_vmdq_pools; /**< Maximum number of VMDq pools. */ > > uint32_t rx_offload_capa; /**< Device RX offload capabilities. */ > > uint32_t tx_offload_capa; /**< Device TX offload capabilities. */ > > +#ifdef RTE_QUERY_HASH_KEY_SIZE > > + uint8_t hash_key_size; /**< Hash key size in bytes */ #endif > > uint16_t reta_size; > > /**< Device redirection table size, the total number of entries. */ > > /** Bit mask of RSS offloads, the bit offset also means flow type */ > > Why do you need to introduce an #ifdef RTE_QUERY_HASH_KEY_SIZE around > your code? > Why not to have it always on? > Is it because of not breaking ABI for 2.1? > But here, I suppose there would be no breakage anyway: > > 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. */ > /** Bit mask of RSS offloads, the bit offset also means flow type */ > uint64_t flow_type_rss_offloads; > struct rte_eth_rxconf default_rxconf; > > > so between 'reta_size' and 'flow_type_rss_offloads', there is a 2 bytes gap. > Wonder, why not put it there? Oh, yes, you are totally right. There should be a 2 bytes padding there. I will rework it with that. Thanks! Helin > > Konstantin > > > -- > > 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v2 2/6] e1000: fill the hash key size 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size Helin Zhang @ 2015-06-04 7:33 ` Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 3/6] fm10k: " Helin Zhang ` (4 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 7:33 UTC (permalink / raw) To: dev 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> --- drivers/net/e1000/igb_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index e4b370d..b85b786 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -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) @@ -1377,6 +1379,9 @@ eth_igb_infos_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) /* Should not happen */ break; } +#ifdef RTE_QUERY_HASH_KEY_SIZE + dev_info->hash_key_size = IGB_HKEY_MAX_INDEX * sizeof(uint32_t); +#endif dev_info->reta_size = ETH_RSS_RETA_SIZE_128; dev_info->flow_type_rss_offloads = IGB_RSS_OFFLOAD_ALL; -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v2 3/6] fm10k: fill the hash key size 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 2/6] e1000: fill the " Helin Zhang @ 2015-06-04 7:33 ` Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 4/6] i40e: " Helin Zhang ` (3 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 7:33 UTC (permalink / raw) To: dev 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> --- drivers/net/fm10k/fm10k_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 87852ed..043c60a 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -767,6 +767,9 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; dev_info->tx_offload_capa = 0; +#ifdef RTE_QUERY_HASH_KEY_SIZE + dev_info->hash_key_size = FM10K_RSSRK_SIZE * sizeof(uint32_t); +#endif dev_info->reta_size = FM10K_MAX_RSS_INDICES; dev_info->default_rxconf = (struct rte_eth_rxconf) { -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v2 4/6] i40e: fill the hash key size 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang ` (2 preceding siblings ...) 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 3/6] fm10k: " Helin Zhang @ 2015-06-04 7:33 ` Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 5/6] ixgbe: " Helin Zhang ` (2 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 7:33 UTC (permalink / raw) To: dev 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> --- drivers/net/i40e/i40e_ethdev.c | 4 ++++ drivers/net/i40e/i40e_ethdev_vf.c | 4 ++++ 2 files changed, 8 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index da6c0b5..63c76a6 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1540,6 +1540,10 @@ 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; +#ifdef RTE_QUERY_HASH_KEY_SIZE + dev_info->hash_key_size = (I40E_PFQF_HKEY_MAX_INDEX + 1) * + sizeof(uint32_t); +#endif dev_info->reta_size = pf->hash_lut_size; dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL; diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 9f92a2f..486b394 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1641,6 +1641,10 @@ 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; +#ifdef RTE_QUERY_HASH_KEY_SIZE + dev_info->hash_key_size = (I40E_VFQF_HKEY_MAX_INDEX + 1) * + sizeof(uint32_t); +#endif dev_info->reta_size = ETH_RSS_RETA_SIZE_64; dev_info->flow_type_rss_offloads = I40E_RSS_OFFLOAD_ALL; -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v2 5/6] ixgbe: fill the hash key size 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang ` (3 preceding siblings ...) 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 4/6] i40e: " Helin Zhang @ 2015-06-04 7:33 ` Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 6/6] app/testpmd: show " Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 7:33 UTC (permalink / raw) To: dev 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> --- drivers/net/ixgbe/ixgbe_ethdev.c | 5 +++++ 1 file changed, 5 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 0d9f9b2..b6f2574 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -116,6 +116,8 @@ #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); @@ -2052,6 +2054,9 @@ 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, }; +#ifdef RTE_QUERY_HASH_KEY_SIZE + dev_info->hash_key_size = IXGBE_HKEY_MAX_INDEX * sizeof(uint32_t); +#endif dev_info->reta_size = ETH_RSS_RETA_SIZE_128; dev_info->flow_type_rss_offloads = IXGBE_RSS_OFFLOAD_ALL; } -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v2 6/6] app/testpmd: show the hash key size 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang ` (4 preceding siblings ...) 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 5/6] ixgbe: " Helin Zhang @ 2015-06-04 7:33 ` Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-04 7:33 UTC (permalink / raw) To: dev As querying hash key size in byte was supported, it can be shown in testpmd after getting the device information if not zero. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/config.c | 4 ++++ 1 file changed, 4 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f788ed5..a9ec065 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -361,6 +361,10 @@ port_infos_display(portid_t port_id) memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); +#ifdef RTE_QUERY_HASH_KEY_SIZE + if (dev_info.hash_key_size > 0) + printf("Hash key size in bytes: %u\n", dev_info.hash_key_size); +#endif if (dev_info.reta_size > 0) printf("Redirection table size: %u\n", dev_info.reta_size); if (!dev_info.flow_type_rss_offloads) -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v3 0/6] query hash key size in byte 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang ` (5 preceding siblings ...) 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 6/6] app/testpmd: show " Helin Zhang @ 2015-06-12 7:33 ` Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 1/6] ethdev: add an field for querying hash key size Helin Zhang ` (6 more replies) 6 siblings, 7 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-12 7:33 UTC (permalink / raw) To: dev As different hardware has different hash key sizes, querying it (in byte) per port was asked by users. Otherwise there is no convenient way to know the size of hash key which should be prepared. v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. v3 changes: * Moved the newly added element right after 'uint16_t reta_size', where it was a padding. So it will not break any ABI compatibility, and no need to disable the code changes by default. Helin Zhang (6): ethdev: add an field for querying hash key size e1000: fill the hash key size fm10k: fill the hash key size i40e: fill the hash key size ixgbe: fill the hash key size app/testpmd: show the hash key size app/test-pmd/config.c | 2 ++ drivers/net/e1000/igb_ethdev.c | 3 +++ drivers/net/fm10k/fm10k_ethdev.c | 1 + drivers/net/i40e/i40e_ethdev.c | 2 ++ drivers/net/i40e/i40e_ethdev_vf.c | 2 ++ drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ lib/librte_ether/rte_ethdev.h | 1 + 7 files changed, 14 insertions(+) -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v3 1/6] ethdev: add an field for querying hash key size 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang @ 2015-06-12 7:33 ` Helin Zhang 2015-06-15 15:01 ` Thomas Monjalon 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 2/6] e1000: fill the " Helin Zhang ` (5 subsequent siblings) 6 siblings, 1 reply; 29+ messages in thread From: Helin Zhang @ 2015-06-12 7:33 UTC (permalink / raw) To: dev 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. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- lib/librte_ether/rte_ethdev.h | 1 + 1 file changed, 1 insertion(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. v3 changes: * Moved the newly added element right after 'uint16_t reta_size', where it was a padding. So it will not break any ABI compatibility, and no need to disable it by default. diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index 16dbe00..bce152d 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -918,6 +918,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 */ -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/6] ethdev: add an field for querying hash key size 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 1/6] ethdev: add an field for querying hash key size Helin Zhang @ 2015-06-15 15:01 ` Thomas Monjalon 0 siblings, 0 replies; 29+ messages in thread From: Thomas Monjalon @ 2015-06-15 15:01 UTC (permalink / raw) To: nhorman; +Cc: dev 2015-06-12 15:33, Helin Zhang: > v3 changes: > * Moved the newly added element right after 'uint16_t reta_size', where it > was a padding. So it will not break any ABI compatibility, and no need to > disable it by default. [...] > @@ -918,6 +918,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 */ Neil, what is your opinion? Do you ack that this technique covers every ABI cases? ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v3 2/6] e1000: fill the hash key size 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 1/6] ethdev: add an field for querying hash key size Helin Zhang @ 2015-06-12 7:33 ` Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 3/6] fm10k: " Helin Zhang ` (4 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-12 7:33 UTC (permalink / raw) To: dev 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> --- drivers/net/e1000/igb_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. v3 changes: * As newly added element was put to a padding space, it will not break ABI compatibility, and no need to disable the code changes by default. diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index e4b370d..7d388f3 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -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) @@ -1377,6 +1379,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; -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v3 3/6] fm10k: fill the hash key size 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 1/6] ethdev: add an field for querying hash key size Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 2/6] e1000: fill the " Helin Zhang @ 2015-06-12 7:33 ` Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 4/6] i40e: " Helin Zhang ` (3 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-12 7:33 UTC (permalink / raw) To: dev 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> --- drivers/net/fm10k/fm10k_ethdev.c | 1 + 1 file changed, 1 insertion(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. v3 changes: * As newly added element was put to a padding space, it will not break ABI compatibility, and no need to disable the code changes by default. diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 87852ed..bd626ce 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -767,6 +767,7 @@ fm10k_dev_infos_get(struct rte_eth_dev *dev, DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM; dev_info->tx_offload_capa = 0; + 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) { -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v3 4/6] i40e: fill the hash key size 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang ` (2 preceding siblings ...) 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 3/6] fm10k: " Helin Zhang @ 2015-06-12 7:33 ` Helin Zhang 2015-06-12 7:34 ` [dpdk-dev] [PATCH v3 5/6] ixgbe: " Helin Zhang ` (2 subsequent siblings) 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-12 7:33 UTC (permalink / raw) To: dev 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> --- drivers/net/i40e/i40e_ethdev.c | 2 ++ drivers/net/i40e/i40e_ethdev_vf.c | 2 ++ 2 files changed, 4 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. v3 changes: * As newly added element was put to a padding space, it will not break ABI compatibility, and no need to disable the code changes by default. diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index da6c0b5..c699ddb 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -1540,6 +1540,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; diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index 4f4404e..f70d94c 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1670,6 +1670,8 @@ 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; -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v3 5/6] ixgbe: fill the hash key size 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang ` (3 preceding siblings ...) 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 4/6] i40e: " Helin Zhang @ 2015-06-12 7:34 ` Helin Zhang 2015-06-12 7:34 ` [dpdk-dev] [PATCH v3 6/6] app/testpmd: show " Helin Zhang 2015-06-12 9:31 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Ananyev, Konstantin 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-12 7:34 UTC (permalink / raw) To: dev 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> --- drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ 1 file changed, 3 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. v3 changes: * As newly added element was put to a padding space, it will not break ABI compatibility, and no need to disable the code changes by default. diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 0d9f9b2..588ccc0 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -116,6 +116,8 @@ #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); @@ -2052,6 +2054,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; } -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* [dpdk-dev] [PATCH v3 6/6] app/testpmd: show the hash key size 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang ` (4 preceding siblings ...) 2015-06-12 7:34 ` [dpdk-dev] [PATCH v3 5/6] ixgbe: " Helin Zhang @ 2015-06-12 7:34 ` Helin Zhang 2015-06-12 9:31 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Ananyev, Konstantin 6 siblings, 0 replies; 29+ messages in thread From: Helin Zhang @ 2015-06-12 7:34 UTC (permalink / raw) To: dev As querying hash key size in byte was supported, it can be shown in testpmd after getting the device information if not zero. Signed-off-by: Helin Zhang <helin.zhang@intel.com> --- app/test-pmd/config.c | 2 ++ 1 file changed, 2 insertions(+) v2 changes: * Disabled the code changes by default, to avoid breaking ABI compatibility. v3 changes: * As newly added element was put to a padding space, it will not break ABI compatibility, and no need to disable the code changes by default. diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index f788ed5..800756f 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -361,6 +361,8 @@ port_infos_display(portid_t port_id) memset(&dev_info, 0, sizeof(dev_info)); rte_eth_dev_info_get(port_id, &dev_info); + if (dev_info.hash_key_size > 0) + printf("Hash key size in bytes: %u\n", dev_info.hash_key_size); if (dev_info.reta_size > 0) printf("Redirection table size: %u\n", dev_info.reta_size); if (!dev_info.flow_type_rss_offloads) -- 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/6] query hash key size in byte 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang ` (5 preceding siblings ...) 2015-06-12 7:34 ` [dpdk-dev] [PATCH v3 6/6] app/testpmd: show " Helin Zhang @ 2015-06-12 9:31 ` Ananyev, Konstantin 2015-07-08 23:17 ` Thomas Monjalon 6 siblings, 1 reply; 29+ messages in thread From: Ananyev, Konstantin @ 2015-06-12 9:31 UTC (permalink / raw) To: Zhang, Helin, dev > -----Original Message----- > From: Zhang, Helin > Sent: Friday, June 12, 2015 8:34 AM > To: dev@dpdk.org > Cc: Cao, Min; Xu, Qian Q; Cao, Waterman; Ananyev, Konstantin; Zhang, Helin > Subject: [PATCH v3 0/6] query hash key size in byte > > As different hardware has different hash key sizes, querying it (in byte) > per port was asked by users. Otherwise there is no convenient way to know > the size of hash key which should be prepared. > > v2 changes: > * Disabled the code changes by default, to avoid breaking ABI compatibility. > > v3 changes: > * Moved the newly added element right after 'uint16_t reta_size', where it > was a padding. So it will not break any ABI compatibility, and no need to > disable the code changes by default. > > Helin Zhang (6): > ethdev: add an field for querying hash key size > e1000: fill the hash key size > fm10k: fill the hash key size > i40e: fill the hash key size > ixgbe: fill the hash key size > app/testpmd: show the hash key size > > app/test-pmd/config.c | 2 ++ > drivers/net/e1000/igb_ethdev.c | 3 +++ > drivers/net/fm10k/fm10k_ethdev.c | 1 + > drivers/net/i40e/i40e_ethdev.c | 2 ++ > drivers/net/i40e/i40e_ethdev_vf.c | 2 ++ > drivers/net/ixgbe/ixgbe_ethdev.c | 3 +++ > lib/librte_ether/rte_ethdev.h | 1 + > 7 files changed, 14 insertions(+) > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> > -- > 1.9.3 ^ permalink raw reply [flat|nested] 29+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/6] query hash key size in byte 2015-06-12 9:31 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Ananyev, Konstantin @ 2015-07-08 23:17 ` Thomas Monjalon 0 siblings, 0 replies; 29+ messages in thread From: Thomas Monjalon @ 2015-07-08 23:17 UTC (permalink / raw) To: Zhang, Helin; +Cc: dev > > As different hardware has different hash key sizes, querying it (in byte) > > per port was asked by users. Otherwise there is no convenient way to know > > the size of hash key which should be prepared. > > > > v2 changes: > > * Disabled the code changes by default, to avoid breaking ABI compatibility. > > > > v3 changes: > > * Moved the newly added element right after 'uint16_t reta_size', where it > > was a padding. So it will not break any ABI compatibility, and no need to > > disable the code changes by default. > > > > Helin Zhang (6): > > ethdev: add an field for querying hash key size > > e1000: fill the hash key size > > fm10k: fill the hash key size > > i40e: fill the hash key size > > ixgbe: fill the hash key size > > app/testpmd: show the hash key size > > Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com> Applied, thanks It is assumed that inserting a new field in a padding alignment won't break the ABI. ^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2015-07-08 23:18 UTC | newest] Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2015-06-04 1:00 [dpdk-dev] [PATCH 0/6] query hash key size in byte Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 1/6] ethdev: add an field for querying hash key size Helin Zhang 2015-06-04 13:05 ` Neil Horman 2015-06-05 6:21 ` Zhang, Helin 2015-06-05 10:30 ` Neil Horman 2015-06-04 1:00 ` [dpdk-dev] [PATCH 2/6] e1000: fill the " Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 3/6] fm10k: " Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 4/6] i40e: " Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 5/6] ixgbe: " Helin Zhang 2015-06-04 1:00 ` [dpdk-dev] [PATCH 6/6] app/testpmd: show " Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 0/6] query hash key size in byte Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 1/6] ethdev: add an field for querying hash key size Helin Zhang 2015-06-04 10:38 ` Ananyev, Konstantin 2015-06-12 6:06 ` Zhang, Helin 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 2/6] e1000: fill the " Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 3/6] fm10k: " Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 4/6] i40e: " Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 5/6] ixgbe: " Helin Zhang 2015-06-04 7:33 ` [dpdk-dev] [PATCH v2 6/6] app/testpmd: show " Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 1/6] ethdev: add an field for querying hash key size Helin Zhang 2015-06-15 15:01 ` Thomas Monjalon 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 2/6] e1000: fill the " Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 3/6] fm10k: " Helin Zhang 2015-06-12 7:33 ` [dpdk-dev] [PATCH v3 4/6] i40e: " Helin Zhang 2015-06-12 7:34 ` [dpdk-dev] [PATCH v3 5/6] ixgbe: " Helin Zhang 2015-06-12 7:34 ` [dpdk-dev] [PATCH v3 6/6] app/testpmd: show " Helin Zhang 2015-06-12 9:31 ` [dpdk-dev] [PATCH v3 0/6] query hash key size in byte Ananyev, Konstantin 2015-07-08 23:17 ` Thomas Monjalon
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).