net/bnxt: support get and clear VF specific stats
[dpdk.git] / drivers / net / bnxt / bnxt_hwrm.c
index f143541..6ea31ca 100644 (file)
@@ -1237,6 +1237,27 @@ int bnxt_hwrm_func_vf_mac(struct bnxt *bp, uint16_t vf, const uint8_t *mac_addr)
        return rc;
 }
 
+int bnxt_hwrm_func_qstats_tx_drop(struct bnxt *bp, uint16_t fid,
+                                 uint64_t *dropped)
+{
+       int rc = 0;
+       struct hwrm_func_qstats_input req = {.req_type = 0};
+       struct hwrm_func_qstats_output *resp = bp->hwrm_cmd_resp_addr;
+
+       HWRM_PREP(req, FUNC_QSTATS, -1, resp);
+
+       req.fid = rte_cpu_to_le_16(fid);
+
+       rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
+
+       HWRM_CHECK_RESULT;
+
+       if (dropped)
+               *dropped = rte_le_to_cpu_64(resp->tx_drop_pkts);
+
+       return rc;
+}
+
 int bnxt_hwrm_func_qstats(struct bnxt *bp, uint16_t fid,
                          struct rte_eth_stats *stats)
 {
@@ -1274,6 +1295,23 @@ int bnxt_hwrm_func_qstats(struct bnxt *bp, uint16_t fid,
        return rc;
 }
 
+int bnxt_hwrm_func_clr_stats(struct bnxt *bp, uint16_t fid)
+{
+       int rc = 0;
+       struct hwrm_func_clr_stats_input req = {.req_type = 0};
+       struct hwrm_func_clr_stats_output *resp = bp->hwrm_cmd_resp_addr;
+
+       HWRM_PREP(req, FUNC_CLR_STATS, -1, resp);
+
+       req.fid = rte_cpu_to_le_16(fid);
+
+       rc = bnxt_hwrm_send_message(bp, &req, sizeof(req));
+
+       HWRM_CHECK_RESULT;
+
+       return rc;
+}
+
 /*
  * HWRM utility functions
  */