net/bnxt: add statistics
[dpdk.git] / drivers / net / bnxt / hsi_struct_def_dpdk.h
index bbec5bb..91a83d1 100644 (file)
 #ifndef _HSI_STRUCT_DEF_EXTERNAL_H_
 #define _HSI_STRUCT_DEF_EXTERNAL_H_
 
+/*
+ * per-context HW statistics -- chip view
+ */
+
+struct ctx_hw_stats64 {
+       uint64_t rx_ucast_pkts;
+       uint64_t rx_mcast_pkts;
+       uint64_t rx_bcast_pkts;
+       uint64_t rx_drop_pkts;
+       uint64_t rx_err_pkts;
+       uint64_t rx_ucast_bytes;
+       uint64_t rx_mcast_bytes;
+       uint64_t rx_bcast_bytes;
+
+       uint64_t tx_ucast_pkts;
+       uint64_t tx_mcast_pkts;
+       uint64_t tx_bcast_pkts;
+       uint64_t tx_drop_pkts;
+       uint64_t tx_err_pkts;
+       uint64_t tx_ucast_bytes;
+       uint64_t tx_mcast_bytes;
+       uint64_t tx_bcast_bytes;
+
+       uint64_t tpa_pkts;
+       uint64_t tpa_bytes;
+       uint64_t tpa_events;
+       uint64_t tpa_aborts;
+} ctx_hw_stats64_t;
+
 /* HW Resource Manager Specification 1.2.0 */
 #define HWRM_VERSION_MAJOR     1
 #define HWRM_VERSION_MINOR     2
@@ -63,6 +92,7 @@
 #define HWRM_CFA_L2_FILTER_FREE                (UINT32_C(0x91))
 #define HWRM_CFA_L2_FILTER_CFG         (UINT32_C(0x92))
 #define HWRM_CFA_L2_SET_RX_MASK                (UINT32_C(0x93))
+#define HWRM_STAT_CTX_CLR_STATS                (UINT32_C(0xb3))
 #define HWRM_EXEC_FWD_RESP             (UINT32_C(0xd0))
 
 /* Return Codes */
@@ -1897,6 +1927,83 @@ struct hwrm_queue_qportcfg_input {
        uint16_t unused_0;
 } __attribute__((packed));
 
+/* hwrm_stat_ctx_clr_stats */
+/* Description: This command clears statistics of a context. */
+
+/* Input (24 bytes) */
+struct hwrm_stat_ctx_clr_stats_input {
+       /*
+        * This value indicates what type of request this is. The format for the
+        * rest of the command is determined by this field.
+        */
+       uint16_t req_type;
+
+       /*
+        * This value indicates the what completion ring the request will be
+        * optionally completed on. If the value is -1, then no CR completion
+        * will be generated. Any other value must be a valid CR ring_id value
+        * for this function.
+        */
+       uint16_t cmpl_ring;
+
+       /* This value indicates the command sequence number. */
+       uint16_t seq_id;
+
+       /*
+        * Target ID of this command. 0x0 - 0xFFF8 - Used for function ids
+        * 0xFFF8 - 0xFFFE - Reserved for internal processors 0xFFFF - HWRM
+        */
+       uint16_t target_id;
+
+       /*
+        * This is the host address where the response will be written when the
+        * request is complete. This area must be 16B aligned and must be
+        * cleared to zero before the request is made.
+        */
+       uint64_t resp_addr;
+
+       /* ID of the statistics context that is being queried. */
+       uint32_t stat_ctx_id;
+
+       uint32_t unused_0;
+} __attribute__((packed));
+
+/* Output (16 bytes) */
+struct hwrm_stat_ctx_clr_stats_output {
+       /*
+        * Pass/Fail or error type Note: receiver to verify the in parameters,
+        * and fail the call with an error when appropriate
+        */
+       uint16_t error_code;
+
+       /* This field returns the type of original request. */
+       uint16_t req_type;
+
+       /* This field provides original sequence number of the command. */
+       uint16_t seq_id;
+
+       /*
+        * This field is the length of the response in bytes. The last byte of
+        * the response is a valid flag that will read as '1' when the command
+        * has been completely written to memory.
+        */
+       uint16_t resp_len;
+
+       uint32_t unused_0;
+       uint8_t unused_1;
+       uint8_t unused_2;
+       uint8_t unused_3;
+
+       /*
+        * This field is used in Output records to indicate that the output is
+        * completely written to RAM. This field should be read as '1' to
+        * indicate that the output has been completely written. When writing a
+        * command completion or response to an internal processor, the order of
+        * writes has to be such that this field is written last.
+        */
+       uint8_t valid;
+} __attribute__((packed));
+
 /* hwrm_vnic_rss_cfg */
 /* Description: This function is used to enable RSS configuration. */