DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tomasz Duszynski <tduszynski@marvell.com>
To: <dev@dpdk.org>
Cc: <jerinj@marvell.com>, Jakub Palider <jpalider@marvell.com>,
	"Tomasz Duszynski" <tduszynski@marvell.com>
Subject: [dpdk-dev] [PATCH 1/4] raw/cnxk_bphy: remove deps from internal headers
Date: Tue, 2 Nov 2021 19:41:31 +0100	[thread overview]
Message-ID: <20211102184134.3012344-2-tduszynski@marvell.com> (raw)
In-Reply-To: <20211102184134.3012344-1-tduszynski@marvell.com>

From: Jakub Palider <jpalider@marvell.com>

This patch resolves problem with internal header
inclusion. In addition prevents C++ name mangling.

Signed-off-by: Jakub Palider <jpalider@marvell.com>
Reviewed-by: Tomasz Duszynski <tduszynski@marvell.com>
Reviewed-by: Jerin Jacob Kollanukkaran <jerinj@marvell.com>
---
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.c |  2 +-
 drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 18 +++++-------------
 drivers/raw/cnxk_bphy/rte_pmd_bphy.h  | 18 ++++++++++++++++--
 3 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
index a328029aad..bbe7f74def 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c
@@ -90,7 +90,7 @@ cnxk_bphy_intr_unregister(uint16_t dev_id, int irq_num)
 		plt_err("Missing irq chip");
 }
 
-struct bphy_mem *
+struct cnxk_bphy_mem *
 cnxk_bphy_mem_get(uint16_t dev_id)
 {
 	struct bphy_device *bphy_dev = cnxk_bphy_get_bphy_dev_by_dev_id(dev_id);
diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
index 63d7285055..dab0f23188 100644
--- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
+++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h
@@ -5,17 +5,9 @@
 #ifndef _CNXK_BPHY_IRQ_
 #define _CNXK_BPHY_IRQ_
 
-#include <rte_bus_pci.h>
-#include <rte_dev.h>
-
 #include <roc_api.h>
 
-typedef void (*cnxk_bphy_intr_handler_t)(int irq_num, void *isr_data);
-
-struct bphy_mem {
-	struct rte_mem_resource res0;
-	struct rte_mem_resource res2;
-};
+#include "rte_pmd_bphy.h"
 
 struct bphy_irq_queue {
 	/* queue holds up to one response */
@@ -26,17 +18,17 @@ struct bphy_device {
 #define BPHY_QUEUE_CNT 1
 	struct roc_bphy bphy;
 	struct roc_bphy_irq_chip *irq_chip;
-	struct bphy_mem mem;
+	struct cnxk_bphy_mem mem;
 	/* bphy irq interface supports single queue only */
 	struct bphy_irq_queue queues[BPHY_QUEUE_CNT];
 };
 
 int cnxk_bphy_intr_init(uint16_t dev_id);
 void cnxk_bphy_intr_fini(uint16_t dev_id);
-struct bphy_mem *cnxk_bphy_mem_get(uint16_t dev_id);
+struct cnxk_bphy_mem *cnxk_bphy_mem_get(uint16_t dev_id);
 int cnxk_bphy_intr_register(uint16_t dev_id, int irq_num,
-			    cnxk_bphy_intr_handler_t handler,
-			    void *isr_data, int cpu);
+			    cnxk_bphy_intr_handler_t handler, void *isr_data,
+			    int cpu);
 void cnxk_bphy_intr_unregister(uint16_t dev_id, int irq_num);
 uint64_t cnxk_bphy_irq_max_get(uint16_t dev_id);
 
diff --git a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
index 4458342287..726ff412a2 100644
--- a/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
+++ b/drivers/raw/cnxk_bphy/rte_pmd_bphy.h
@@ -5,9 +5,13 @@
 #ifndef _CNXK_BPHY_H_
 #define _CNXK_BPHY_H_
 
+#include <rte_dev.h>
 #include <rte_memcpy.h>
+#include <rte_rawdev.h>
 
-#include "cnxk_bphy_irq.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 enum cnxk_bphy_cgx_msg_type {
 	CNXK_BPHY_CGX_MSG_TYPE_GET_LINKINFO,
@@ -107,9 +111,15 @@ struct cnxk_bphy_cgx_msg {
 	void *data;
 };
 
-#define cnxk_bphy_mem	    bphy_mem
 #define CNXK_BPHY_DEF_QUEUE 0
 
+typedef void (*cnxk_bphy_intr_handler_t)(int irq_num, void *isr_data);
+
+struct cnxk_bphy_mem {
+	struct rte_mem_resource res0;
+	struct rte_mem_resource res2;
+};
+
 enum cnxk_bphy_irq_msg_type {
 	CNXK_BPHY_IRQ_MSG_TYPE_INIT,
 	CNXK_BPHY_IRQ_MSG_TYPE_FINI,
@@ -383,4 +393,8 @@ rte_pmd_bphy_cgx_set_fec(uint16_t dev_id, uint16_t lmac,
 	return __rte_pmd_bphy_enq_deq(dev_id, lmac, &msg, NULL, 0);
 }
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _CNXK_BPHY_H_ */
-- 
2.25.1


  reply	other threads:[~2021-11-02 18:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02 18:41 [dpdk-dev] [PATCH 0/4] raw/cnxk_bphy: sync with local changes Tomasz Duszynski
2021-11-02 18:41 ` Tomasz Duszynski [this message]
2021-11-02 18:41 ` [dpdk-dev] [PATCH 2/4] raw/cnxk_bphy: keep leading zero in device name Tomasz Duszynski
2021-11-02 18:41 ` [dpdk-dev] [PATCH 3/4] raw/cnxk_bphy: add headers that provide used APIs Tomasz Duszynski
2021-11-02 18:41 ` [dpdk-dev] [PATCH 4/4] doc: add BPHY to the list of platform blocks Tomasz Duszynski
2021-11-03 15:20 ` [dpdk-dev] [PATCH 0/4] raw/cnxk_bphy: sync with local changes Jerin Jacob

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=20211102184134.3012344-2-tduszynski@marvell.com \
    --to=tduszynski@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=jpalider@marvell.com \
    /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).