DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 03/14] net/sfc: add dedicated header file with MCDI interface
Date: Tue, 8 Sep 2020 10:14:24 +0100	[thread overview]
Message-ID: <1599556475-27820-5-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1599556475-27820-1-git-send-email-arybchenko@solarflare.com>

MCDI helpers will be shared by net and vDPA drivers.
Prepare to move it to common/sfc_efx.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Reviewed-by: Andy Moreton <amoreton@xilinx.com>
---
 drivers/net/sfc/sfc.h      | 23 +---------------
 drivers/net/sfc/sfc_mcdi.c |  1 +
 drivers/net/sfc/sfc_mcdi.h | 54 ++++++++++++++++++++++++++++++++++++++
 3 files changed, 56 insertions(+), 22 deletions(-)
 create mode 100644 drivers/net/sfc/sfc_mcdi.h

diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h
index cdff9be3ec..a530b12a8e 100644
--- a/drivers/net/sfc/sfc.h
+++ b/drivers/net/sfc/sfc.h
@@ -23,6 +23,7 @@
 
 #include "sfc_debug.h"
 #include "sfc_filter.h"
+#include "sfc_mcdi.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -86,25 +87,6 @@ enum sfc_dev_filter_mode {
 	SFC_DEV_FILTER_NMODES
 };
 
-enum sfc_mcdi_state {
-	SFC_MCDI_UNINITIALIZED = 0,
-	SFC_MCDI_INITIALIZED,
-	SFC_MCDI_BUSY,
-	SFC_MCDI_COMPLETED,
-
-	SFC_MCDI_NSTATES
-};
-
-struct sfc_mcdi {
-	rte_spinlock_t			lock;
-	efsys_mem_t			mem;
-	enum sfc_mcdi_state		state;
-	efx_mcdi_transport_t		transport;
-	uint32_t			logtype;
-	uint32_t			proxy_handle;
-	efx_rc_t			proxy_result;
-};
-
 struct sfc_intr {
 	efx_intr_type_t			type;
 	rte_intr_callback_fn		handler;
@@ -384,9 +366,6 @@ void sfc_stop(struct sfc_adapter *sa);
 
 void sfc_schedule_restart(struct sfc_adapter *sa);
 
-int sfc_mcdi_init(struct sfc_adapter *sa);
-void sfc_mcdi_fini(struct sfc_adapter *sa);
-
 int sfc_configure(struct sfc_adapter *sa);
 void sfc_close(struct sfc_adapter *sa);
 
diff --git a/drivers/net/sfc/sfc_mcdi.c b/drivers/net/sfc/sfc_mcdi.c
index ec62ba95ff..9a51b3e030 100644
--- a/drivers/net/sfc/sfc_mcdi.c
+++ b/drivers/net/sfc/sfc_mcdi.c
@@ -13,6 +13,7 @@
 #include "efx_mcdi.h"
 #include "efx_regs_mcdi.h"
 
+#include "sfc_mcdi.h"
 #include "sfc.h"
 #include "sfc_debug.h"
 #include "sfc_log.h"
diff --git a/drivers/net/sfc/sfc_mcdi.h b/drivers/net/sfc/sfc_mcdi.h
new file mode 100644
index 0000000000..789a16d8bb
--- /dev/null
+++ b/drivers/net/sfc/sfc_mcdi.h
@@ -0,0 +1,54 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright(c) 2019-2020 Xilinx, Inc.
+ * Copyright(c) 2016-2019 Solarflare Communications Inc.
+ *
+ * This software was jointly developed between OKTET Labs (under contract
+ * for Solarflare) and Solarflare Communications, Inc.
+ */
+
+#ifndef _SFC_MCDI_H
+#define _SFC_MCDI_H
+
+#include <stdint.h>
+
+#include <rte_spinlock.h>
+
+#include "efsys.h"
+#include "efx.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum sfc_mcdi_state {
+	SFC_MCDI_UNINITIALIZED = 0,
+	SFC_MCDI_INITIALIZED,
+	SFC_MCDI_BUSY,
+	SFC_MCDI_COMPLETED,
+
+	SFC_MCDI_NSTATES
+};
+
+struct sfc_mcdi {
+	rte_spinlock_t			lock;
+	efsys_mem_t			mem;
+	enum sfc_mcdi_state		state;
+	efx_mcdi_transport_t		transport;
+	uint32_t			logtype;
+	uint32_t			proxy_handle;
+	efx_rc_t			proxy_result;
+};
+
+
+struct sfc_adapter;
+
+int sfc_mcdi_init(struct sfc_adapter *sa);
+void sfc_mcdi_fini(struct sfc_adapter *sa);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif  /* _SFC_MCDI_H */
-- 
2.17.1


  parent reply	other threads:[~2020-09-08  9:17 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  9:14 [dpdk-dev] [PATCH 00/14] net/sfc: factor out common driver library Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 01/14] net/iavf: downgrade error log Andrew Rybchenko
2020-09-08  9:26   ` Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 01/14] net/sfc: include header with debug helpers directly Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 02/14] net/sfc: introduce common driver library Andrew Rybchenko
2020-09-08  9:14 ` Andrew Rybchenko [this message]
2020-09-08  9:14 ` [dpdk-dev] [PATCH 04/14] net/sfc: move MCDI helper interface to dedicated namespace Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 05/14] net/sfc: make MCDI logging helper macros local Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 06/14] net/sfc: start to make MCDI helpers interface shareable Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 07/14] net/sfc: use own logging helper macros Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 08/14] net/sfc: avoid usage of NIC pointer from adapter context Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 09/14] net/sfc: avoid panic in the case of MCDI timeout Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 10/14] net/sfc: add MCDI callbacks to allocate/free DMA memory Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 11/14] net/sfc: add MCDI callback to schedule restart Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 12/14] net/sfc: add MCDI callback to poll management event queue Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 13/14] net/sfc: use MCDI control structure as libefx ops context Andrew Rybchenko
2020-09-08  9:14 ` [dpdk-dev] [PATCH 14/14] net/sfc: move MCDI helpers to common driver Andrew Rybchenko
2020-09-09 14:32 ` [dpdk-dev] [PATCH 00/14] net/sfc: factor out common driver library Ferruh Yigit
2020-09-17  6:21   ` Andrew Rybchenko
2020-09-17  6:34 ` [dpdk-dev] [PATCH v2 00/17] " Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 01/17] net/sfc/base: add missing extern storage-class specifiers Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 02/17] net/sfc/base: decorate libefx API functions Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 03/17] net/sfc/base: decorate libefx internal extern functions Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 04/17] net/sfc: include header with debug helpers directly Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 05/17] net/sfc: introduce common driver library Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 06/17] net/sfc: add dedicated header file with MCDI interface Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 07/17] net/sfc: move MCDI helper interface to dedicated namespace Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 08/17] net/sfc: make MCDI logging helper macros local Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 09/17] net/sfc: start to make MCDI helpers interface shareable Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 10/17] net/sfc: use own logging helper macros Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 11/17] net/sfc: avoid usage of NIC pointer from adapter context Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 12/17] net/sfc: avoid panic in the case of MCDI timeout Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 13/17] net/sfc: add MCDI callbacks to allocate/free DMA memory Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 14/17] net/sfc: add MCDI callback to schedule restart Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 15/17] net/sfc: add MCDI callback to poll management event queue Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 16/17] net/sfc: use MCDI control structure as libefx ops context Andrew Rybchenko
2020-09-17  6:34   ` [dpdk-dev] [PATCH v2 17/17] net/sfc: move MCDI helpers to common driver Andrew Rybchenko
2020-09-21 22:38   ` [dpdk-dev] [PATCH v2 00/17] net/sfc: factor out common driver library Ferruh Yigit

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=1599556475-27820-5-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).