Commit Graph

13 Commits

Author SHA1 Message Date
Ajit Khaparde
472193a710 net/bnxt: maintain mbuf alloc failure counter per queue
Currently we have a single counter for mbuf alloc failure.
Make it per RxQ instead.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-04-27 15:54:56 +01:00
Scott Branden
fd710bb1f6 net/bnxt: convert to SPDX license tag
Update the license header on bnxt files to be the standard
BSD-3-Clause license used for the rest of DPDK,
bring the files in compliance with the DPDK licensing policy.

Signed-off-by: Scott Branden <scott.branden@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
2018-04-14 00:40:21 +02:00
Ajit Khaparde
3e92fd4e4e net/bnxt: use dynamic log type
This patch implements driver specific log type doing away with
usage of RTE_LOG() for logging.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-29 10:04:28 +01:00
Ajit Khaparde
ed2ced6fe9 net/bnxt: check initialization before accessing stats
Maintain state of PMD initialization and check it before checking stats.
In certain cases, we might end up accessing stats before the required
HWRM commands are processed by FW.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-16 18:47:49 +01:00
Ajit Khaparde
ff947c6ce1 net/bnxt: add check for multi host PF per port
Certain SKUs of NIC can support features like NPAR, Multi Host PFs per
port.  We need to check for such features in order to restrict certain
HWRM commands from being sent to the FW.

For the single PF per port model, allow commands like hwrm_port_phy_cfg
from the PF driver. In NPAR and MH environments with multiple PFs per
port, we should not allow HWRM commands like hwrm_port_phy_cfg to be
sent to the FW.

This patch takes care of that.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2018-01-16 18:47:49 +01:00
Matan Azrad
d5b0924ba6 ethdev: add return value to stats get dev op
The stats_get dev op API doesn't include return value, so PMD cannot
return an error in case of failure at stats getting process time.

Since PCI devices can be removed and there is a time between the
physical removal to the RMV interrupt, the user may get invalid stats
without any indication.

This patch changes the stats_get API return value to be int instead of
void.

All the net PMDs stats_get dev ops are adjusted by this patch.

Signed-off-by: Matan Azrad <matan@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
2017-10-12 01:52:49 +01:00
Ajit Khaparde
86ff87b0ed net/bnxt: fix per queue stats display in xstats
While gathering per queue stats, we are overwriting some of the
stats. This causes some of the counters in xstats to be incorrect.

Fixes: 577d3dced0 ("net/bnxt: refactor the query stats")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
8892013668 net/bnxt: support xstats get by id
This patch adds support for xstats_get_by_id/xstats_get_names_by_id.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-10-06 02:49:49 +02:00
Ajit Khaparde
dd46c6bbd5 net/bnxt: support get and clear VF specific stats
This patch adds code to get and clear VF stats.

It also adds the necessary HWRM structures to send the command
to the firmware.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
577d3dced0 net/bnxt: refactor the query stats
1) Use hwrm_stat_ctx_query command to query statistics
   Using hwrm_stat_ctx_query command will allow polling
   the statistics from hardware instead of using the current push
   model from the hardware which does a DMA of the stats to the host
   at fixed intervals.

2) Use the rx_mbuf_alloc_fail to track mbuf alloc failures.

3) We were wrongly incrementing hwrm_cmd_seq in bnxt_hwrm_stat_clear
   and bnxt_hwrm_stat_ctx_alloc functions.  This patch fixes that.

Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
bfb9c2260b net/bnxt: support xstats get/reset
This patch adds support to get and reset xstats dev_ops

dev_ops added:
xstats_get, xstats_get_name, xstats_reset

HWRM commands added:
hwrm_port_qstats, hwrm_port_clr_stats

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2017-06-12 10:41:28 +01:00
Ajit Khaparde
eba852e23e net/bnxt: refactor for 1.5.1 HWRM API
Update the PMD to use the 1.5.1 HWRM API.
Most of the changes in this patch and the following patches are
white spaces and rearrangement of the lines - hopefully a onetime change
owing to the usage of a different auto generated file.

Other than that, the following fields have been renamed:
1) rx_err_pkts and tx_err_pkts are now rx_discard_pkts and tx_discard_pkts
in struct ctx_hw_stats64
2) the perm_mac_addr field in the response of bnxt_hwrm_func_qcaps has
changed to mac_addr.

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
2016-09-30 12:27:18 +02:00
Ajit Khaparde
57d5e5bc86 net/bnxt: add statistics
Add the bnxt_stats_get_op() and bnxt_stats_reset_op() dev_ops to
get and reset statistics. It also brings in the associated HWRM calls
to handle the requests appropriately.

We also have the bnxt_free_stats() function which will be used in the
follow on patches to free the memory allocated by the driver for
statistics.

New HWRM calls:
bnxt_hwrm_stat_clear:
	This command clears statistics of a context

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Reviewed-by: David Christensen <david.christensen@broadcom.com>
2016-06-20 17:21:51 +02:00