diff mbox series

[net-next,4/9] ionic: add event queue definitions to hw interface

Message ID 20200216231158.5678-5-snelson@pensando.io
State Rejected
Delegated to: David Miller
Headers show
Series ionic: Add support for Event Queues | expand

Commit Message

Shannon Nelson Feb. 16, 2020, 11:11 p.m. UTC
Define the hw interface and driver structures for the Event
Queue operations.

Signed-off-by: Shannon Nelson <snelson@pensando.io>
---
 drivers/net/ethernet/pensando/ionic/ionic.h   |  2 ++
 .../net/ethernet/pensando/ionic/ionic_dev.h   | 22 +++++++++++++++++
 .../net/ethernet/pensando/ionic/ionic_if.h    | 24 +++++++++++++++++++
 3 files changed, 48 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/pensando/ionic/ionic.h b/drivers/net/ethernet/pensando/ionic/ionic.h
index e5a2a44d9308..faf2b748bd20 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic.h
@@ -47,6 +47,8 @@  struct ionic {
 	struct ionic_identity ident;
 	struct xarray lifs;
 	struct ionic_lif *master_lif;
+	struct ionic_eq **eqs;
+	unsigned int neth_eqs;
 	unsigned int nnqs_per_lif;
 	unsigned int nrdma_eqs_per_lif;
 	unsigned int ntxqs_per_lif;
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_dev.h b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
index 7838e342c4fd..d40be30536ae 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_dev.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_dev.h
@@ -232,6 +232,28 @@  struct ionic_cq {
 	unsigned int desc_size;
 };
 
+struct ionic_eq_ring {
+	struct ionic_eq_comp *base;
+	dma_addr_t base_pa;
+
+	int index;
+	u8 gen_color;	/* generation counter */
+};
+
+struct ionic_eq {
+	struct ionic *ionic;
+	struct ionic_eq_ring ring[2];
+	struct ionic_intr_info intr;
+
+	int index;
+	int depth;
+
+	bool is_init;
+};
+
+#define IONIC_EQ_DEPTH		0x1000
+#define IONIC_MAX_ETH_EQS	64
+
 struct ionic;
 
 static inline void ionic_intr_init(struct ionic_dev *idev,
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h
index ce07c2931a72..72a4c0448afc 100644
--- a/drivers/net/ethernet/pensando/ionic/ionic_if.h
+++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h
@@ -277,6 +277,7 @@  union ionic_dev_identity {
 		__le32 ndbpgs_per_lif;
 		__le32 intr_coal_mult;
 		__le32 intr_coal_div;
+		__le32 eq_count;
 	};
 	__le32 words[512];
 };
@@ -2392,6 +2393,7 @@  union ionic_dev_cmd {
 	struct ionic_qos_reset_cmd qos_reset;
 
 	struct ionic_q_init_cmd q_init;
+	struct ionic_q_control_cmd q_control;
 };
 
 union ionic_dev_cmd_comp {
@@ -2565,6 +2567,28 @@  union ionic_notifyq_comp {
 	struct ionic_log_event log;
 };
 
+/**
+ * struct ionic_eq_comp - Event queue completion descriptor
+ *
+ * @code:  Event code, see enum ionic_eq_comp_code.
+ * @lif_index: To which lif the event pertains.
+ * @qid:   To which queue id the event pertains.
+ * @gen_color: Event queue wrap counter, init 1, incr each wrap.
+ */
+struct ionic_eq_comp {
+	__le16 code;
+	__le16 lif_index;
+	__le32 qid;
+	u8 rsvd[7];
+	u8 gen_color;
+};
+
+enum ionic_eq_comp_code {
+	IONIC_EQ_COMP_CODE_NONE = 0,
+	IONIC_EQ_COMP_CODE_RX_COMP = 1,
+	IONIC_EQ_COMP_CODE_TX_COMP = 2,
+};
+
 /* Deprecate */
 struct ionic_identity {
 	union ionic_drv_identity drv;