{
struct lio_device *lio_dev = LIO_DEV(eth_dev);
struct lio_droq_stats *oq_stats;
+ struct lio_iq_stats *iq_stats;
+ struct lio_instr_queue *txq;
struct lio_droq *droq;
+ int i, iq_no, oq_no;
uint64_t bytes = 0;
uint64_t pkts = 0;
uint64_t drop = 0;
- int i, oq_no;
+
+ for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
+ iq_no = lio_dev->linfo.txpciq[i].s.q_no;
+ txq = lio_dev->instr_queue[iq_no];
+ if (txq != NULL) {
+ iq_stats = &txq->stats;
+ pkts += iq_stats->tx_done;
+ drop += iq_stats->tx_dropped;
+ bytes += iq_stats->tx_tot_bytes;
+ }
+ }
+
+ stats->opackets = pkts;
+ stats->obytes = bytes;
+ stats->oerrors = drop;
+
+ pkts = 0;
+ drop = 0;
+ bytes = 0;
for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
oq_no = lio_dev->linfo.rxpciq[i].s.q_no;
{
struct lio_device *lio_dev = LIO_DEV(eth_dev);
struct lio_droq_stats *oq_stats;
+ struct lio_iq_stats *iq_stats;
+ struct lio_instr_queue *txq;
struct lio_droq *droq;
- int i, oq_no;
+ int i, iq_no, oq_no;
+
+ for (i = 0; i < eth_dev->data->nb_tx_queues; i++) {
+ iq_no = lio_dev->linfo.txpciq[i].s.q_no;
+ txq = lio_dev->instr_queue[iq_no];
+ if (txq != NULL) {
+ iq_stats = &txq->stats;
+ memset(iq_stats, 0, sizeof(struct lio_iq_stats));
+ }
+ }
for (i = 0; i < eth_dev->data->nb_rx_queues; i++) {
oq_no = lio_dev->linfo.rxpciq[i].s.q_no;
inst_processed = lio_process_iq_request_list(lio_dev, iq);
- if (inst_processed)
+ if (inst_processed) {
rte_atomic64_sub(&iq->instr_pending, inst_processed);
+ iq->stats.instr_processed += inst_processed;
+ }
tot_inst_processed += inst_processed;
inst_processed = 0;
static int
lio_send_command(struct lio_device *lio_dev, uint32_t iq_no, void *cmd,
- void *buf, uint32_t datasize __rte_unused, uint32_t reqtype)
+ void *buf, uint32_t datasize, uint32_t reqtype)
{
struct lio_instr_queue *iq = lio_dev->instr_queue[iq_no];
struct lio_iq_post_status st;
if (st.status != LIO_IQ_SEND_FAILED) {
lio_add_to_request_list(iq, st.index, buf, reqtype);
+ LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, bytes_sent,
+ datasize);
+ LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, instr_posted, 1);
+
lio_ring_doorbell(lio_dev, iq);
+ } else {
+ LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, instr_dropped, 1);
}
rte_spinlock_unlock(&iq->post_lock);
struct lio_instr_queue *txq = tx_queue;
union lio_cmd_setup cmdsetup;
struct lio_device *lio_dev;
+ struct lio_iq_stats *stats;
struct lio_data_pkt ndata;
int i, processed = 0;
struct rte_mbuf *m;
lio_dev = txq->lio_dev;
iq_no = txq->txpciq.s.q_no;
+ stats = &lio_dev->instr_queue[iq_no]->stats;
if (!lio_dev->intf_open || !lio_dev->linfo.link.s.link_up) {
PMD_TX_LOG(lio_dev, ERR, "Transmit failed link_status : %d\n",
ndata.q_no = iq_no;
if (lio_iq_is_full(lio_dev, ndata.q_no)) {
+ stats->tx_iq_busy++;
if (lio_dev_cleanup_iq(lio_dev, iq_no)) {
PMD_TX_LOG(lio_dev, ERR,
"Transmit failed iq:%d full\n",
lio_dev_cleanup_iq(lio_dev, iq_no);
}
+ stats->tx_done++;
+ stats->tx_tot_bytes += pkt_len;
processed++;
}
xmit_failed:
+ stats->tx_dropped += (nb_pkts - processed);
return processed;
}
*/
int lio_process_ordered_list(struct lio_device *lio_dev);
+#define LIO_INCR_INSTRQUEUE_PKT_COUNT(lio_dev, iq_no, field, count) \
+ (((lio_dev)->instr_queue[iq_no]->stats.field) += count)
+
static inline void
lio_swap_8B_data(uint64_t *data, uint32_t blocks)
{
uint16_t reserved;
};
+/** Input Queue statistics. Each input queue has four stats fields. */
+struct lio_iq_stats {
+ uint64_t instr_posted; /**< Instructions posted to this queue. */
+ uint64_t instr_processed; /**< Instructions processed in this queue. */
+ uint64_t instr_dropped; /**< Instructions that could not be processed */
+ uint64_t bytes_sent; /**< Bytes sent through this queue. */
+ uint64_t tx_done; /**< Num of packets sent to network. */
+ uint64_t tx_iq_busy; /**< Num of times this iq was found to be full. */
+ uint64_t tx_dropped; /**< Num of pkts dropped due to xmitpath errors. */
+ uint64_t tx_tot_bytes; /**< Total count of bytes sent to network. */
+};
+
/** Output Queue statistics. Each output queue has four stats fields. */
struct lio_droq_stats {
/** Number of packets received in this queue. */
/** Number of instructions pending to be posted to Octeon. */
uint32_t fill_cnt;
+ /** Statistics for this input queue. */
+ struct lio_iq_stats stats;
+
/** DMA mapped base address of the input descriptor ring. */
uint64_t base_addr_dma;