net/sfc: add simple port representor statistics
[dpdk.git] / drivers / net / sfc / sfc_ev.h
index 590cfb1..a4ababc 100644 (file)
@@ -110,6 +110,22 @@ sfc_counters_rxq_sw_index(const struct sfc_adapter_shared *sas)
        return sas->counters_rxq_allocated ? 0 : SFC_SW_INDEX_INVALID;
 }
 
+static inline sfc_sw_index_t
+sfc_repr_rxq_sw_index(const struct sfc_adapter_shared *sas,
+                     unsigned int repr_queue_id)
+{
+       return sfc_counters_rxq_sw_index(sas) + sfc_repr_nb_rxq(sas) +
+               repr_queue_id;
+}
+
+static inline sfc_sw_index_t
+sfc_repr_txq_sw_index(const struct sfc_adapter_shared *sas,
+                     unsigned int repr_queue_id)
+{
+       /* Reserved TxQ for representors is the first reserved TxQ */
+       return sfc_repr_available(sas) ? repr_queue_id : SFC_SW_INDEX_INVALID;
+}
+
 /*
  * Functions below define event queue to transmit/receive queue and vice
  * versa mapping.