DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH v2 1/2] i40e: fix ICC compile issue
Date: Mon,  9 Nov 2015 10:45:58 +0800	[thread overview]
Message-ID: <1447037159-26544-2-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1447037159-26544-1-git-send-email-helin.zhang@intel.com>

It fixes compile issue on ICC 13.0.0.

Error logs:
i40e_ethdev.c(7943): error #188: enumerated type mixed with another type
    PMD_INIT_LOG(ERR,

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
---
 drivers/net/i40e/i40e_ethdev.c | 34 +++++++++++++++++++---------------
 1 file changed, 19 insertions(+), 15 deletions(-)

v2 changes:
Corrected the variable/function type, to replace casting.

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index ddf3d38..30fb106 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -3418,7 +3418,7 @@ bitmap_is_subset(uint8_t src1, uint8_t src2)
 	return !((src1 ^ src2) & src2);
 }
 
-static int
+static enum i40e_status_code
 validate_tcmap_parameter(struct i40e_vsi *vsi, uint8_t enabled_tcmap)
 {
 	struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
@@ -3426,14 +3426,14 @@ validate_tcmap_parameter(struct i40e_vsi *vsi, uint8_t enabled_tcmap)
 	/* If DCB is not supported, only default TC is supported */
 	if (!hw->func_caps.dcb && enabled_tcmap != I40E_DEFAULT_TCMAP) {
 		PMD_DRV_LOG(ERR, "DCB is not enabled, only TC0 is supported");
-		return -EINVAL;
+		return I40E_NOT_SUPPORTED;
 	}
 
 	if (!bitmap_is_subset(hw->func_caps.enabled_tcmap, enabled_tcmap)) {
 		PMD_DRV_LOG(ERR, "Enabled TC map 0x%x not applicable to "
 			    "HW support 0x%x", hw->func_caps.enabled_tcmap,
 			    enabled_tcmap);
-		return -EINVAL;
+		return I40E_NOT_SUPPORTED;
 	}
 	return I40E_SUCCESS;
 }
@@ -3518,12 +3518,13 @@ i40e_vsi_update_tc_bandwidth(struct i40e_vsi *vsi, uint8_t enabled_tcmap)
 	return I40E_SUCCESS;
 }
 
-static int
+static enum i40e_status_code
 i40e_vsi_config_tc_queue_mapping(struct i40e_vsi *vsi,
 				 struct i40e_aqc_vsi_properties_data *info,
 				 uint8_t enabled_tcmap)
 {
-	int ret, i, total_tc = 0;
+	enum i40e_status_code ret;
+	int i, total_tc = 0;
 	uint16_t qpnum_per_tc, bsf, qp_idx;
 
 	ret = validate_tcmap_parameter(vsi, enabled_tcmap);
@@ -7928,13 +7929,14 @@ i40e_parse_dcb_configure(struct rte_eth_dev *dev,
  *
  * Returns 0 on success, negative value on failure
  */
-static int
+static enum i40e_status_code
 i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
 {
 	struct i40e_aqc_query_vsi_ets_sla_config_resp bw_ets_config = {0};
 	struct i40e_aqc_query_vsi_bw_config_resp bw_config = {0};
 	struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
-	int i, ret;
+	enum i40e_status_code ret;
+	int i;
 	uint32_t tc_bw_max;
 
 	/* Get the VSI level BW configuration */
@@ -7944,7 +7946,7 @@ i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
 			 "couldn't get PF vsi bw config, err %s aq_err %s\n",
 			 i40e_stat_str(hw, ret),
 			 i40e_aq_str(hw, hw->aq.asq_last_status));
-		return -EINVAL;
+		return ret;
 	}
 
 	/* Get the VSI level BW configuration per TC */
@@ -7955,7 +7957,7 @@ i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
 			 "couldn't get PF vsi ets bw config, err %s aq_err %s\n",
 			 i40e_stat_str(hw, ret),
 			 i40e_aq_str(hw, hw->aq.asq_last_status));
-		return -EINVAL;
+		return ret;
 	}
 
 	if (bw_config.tc_valid_bits != bw_ets_config.tc_valid_bits) {
@@ -7983,15 +7985,16 @@ i40e_vsi_get_bw_info(struct i40e_vsi *vsi)
 			 __func__, vsi->seid, i, bw_config.qs_handles[i]);
 	}
 
-	return 0;
+	return ret;
 }
 
-static int
+static enum i40e_status_code
 i40e_vsi_update_queue_mapping(struct i40e_vsi *vsi,
 			      struct i40e_aqc_vsi_properties_data *info,
 			      uint8_t enabled_tcmap)
 {
-	int ret, i, total_tc = 0;
+	enum i40e_status_code ret;
+	int i, total_tc = 0;
 	uint16_t qpnum_per_tc, bsf, qp_idx;
 	struct rte_eth_dev_data *dev_data = I40E_VSI_TO_DEV_DATA(vsi);
 
@@ -8058,13 +8061,13 @@ i40e_vsi_update_queue_mapping(struct i40e_vsi *vsi,
  *
  * Returns 0 on success, negative value on failure
  */
-static int
+static enum i40e_status_code
 i40e_vsi_config_tc(struct i40e_vsi *vsi, u8 tc_map)
 {
 	struct i40e_aqc_configure_vsi_tc_bw_data bw_data;
 	struct i40e_vsi_context ctxt;
 	struct i40e_hw *hw = I40E_VSI_TO_HW(vsi);
-	int ret = 0;
+	enum i40e_status_code ret = I40E_SUCCESS;
 	int i;
 
 	/* Check if enabled_tc is same as existing or new TCs */
@@ -8150,7 +8153,8 @@ i40e_dcb_hw_configure(struct i40e_pf *pf,
 	struct i40e_dcbx_config *old_cfg = &hw->local_dcbx_config;
 	struct i40e_vsi *main_vsi = pf->main_vsi;
 	struct i40e_vsi_list *vsi_list;
-	int i, ret;
+	enum i40e_status_code ret;
+	int i;
 	uint32_t val;
 
 	/* Use the FW API if FW > v4.4*/
-- 
1.8.1.4

  reply	other threads:[~2015-11-09  2:46 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-06  7:48 [dpdk-dev] [PATCH 0/3] fix compile issues Helin Zhang
2015-11-06  7:48 ` [dpdk-dev] [PATCH 1/3] bonding: fix ICC compile issue Helin Zhang
2015-11-06  8:08   ` De Lara Guarch, Pablo
2015-11-06  7:48 ` [dpdk-dev] [PATCH 2/3] i40e: " Helin Zhang
2015-11-06  8:11   ` De Lara Guarch, Pablo
2015-11-06  7:48 ` [dpdk-dev] [PATCH 3/3] app/testpmd: " Helin Zhang
2015-11-09  2:45 ` [dpdk-dev] [PATCH v2 0/2] fix compile issues on ICC Helin Zhang
2015-11-09  2:45   ` Helin Zhang [this message]
2015-11-09  2:45   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: fix ICC compile issue Helin Zhang
2015-11-10  9:34   ` [dpdk-dev] [PATCH v2 0/2] fix compile issues on ICC De Lara Guarch, Pablo
2015-11-11  6:11   ` [dpdk-dev] [PATCH v3 " Helin Zhang
2015-11-11  6:11     ` [dpdk-dev] [PATCH v3 1/2] i40e: fix ICC compile issue Helin Zhang
2015-11-11  6:11     ` [dpdk-dev] [PATCH v3 2/2] app/testpmd: " Helin Zhang
     [not found]     ` <E115CCD9D858EF4F90C690B0DCB4D8973C856E99@IRSMSX108.ger.corp.intel.com>
2015-11-11 18:25       ` [dpdk-dev] [PATCH v3 0/2] fix compile issues on ICC Thomas Monjalon

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=1447037159-26544-2-git-send-email-helin.zhang@intel.com \
    --to=helin.zhang@intel.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).