DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@qlogic.com>
To: <ferruh.yigit@intel.com>, <thomas.monjalon@6wind.com>,
	<bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, <Dept-EngDPDKDev@qlogic.com>,
	Rasesh Mody <rasesh.mody@qlogic.com>
Subject: [dpdk-dev] [PATCH v4 03/32] net/qede: use FW CONFIG defines as needed
Date: Tue, 18 Oct 2016 21:11:17 -0700	[thread overview]
Message-ID: <1476850306-2141-4-git-send-email-rasesh.mody@qlogic.com> (raw)
In-Reply-To: <1476850306-2141-1-git-send-email-rasesh.mody@qlogic.com>

Replaced CONFIG_QED_BINARY_FW with CONFIG_ECORE_BINARY_FW.
Use CONFIG_ECORE_BINARY_FW and CONFIG_ECORE_ZIPPED_FW defines as
required.

Signed-off-by: Rasesh Mody <rasesh.mody@qlogic.com>
---
 drivers/net/qede/base/bcm_osal.c |  2 ++
 drivers/net/qede/base/ecore.h    | 20 +++++++++++++++-----
 drivers/net/qede/qede_main.c     | 20 +++++++++++---------
 3 files changed, 28 insertions(+), 14 deletions(-)

diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 16029b5..67270fd 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -152,6 +152,7 @@ void *osal_dma_alloc_coherent_aligned(struct ecore_dev *p_dev,
 	return mz->addr;
 }
 
+#ifdef CONFIG_ECORE_ZIPPED_FW
 u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
 		    u8 *input_buf, u32 max_size, u8 *unzip_buf)
 {
@@ -182,6 +183,7 @@ u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
 
 	return p_hwfn->stream->total_out / 4;
 }
+#endif
 
 void
 qede_get_mcp_proto_stats(struct ecore_dev *edev,
diff --git a/drivers/net/qede/base/ecore.h b/drivers/net/qede/base/ecore.h
index c83b22b..b9127de 100644
--- a/drivers/net/qede/base/ecore.h
+++ b/drivers/net/qede/base/ecore.h
@@ -9,6 +9,18 @@
 #ifndef __ECORE_H
 #define __ECORE_H
 
+/* @DPDK */
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#define CONFIG_ECORE_BINARY_FW
+#define CONFIG_ECORE_ZIPPED_FW
+
+#ifdef CONFIG_ECORE_ZIPPED_FW
+#include <zlib.h>
+#endif
+
 #include "ecore_hsi_common.h"
 #include "ecore_hsi_debug_tools.h"
 #include "ecore_hsi_init_func.h"
@@ -423,9 +435,6 @@ struct storm_stats {
 	u32 len;
 };
 
-#define CONFIG_ECORE_BINARY_FW
-#define CONFIG_ECORE_ZIPPED_FW
-
 struct ecore_fw_data {
 #ifdef CONFIG_ECORE_BINARY_FW
 	struct fw_ver_info *fw_ver_info;
@@ -521,8 +530,8 @@ struct ecore_hwfn {
 	/* QM init */
 	struct ecore_qm_info		qm_info;
 
-	/* Buffer for unzipping firmware data */
 #ifdef CONFIG_ECORE_ZIPPED_FW
+	/* Buffer for unzipping firmware data */
 	void *unzip_buf;
 #endif
 
@@ -674,9 +683,10 @@ struct ecore_dev {
 	bool				b_is_emul_full;
 #endif
 
+#ifdef CONFIG_ECORE_BINARY_FW /* @DPDK */
 	void				*firmware;
-
 	u64				fw_len;
+#endif
 
 };
 
diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c
index 73608c6..2e62371 100644
--- a/drivers/net/qede/qede_main.c
+++ b/drivers/net/qede/qede_main.c
@@ -6,10 +6,6 @@
  * See LICENSE.qede_pmd for copyright and licensing details.
  */
 
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <zlib.h>
 #include <limits.h>
 #include <rte_alarm.h>
 
@@ -20,7 +16,6 @@ static uint8_t npar_tx_switching = 1;
 /* Alarm timeout. */
 #define QEDE_ALARM_TIMEOUT_US 100000
 
-#define CONFIG_QED_BINARY_FW
 /* Global variable to hold absolute path of fw file */
 char fw_file[PATH_MAX];
 
@@ -83,6 +78,7 @@ static int qed_nic_setup(struct ecore_dev *edev)
 	return rc;
 }
 
+#ifdef CONFIG_ECORE_ZIPPED_FW
 static int qed_alloc_stream_mem(struct ecore_dev *edev)
 {
 	int i;
@@ -112,7 +108,9 @@ static void qed_free_stream_mem(struct ecore_dev *edev)
 		OSAL_FREE(p_hwfn->p_dev, p_hwfn->stream);
 	}
 }
+#endif
 
+#ifdef CONFIG_ECORE_BINARY_FW
 static int qed_load_firmware_data(struct ecore_dev *edev)
 {
 	int fd;
@@ -158,6 +156,7 @@ static int qed_load_firmware_data(struct ecore_dev *edev)
 
 	return 0;
 }
+#endif
 
 static void qed_handle_bulletin_change(struct ecore_hwfn *hwfn)
 {
@@ -222,7 +221,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	struct ecore_tunn_start_params tunn_info;
 #endif
 
-#ifdef CONFIG_QED_BINARY_FW
+#ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev)) {
 		rc = qed_load_firmware_data(edev);
 		if (rc) {
@@ -240,7 +239,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	/* set int_coalescing_mode */
 	edev->int_coalescing_mode = ECORE_COAL_MODE_ENABLE;
 
-	/* Should go with CONFIG_QED_BINARY_FW */
+#ifdef CONFIG_ECORE_ZIPPED_FW
 	if (IS_PF(edev)) {
 		/* Allocate stream for unzipping */
 		rc = qed_alloc_stream_mem(edev);
@@ -252,9 +251,10 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 	}
 
 	qed_start_iov_task(edev);
+#endif
 
 	/* Start the slowpath */
-#ifdef CONFIG_QED_BINARY_FW
+#ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev))
 		data = edev->firmware;
 #endif
@@ -307,7 +307,7 @@ static int qed_slowpath_start(struct ecore_dev *edev,
 err2:
 	ecore_resc_free(edev);
 err:
-#ifdef CONFIG_QED_BINARY_FW
+#ifdef CONFIG_ECORE_BINARY_FW
 	if (IS_PF(edev)) {
 		if (edev->firmware)
 			rte_free(edev->firmware);
@@ -625,7 +625,9 @@ static int qed_slowpath_stop(struct ecore_dev *edev)
 		return -ENODEV;
 
 	if (IS_PF(edev)) {
+#ifdef CONFIG_ECORE_ZIPPED_FW
 		qed_free_stream_mem(edev);
+#endif
 
 #ifdef CONFIG_QED_SRIOV
 		if (IS_QED_ETH_IF(edev))
-- 
1.8.3.1

  parent reply	other threads:[~2016-10-19  4:12 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19  4:11 [dpdk-dev] [PATCH v4 00/32] net/qede: update qede pmd to 1.2.0.1 and enable by default Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 01/32] net/qede/base: add new init files and rearrange the code Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 02/32] net/qede/base: formatting changes Rasesh Mody
2016-10-19  4:11 ` Rasesh Mody [this message]
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 04/32] net/qede/base: add HSI changes and register defines Rasesh Mody
2016-10-19 12:37   ` Ferruh Yigit
2016-10-19 13:46     ` Mody, Rasesh
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 05/32] net/qede/base: add attention formatting string Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 06/32] net/qede/base: additional formatting/comment changes Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 07/32] net/qede: fix 32 bit compilation Rasesh Mody
2016-10-26 16:54   ` Thomas Monjalon
2016-10-26 21:01     ` Mody, Rasesh
2016-10-26 21:40       ` Thomas Monjalon
2016-10-28  6:37         ` [dpdk-dev] [PATCH] net/qede: fix gcc compiler option checks Rasesh Mody
2016-10-28 22:12           ` Stephen Hemminger
2016-10-28 22:49             ` Mody, Rasesh
2016-11-07 19:54               ` Thomas Monjalon
2016-11-07 20:10           ` Thomas Monjalon
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 08/32] net/qede: change signature of MCP command API Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 09/32] net/qede: serialize access to MFW mbox Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 10/32] net/qede: add NIC selftest and query sensor info support Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 11/32] net/qede/base: update base driver Rasesh Mody
2021-03-24 14:07   ` Ferruh Yigit
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 12/32] net/qede/base: rename structure and defines Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 13/32] net/qede/base: comment enhancements Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 14/32] net/qede/base: add MFW crash dump support Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 15/32] net/qede: enable support for unequal number of Rx/Tx queues Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 16/32] net/qede: fix port (re)configuration issue Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 17/32] net/qede/base: allow MTU change via vport-update Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 18/32] net/qede: add missing 100G link speed capability Rasesh Mody
2016-10-26 15:41   ` Thomas Monjalon
2016-10-26 15:54     ` Bruce Richardson
2016-10-26 21:28     ` Harish Patil
2016-10-26 21:43       ` Thomas Monjalon
2016-10-28  6:42         ` [dpdk-dev] [PATCH] net/qede: fix advertising " Rasesh Mody
2016-10-28  7:26           ` Thomas Monjalon
2016-10-29  1:11             ` Harish Patil
2016-10-29  6:14             ` [dpdk-dev] [PATCH v2] " Rasesh Mody
2016-10-31 18:35               ` [dpdk-dev] [PATCH v3] " Rasesh Mody
2016-10-31 18:35                 ` Rasesh Mody
2016-11-07 19:48                   ` Thomas Monjalon
2016-11-10  2:54                     ` Harish Patil
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 19/32] net/qede: remove unused/dead code Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 20/32] net/qede: fixes for VLAN filters Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 21/32] net/qede: add enable/disable VLAN filtering Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 22/32] net/qede: fix RSS related issues Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 23/32] net/qede: add scatter gather support Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 24/32] net/qede/base: change Rx Tx queue start APIs Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 25/32] net/qede/base: add support to initiate PF FLR Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 26/32] net/qede: skip slowpath polling for 100G VF device Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 27/32] net/qede: fix driver version string Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 28/32] net/qede: fix status block index for VF queues Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 29/32] net/qede: add support for queue statistics Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 30/32] net/qede: remove zlib dependency and enable PMD by default Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 31/32] doc: update qede pmd documentation Rasesh Mody
2016-10-19  4:11 ` [dpdk-dev] [PATCH v4 32/32] net/qede: update driver version Rasesh Mody
2016-10-24 13:41 ` [dpdk-dev] [PATCH v4 00/32] net/qede: update qede pmd to 1.2.0.1 and enable by default Bruce Richardson
2016-10-26 15:20   ` Thomas Monjalon
2016-10-26 17:01     ` Mody, Rasesh

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=1476850306-2141-4-git-send-email-rasesh.mody@qlogic.com \
    --to=rasesh.mody@qlogic.com \
    --cc=Dept-EngDPDKDev@qlogic.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=thomas.monjalon@6wind.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).