* [dpdk-stable] [PATCH 19.11] net/ice: fix incorrect EEPROM data
@ 2021-03-10 9:13 Murphy Yang
2021-03-10 10:29 ` Christian Ehrhardt
0 siblings, 1 reply; 2+ messages in thread
From: Murphy Yang @ 2021-03-10 9:13 UTC (permalink / raw)
To: stable; +Cc: Murphy Yang, Shougang Wang
[ upstream commit 01186263c2c79b9a22d3f3b1eeec844c6552fdc7 ]
Kernel driver reads EEPROM data from flash but DPDK reads from
shadow ram. This patch fixes the issue by changing method to get
EEPROM data from flash.
Fixes: 68a1ab82ad74 ("net/ice: speed up to retrieve EEPROM")
Cc: stable@dpdk.org
Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
---
drivers/net/ice/ice_ethdev.c | 25 +++++++++++--------------
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index c2e659303c..efb2d67d54 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3984,8 +3984,7 @@ ice_get_eeprom_length(struct rte_eth_dev *dev)
{
struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- /* Convert word count to byte count */
- return hw->nvm.sr_words << 1;
+ return hw->nvm.flash_size;
}
static int
@@ -3993,26 +3992,24 @@ ice_get_eeprom(struct rte_eth_dev *dev,
struct rte_dev_eeprom_info *eeprom)
{
struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
- uint16_t *data = eeprom->data;
- uint16_t first_word, last_word, nwords;
enum ice_status status = ICE_SUCCESS;
+ uint8_t *data = eeprom->data;
- first_word = eeprom->offset >> 1;
- last_word = (eeprom->offset + eeprom->length - 1) >> 1;
- nwords = last_word - first_word + 1;
+ eeprom->magic = hw->vendor_id | (hw->device_id << 16);
- if (first_word >= hw->nvm.sr_words ||
- last_word >= hw->nvm.sr_words) {
- PMD_DRV_LOG(ERR, "Requested EEPROM bytes out of range.");
- return -EINVAL;
+ status = ice_acquire_nvm(hw, ICE_RES_READ);
+ if (status) {
+ PMD_DRV_LOG(ERR, "acquire nvm failed.");
+ return -EIO;
}
- eeprom->magic = hw->vendor_id | (hw->device_id << 16);
+ status = ice_read_flat_nvm(hw, eeprom->offset, &eeprom->length,
+ data, false);
+
+ ice_release_nvm(hw);
- status = ice_read_sr_buf(hw, first_word, &nwords, data);
if (status) {
PMD_DRV_LOG(ERR, "EEPROM read failed.");
- eeprom->length = sizeof(uint16_t) * nwords;
return -EIO;
}
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [dpdk-stable] [PATCH 19.11] net/ice: fix incorrect EEPROM data
2021-03-10 9:13 [dpdk-stable] [PATCH 19.11] net/ice: fix incorrect EEPROM data Murphy Yang
@ 2021-03-10 10:29 ` Christian Ehrhardt
0 siblings, 0 replies; 2+ messages in thread
From: Christian Ehrhardt @ 2021-03-10 10:29 UTC (permalink / raw)
To: Murphy Yang; +Cc: dpdk stable, Shougang Wang, Luca Boccassi
On Wed, Mar 10, 2021 at 10:20 AM Murphy Yang <murphyx.yang@intel.com> wrote:
>
> [ upstream commit 01186263c2c79b9a22d3f3b1eeec844c6552fdc7 ]
>
> Kernel driver reads EEPROM data from flash but DPDK reads from
> shadow ram. This patch fixes the issue by changing method to get
> EEPROM data from flash.
>
> Fixes: 68a1ab82ad74 ("net/ice: speed up to retrieve EEPROM")
> Cc: stable@dpdk.org
Hi Murphy,
of the 5 patches just submitted in this series this is the only one with
a proper CC: stable@dpdk and a fixes line.
I wanted to ask what the reasoning is for the other four to also be submitted
as 19.11 - they sound more like extending features of the ICE drivers than
fixes that would go into a stable update.
Finally I also wondered that these are only queued for 20.05 which isn't
released yet so this had less tests/discussions so far - that is at least
uncommon to accept them now.
And in regard to that I haven't found the same patches for 20.11. Due to
that accepting them into 19.11 now would cause someone then upgrading
19.11.x -> 20.11.x to degrade.
If you could please outline why the other four changes in this series
are requested
for (19.11 in particular) stable?
Thanks in advance,
Christan
> Signed-off-by: Shougang Wang <shougangx.wang@intel.com>
> ---
> drivers/net/ice/ice_ethdev.c | 25 +++++++++++--------------
> 1 file changed, 11 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
> index c2e659303c..efb2d67d54 100644
> --- a/drivers/net/ice/ice_ethdev.c
> +++ b/drivers/net/ice/ice_ethdev.c
> @@ -3984,8 +3984,7 @@ ice_get_eeprom_length(struct rte_eth_dev *dev)
> {
> struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
>
> - /* Convert word count to byte count */
> - return hw->nvm.sr_words << 1;
> + return hw->nvm.flash_size;
> }
>
> static int
> @@ -3993,26 +3992,24 @@ ice_get_eeprom(struct rte_eth_dev *dev,
> struct rte_dev_eeprom_info *eeprom)
> {
> struct ice_hw *hw = ICE_DEV_PRIVATE_TO_HW(dev->data->dev_private);
> - uint16_t *data = eeprom->data;
> - uint16_t first_word, last_word, nwords;
> enum ice_status status = ICE_SUCCESS;
> + uint8_t *data = eeprom->data;
>
> - first_word = eeprom->offset >> 1;
> - last_word = (eeprom->offset + eeprom->length - 1) >> 1;
> - nwords = last_word - first_word + 1;
> + eeprom->magic = hw->vendor_id | (hw->device_id << 16);
>
> - if (first_word >= hw->nvm.sr_words ||
> - last_word >= hw->nvm.sr_words) {
> - PMD_DRV_LOG(ERR, "Requested EEPROM bytes out of range.");
> - return -EINVAL;
> + status = ice_acquire_nvm(hw, ICE_RES_READ);
> + if (status) {
> + PMD_DRV_LOG(ERR, "acquire nvm failed.");
> + return -EIO;
> }
>
> - eeprom->magic = hw->vendor_id | (hw->device_id << 16);
> + status = ice_read_flat_nvm(hw, eeprom->offset, &eeprom->length,
> + data, false);
> +
> + ice_release_nvm(hw);
>
> - status = ice_read_sr_buf(hw, first_word, &nwords, data);
> if (status) {
> PMD_DRV_LOG(ERR, "EEPROM read failed.");
> - eeprom->length = sizeof(uint16_t) * nwords;
> return -EIO;
> }
>
> --
> 2.17.1
>
--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-10 10:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 9:13 [dpdk-stable] [PATCH 19.11] net/ice: fix incorrect EEPROM data Murphy Yang
2021-03-10 10:29 ` Christian Ehrhardt
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).