From: Qi Zhang <qi.z.zhang@intel.com>
To: beilei.xing@intel.com
Cc: dev@dpdk.org, jingjing.wu@intel.com,
Qi Zhang <qi.z.zhang@intel.com>,
stable@dpdk.org
Subject: [dpdk-stable] [PATCH v2 22/24] net/i40e/base: fix unaligned data issue
Date: Tue, 9 Jan 2018 15:17:22 -0500 [thread overview]
Message-ID: <1515529044-10168-23-git-send-email-qi.z.zhang@intel.com> (raw)
In-Reply-To: <1515529044-10168-1-git-send-email-qi.z.zhang@intel.com>
This fix prevents errors or warnings while accessing unaligned 32-bit
data words on non-x86 platforms during getting link info from firmware.
Fixes: e8228f1a16b7 ("net/i40e/base: report supported link modes")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/i40e/base/i40e_common.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/net/i40e/base/i40e_common.c b/drivers/net/i40e/base/i40e_common.c
index a0a1f84b6..f3e34965f 100644
--- a/drivers/net/i40e/base/i40e_common.c
+++ b/drivers/net/i40e/base/i40e_common.c
@@ -2025,7 +2025,11 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
hw->aq.api_min_ver >= 7) {
- hw->phy.phy_types = LE32_TO_CPU(*(__le32 *)resp->link_type);
+ __le32 tmp;
+
+ i40e_memcpy(&tmp, resp->link_type, sizeof(tmp),
+ I40E_NONDMA_TO_NONDMA);
+ hw->phy.phy_types = LE32_TO_CPU(tmp);
hw->phy.phy_types |= ((u64)resp->link_type_ext << 32);
}
--
2.14.1
prev parent reply other threads:[~2018-01-10 3:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1515529044-10168-1-git-send-email-qi.z.zhang@intel.com>
2018-01-09 20:17 ` [dpdk-stable] [PATCH v2 04/24] net/i40e/base: release spinlock before function returns Qi Zhang
2018-01-09 20:17 ` [dpdk-stable] [PATCH v2 11/24] net/i40e/base: fix NVM lock Qi Zhang
2018-01-09 20:17 ` [dpdk-stable] [PATCH v2 15/24] net/i40e/base: fix link LED blink Qi Zhang
2018-01-09 20:17 ` [dpdk-stable] [PATCH v2 20/24] net/i40e/base: fix compile issue for GCC 6.3 Qi Zhang
2018-01-09 20:17 ` [dpdk-stable] [PATCH v2 21/24] net/i40e/base: fix reading LLDP configuration Qi Zhang
2018-01-09 20:17 ` Qi Zhang [this message]
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=1515529044-10168-23-git-send-email-qi.z.zhang@intel.com \
--to=qi.z.zhang@intel.com \
--cc=beilei.xing@intel.com \
--cc=dev@dpdk.org \
--cc=jingjing.wu@intel.com \
--cc=stable@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).