[dpdk-dev] net/bnxt: add missing ids in xstats
Checks
Commit Message
The xstats api expects that the driver fills both values and ids for each
filled entries.
Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
Signed-off-by: David Marchand <david.marchand@6wind.com>
---
drivers/net/bnxt/bnxt_stats.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On Wed, Jun 6, 2018 at 10:36 PM, David Marchand <david.marchand@6wind.com>
wrote:
> The xstats api expects that the driver fills both values and ids for each
> filled entries.
>
> Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
>
> Signed-off-by: David Marchand <david.marchand@6wind.com>
>
Acked-by:
Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> drivers/net/bnxt/bnxt_stats.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/bnxt/bnxt_stats.c b/drivers/net/bnxt/bnxt_stats.c
> index bbd4e78..a5d3c86 100644
> --- a/drivers/net/bnxt/bnxt_stats.c
> +++ b/drivers/net/bnxt/bnxt_stats.c
> @@ -278,6 +278,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
> count = 0;
> for (i = 0; i < RTE_DIM(bnxt_rx_stats_strings); i++) {
> uint64_t *rx_stats = (uint64_t *)bp->hw_rx_port_stats;
> + xstats[count].id = count;
> xstats[count].value = rte_le_to_cpu_64(
> *(uint64_t *)((char *)rx_stats +
> bnxt_rx_stats_strings[i].offset));
> @@ -286,6 +287,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
>
> for (i = 0; i < RTE_DIM(bnxt_tx_stats_strings); i++) {
> uint64_t *tx_stats = (uint64_t *)bp->hw_tx_port_stats;
> + xstats[count].id = count;
> xstats[count].value = rte_le_to_cpu_64(
> *(uint64_t *)((char *)tx_stats +
> bnxt_tx_stats_strings[i].offset));
> @@ -293,6 +295,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
> }
>
> /* The Tx drop pkts aka the Anti spoof coounter */
> + xstats[count].id = count;
> xstats[count].value = rte_le_to_cpu_64(tx_drop_pkts);
> count++;
>
> --
> 2.7.4
>
>
On 6/7/2018 10:34 PM, Ajit Khaparde wrote:
> On Wed, Jun 6, 2018 at 10:36 PM, David Marchand <david.marchand@6wind.com>
> wrote:
>
>> The xstats api expects that the driver fills both values and ids for each
>> filled entries.
>>
>> Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
>>
>> Signed-off-by: David Marchand <david.marchand@6wind.com>
>>
>
> Acked-by:
> Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: stable@dpdk.org ?
Shouldn't this needs to be backported to stable trees?
On 6/8/2018 8:57 PM, Ferruh Yigit wrote:
> On 6/7/2018 10:34 PM, Ajit Khaparde wrote:
>> On Wed, Jun 6, 2018 at 10:36 PM, David Marchand <david.marchand@6wind.com>
>> wrote:
>>
>>> The xstats api expects that the driver fills both values and ids for each
>>> filled entries.
>>>
>>> Fixes: bfb9c2260be2 ("net/bnxt: support xstats get/reset")
>>>
>>> Signed-off-by: David Marchand <david.marchand@6wind.com>
>>>
>>
>> Acked-by:
>> Ajit Khaparde <ajit.khaparde@broadcom.com>
>
> Cc: stable@dpdk.org ?
>
> Shouldn't this needs to be backported to stable trees?
Applied to dpdk-next-net/master, thanks.
(Added Cc: stable@dpdk.org)
@@ -278,6 +278,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
count = 0;
for (i = 0; i < RTE_DIM(bnxt_rx_stats_strings); i++) {
uint64_t *rx_stats = (uint64_t *)bp->hw_rx_port_stats;
+ xstats[count].id = count;
xstats[count].value = rte_le_to_cpu_64(
*(uint64_t *)((char *)rx_stats +
bnxt_rx_stats_strings[i].offset));
@@ -286,6 +287,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
for (i = 0; i < RTE_DIM(bnxt_tx_stats_strings); i++) {
uint64_t *tx_stats = (uint64_t *)bp->hw_tx_port_stats;
+ xstats[count].id = count;
xstats[count].value = rte_le_to_cpu_64(
*(uint64_t *)((char *)tx_stats +
bnxt_tx_stats_strings[i].offset));
@@ -293,6 +295,7 @@ int bnxt_dev_xstats_get_op(struct rte_eth_dev *eth_dev,
}
/* The Tx drop pkts aka the Anti spoof coounter */
+ xstats[count].id = count;
xstats[count].value = rte_le_to_cpu_64(tx_drop_pkts);
count++;