From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id 80F071B107 for ; Wed, 21 Nov 2018 17:49:58 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E017E2D800; Wed, 21 Nov 2018 16:49:57 +0000 (UTC) Received: from ktraynor.remote.csb (unknown [10.36.118.7]) by smtp.corp.redhat.com (Postfix) with ESMTP id 73F9F5C21E; Wed, 21 Nov 2018 16:49:56 +0000 (UTC) From: Kevin Traynor To: Qi Zhang Cc: Beilei Xing , dpdk stable Date: Wed, 21 Nov 2018 16:47:32 +0000 Message-Id: <20181121164828.32249-18-ktraynor@redhat.com> In-Reply-To: <20181121164828.32249-1-ktraynor@redhat.com> References: <20181121164828.32249-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 21 Nov 2018 16:49:57 +0000 (UTC) Subject: [dpdk-stable] patch 'net/i40e/base: read LLDP config area with correct endianness' has been queued to stable release 18.08.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Nov 2018 16:49:59 -0000 Hi, FYI, your patch has been queued to stable release 18.08.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/27/18. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. If the code is different (ie: not only metadata diffs), due for example to a change in context or macro names, please double check it. Thanks. Kevin Traynor --- >>From 3feb1e9eb8faf906eee3991db764ff593e7772f5 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Tue, 25 Sep 2018 10:34:30 +0800 Subject: [PATCH] net/i40e/base: read LLDP config area with correct endianness [ upstream commit b72611a2743c4198e3b031cf120e0bd432256c83 ] The NVM is in little endian so when we read from it we need to do the correct thing for the endianness of the machine. Signed-off-by: Qi Zhang Acked-by: Beilei Xing --- drivers/net/i40e/base/i40e_dcb.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/i40e/base/i40e_dcb.c b/drivers/net/i40e/base/i40e_dcb.c index 7600c9227..c93b633c6 100644 --- a/drivers/net/i40e/base/i40e_dcb.c +++ b/drivers/net/i40e/base/i40e_dcb.c @@ -1292,4 +1292,5 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, u32 address, offset = (2 * word_offset); enum i40e_status_code ret; + __le16 raw_mem; u16 mem; @@ -1298,10 +1299,11 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, return ret; - ret = i40e_aq_read_nvm(hw, 0x0, module * 2, sizeof(mem), &mem, true, - NULL); + ret = i40e_aq_read_nvm(hw, 0x0, module * 2, sizeof(raw_mem), &raw_mem, + true, NULL); i40e_release_nvm(hw); if (ret != I40E_SUCCESS) return ret; + mem = LE16_TO_CPU(raw_mem); /* Check if this pointer needs to be read in word size or 4K sector * units. @@ -1316,10 +1318,11 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, goto err_lldp_cfg; - ret = i40e_aq_read_nvm(hw, module, offset, sizeof(mem), &mem, true, - NULL); + ret = i40e_aq_read_nvm(hw, module, offset, sizeof(raw_mem), &raw_mem, + true, NULL); i40e_release_nvm(hw); if (ret != I40E_SUCCESS) return ret; + mem = LE16_TO_CPU(raw_mem); offset = mem + word_offset; offset *= 2; -- 2.19.0 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2018-11-21 16:44:31.431133104 +0000 +++ 0018-net-i40e-base-read-LLDP-config-area-with-correct-end.patch 2018-11-21 16:44:30.000000000 +0000 @@ -1,13 +1,13 @@ -From b72611a2743c4198e3b031cf120e0bd432256c83 Mon Sep 17 00:00:00 2001 +From 3feb1e9eb8faf906eee3991db764ff593e7772f5 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Tue, 25 Sep 2018 10:34:30 +0800 Subject: [PATCH] net/i40e/base: read LLDP config area with correct endianness +[ upstream commit b72611a2743c4198e3b031cf120e0bd432256c83 ] + The NVM is in little endian so when we read from it we need to do the correct thing for the endianness of the machine. -Cc: stable@dpdk.org - Signed-off-by: Qi Zhang Acked-by: Beilei Xing --- @@ -15,16 +15,16 @@ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/i40e/base/i40e_dcb.c b/drivers/net/i40e/base/i40e_dcb.c -index 7cd444bb3..a26f82b3a 100644 +index 7600c9227..c93b633c6 100644 --- a/drivers/net/i40e/base/i40e_dcb.c +++ b/drivers/net/i40e/base/i40e_dcb.c -@@ -1263,4 +1263,5 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, +@@ -1292,4 +1292,5 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, u32 address, offset = (2 * word_offset); enum i40e_status_code ret; + __le16 raw_mem; u16 mem; -@@ -1269,10 +1270,11 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, +@@ -1298,10 +1299,11 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, return ret; - ret = i40e_aq_read_nvm(hw, 0x0, module * 2, sizeof(mem), &mem, true, @@ -38,7 +38,7 @@ + mem = LE16_TO_CPU(raw_mem); /* Check if this pointer needs to be read in word size or 4K sector * units. -@@ -1287,10 +1289,11 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, +@@ -1316,10 +1318,11 @@ static enum i40e_status_code _i40e_read_lldp_cfg(struct i40e_hw *hw, goto err_lldp_cfg; - ret = i40e_aq_read_nvm(hw, module, offset, sizeof(mem), &mem, true,