DPDK patches and discussions
 help / color / mirror / Atom feed
From: Helin Zhang <helin.zhang@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 12/15] i40e: workaround of get_firmware_version, and enhancements
Date: Tue,  9 Sep 2014 15:21:36 +0800
Message-ID: <1410247299-4365-13-git-send-email-helin.zhang@intel.com> (raw)
In-Reply-To: <1410247299-4365-1-git-send-email-helin.zhang@intel.com>

The workaround helps fix the API if the FW is 4.2 or later.
In addition, an unreachable 'break' statement has been removed.

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Reviewed-by: Chen Jing <jing.d.chen@intel.com>
---
 lib/librte_pmd_i40e/i40e/i40e_adminq.c |  5 ++---
 lib/librte_pmd_i40e/i40e/i40e_common.c | 12 ++++++++++--
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/lib/librte_pmd_i40e/i40e/i40e_adminq.c b/lib/librte_pmd_i40e/i40e/i40e_adminq.c
index 9b5a294..80da710 100644
--- a/lib/librte_pmd_i40e/i40e/i40e_adminq.c
+++ b/lib/librte_pmd_i40e/i40e/i40e_adminq.c
@@ -879,7 +879,6 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 	 */
 	if (!details->async && !details->postpone) {
 		u32 total_delay = 0;
-		u32 delay_len = 1;
 
 		do {
 			/* AQ designers suggest use of head for better
@@ -888,8 +887,8 @@ enum i40e_status_code i40e_asq_send_command(struct i40e_hw *hw,
 			if (i40e_asq_done(hw))
 				break;
 			/* ugh! delay while spin_lock */
-			i40e_msec_delay(delay_len);
-			total_delay += delay_len;
+			i40e_msec_delay(1);
+			total_delay++;
 		} while (total_delay < hw->aq.asq_cmd_timeout);
 	}
 
diff --git a/lib/librte_pmd_i40e/i40e/i40e_common.c b/lib/librte_pmd_i40e/i40e/i40e_common.c
index d901c8d..60ca943 100644
--- a/lib/librte_pmd_i40e/i40e/i40e_common.c
+++ b/lib/librte_pmd_i40e/i40e/i40e_common.c
@@ -571,7 +571,6 @@ enum i40e_status_code i40e_init_shared_code(struct i40e_hw *hw)
 		break;
 	default:
 		return I40E_ERR_DEVICE_NOT_SUPPORTED;
-		break;
 	}
 
 	hw->phy.get_link_info = true;
@@ -872,6 +871,7 @@ enum i40e_status_code i40e_pf_reset(struct i40e_hw *hw)
 
 	i40e_clear_pxe_mode(hw);
 
+
 	return I40E_SUCCESS;
 }
 
@@ -1946,6 +1946,14 @@ enum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,
 			*api_major_version = LE16_TO_CPU(resp->api_major);
 		if (api_minor_version != NULL)
 			*api_minor_version = LE16_TO_CPU(resp->api_minor);
+
+		/* A workaround to fix the API version in SW */
+		if (api_major_version && api_minor_version &&
+		    fw_major_version && fw_minor_version &&
+		    ((*api_major_version == 1) && (*api_minor_version == 1)) &&
+		    (((*fw_major_version == 4) && (*fw_minor_version >= 2)) ||
+		     (*fw_major_version > 4)))
+			*api_minor_version = 2;
 	}
 
 	return status;
@@ -4713,6 +4721,7 @@ enum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
 				struct i40e_asq_cmd_details *cmd_details)
 {
 	struct i40e_aq_desc desc;
+	struct i40e_asq_cmd_details details;
 	enum i40e_status_code status;
 
 	i40e_fill_default_direct_cmd_desc(&desc, i40e_aqc_opc_send_msg_to_pf);
@@ -4727,7 +4736,6 @@ enum i40e_status_code i40e_aq_send_msg_to_pf(struct i40e_hw *hw,
 		desc.datalen = CPU_TO_LE16(msglen);
 	}
 	if (!cmd_details) {
-		struct i40e_asq_cmd_details details;
 		i40e_memset(&details, 0, sizeof(details), I40E_NONDMA_MEM);
 		details.async = true;
 		cmd_details = &details;
-- 
1.8.1.4

  parent reply	other threads:[~2014-09-09  7:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  7:21 [dpdk-dev] [PATCH 00/15] i40e base driver udpate Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 01/15] i40e: make the indentation more consistent in share code Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 02/15] i40e: support nvmupdate by default Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 03/15] i40e: remove useless code which was written for Solaris Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 04/15] i40e: remove test code for 'ethtool' Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 05/15] i40e: force a shifted '1' to be 'unsigned' Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 06/15] i40e: remove useless code for pre-boot support Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 07/15] i40e: Get rid of sparse warnings, and remove unreachable code Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 08/15] i40e: remove code which is for software validation only Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 09/15] i40e: remove code for TPH (TLP Processing Hints) Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 10/15] i40e: support of 10G base T Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 11/15] i40e: expose debug_write_register request Helin Zhang
2014-09-09  7:21 ` Helin Zhang [this message]
2014-09-09  7:21 ` [dpdk-dev] [PATCH 13/15] i40e: Use get_link_status to report FC settings Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 14/15] i40e: fix and enhancement in arq_event_info struct Helin Zhang
2014-09-09  7:21 ` [dpdk-dev] [PATCH 15/15] i40e: support redefined struct of 'i40e_arq_event_info' Helin Zhang
2014-09-29  2:59 ` [dpdk-dev] [PATCH 00/15] i40e base driver update Xu, HuilongX
2014-10-07 16:31 ` [dpdk-dev] [PATCH 00/15] i40e base driver udpate 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=1410247299-4365-13-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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git