All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shannon Nelson <snelson@pensando.io>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: Shannon Nelson <snelson@pensando.io>
Subject: [PATCH net-next 4/9] ionic: add event queue definitions to hw interface
Date: Sun, 16 Feb 2020 15:11:53 -0800	[thread overview]
Message-ID: <20200216231158.5678-5-snelson@pensando.io> (raw)
In-Reply-To: <20200216231158.5678-1-snelson@pensando.io>

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 --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;
-- 
2.17.1


  parent reply	other threads:[~2020-02-16 23:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-16 23:11 [PATCH net-next 0/9] ionic: Add support for Event Queues Shannon Nelson
2020-02-16 23:11 ` [PATCH net-next 1/9] ionic: change param from lif to ionic Shannon Nelson
2020-02-16 23:11 ` [PATCH net-next 2/9] ionic: rename rdma eqs field Shannon Nelson
2020-02-16 23:11 ` [PATCH net-next 3/9] ionic: replace lif list with xarray Shannon Nelson
2020-02-16 23:11 ` Shannon Nelson [this message]
2020-02-16 23:11 ` [PATCH net-next 5/9] ionic: rename napi irq functions Shannon Nelson
2020-02-16 23:11 ` [PATCH net-next 6/9] ionic: add functions for setup and tear down event queues Shannon Nelson
2020-02-16 23:11 ` [PATCH net-next 7/9] ionic: add q ident query for eq Shannon Nelson
2020-02-16 23:11 ` [PATCH net-next 8/9] ionic: add basic eq support Shannon Nelson
2020-02-16 23:11 ` [PATCH net-next 9/9] ionic: keep ionic dev on lif init fail Shannon Nelson
2020-02-17  4:11 ` [PATCH net-next 0/9] ionic: Add support for Event Queues David Miller
2020-02-17  6:55   ` Shannon Nelson
2020-02-17 22:03     ` David Miller
2020-02-18 16:16       ` Shannon Nelson
2020-02-18 20:33         ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200216231158.5678-5-snelson@pensando.io \
    --to=snelson@pensando.io \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.