[dpdk-dev] [PATCH v3] ixgbe: fix access to last byte of EEPROM
Ananyev, Konstantin
konstantin.ananyev at intel.com
Mon Sep 21 11:13:22 CEST 2015
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Remy Horton
> Sent: Thursday, September 17, 2015 2:47 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v3] ixgbe: fix access to last byte of EEPROM
>
> Incorrect operator in ixgbe_get_eeprom & ixgbe_set_eeprom prevents
> last byte of EEPROM being read/written, and hence cannot be dumped
> or updated in entirity using these functions.
>
> Fixes: 0198848a47f5 ("ixgbe: add access to specific device info")
>
> Signed-off-by: Remy Horton <remy.horton at intel.com>
> ---
> drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ec2918c..4a7ee3b 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -5444,8 +5444,8 @@ ixgbe_get_eeprom(struct rte_eth_dev *dev,
>
> first = in_eeprom->offset >> 1;
> length = in_eeprom->length >> 1;
> - if ((first >= hw->eeprom.word_size) ||
> - ((first + length) >= hw->eeprom.word_size))
> + if ((first > hw->eeprom.word_size) ||
> + ((first + length) > hw->eeprom.word_size))
> return -EINVAL;
>
> in_eeprom->magic = hw->vendor_id | (hw->device_id << 16);
> @@ -5464,8 +5464,8 @@ ixgbe_set_eeprom(struct rte_eth_dev *dev,
>
> first = in_eeprom->offset >> 1;
> length = in_eeprom->length >> 1;
> - if ((first >= hw->eeprom.word_size) ||
> - ((first + length) >= hw->eeprom.word_size))
> + if ((first > hw->eeprom.word_size) ||
> + ((first + length) > hw->eeprom.word_size))
> return -EINVAL;
>
> in_eeprom->magic = hw->vendor_id | (hw->device_id << 16);
> --
Acked-by: Konstantin Ananyev <konstantin.ananyev at intel.com>
> 1.9.3
More information about the dev
mailing list