net/e1000: fix eeprom dump failure

Message ID 20250415074802.454733-1-yuanx.wang@intel.com (mailing list archive)
State Accepted
Delegated to: Bruce Richardson
Headers
Series net/e1000: fix eeprom dump failure |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-mellanox-Functional success Functional Testing PASS

Commit Message

Yuan Wang April 15, 2025, 7:48 a.m. UTC
There is a incorrect comparison in get_eeprom that cause epprom dump fail.
This patch fixes this issue.

Fixes: 83c314da4c38 (igb: add access to specific device info)
Cc: stable@dpdk.org

Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
---
 drivers/net/intel/e1000/igb_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Bruce Richardson April 28, 2025, 3:37 p.m. UTC | #1
On Tue, Apr 15, 2025 at 03:48:02PM +0800, Yuan Wang wrote:
> There is a incorrect comparison in get_eeprom that cause epprom dump fail.
> This patch fixes this issue.
> 
> Fixes: 83c314da4c38 (igb: add access to specific device info)
> Cc: stable@dpdk.org
> 
> Signed-off-by: Yuan Wang <yuanx.wang@intel.com>
> ---
>  drivers/net/intel/e1000/igb_ethdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/intel/e1000/igb_ethdev.c b/drivers/net/intel/e1000/igb_ethdev.c
> index cbd2f15f5f..738c0ef895 100644
> --- a/drivers/net/intel/e1000/igb_ethdev.c
> +++ b/drivers/net/intel/e1000/igb_ethdev.c
> @@ -5219,7 +5219,7 @@ eth_igb_get_eeprom(struct rte_eth_dev *dev,
>  	first = in_eeprom->offset >> 1;
>  	length = in_eeprom->length >> 1;
>  	if ((first >= hw->nvm.word_size) ||
> -	    ((first + length) >= hw->nvm.word_size))
> +	    ((first + length) > hw->nvm.word_size))
>  		return -EINVAL;
>  

Fix makes sense.
Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-net-intel

Thanks,
/Bruce
  

Patch

diff --git a/drivers/net/intel/e1000/igb_ethdev.c b/drivers/net/intel/e1000/igb_ethdev.c
index cbd2f15f5f..738c0ef895 100644
--- a/drivers/net/intel/e1000/igb_ethdev.c
+++ b/drivers/net/intel/e1000/igb_ethdev.c
@@ -5219,7 +5219,7 @@  eth_igb_get_eeprom(struct rte_eth_dev *dev,
 	first = in_eeprom->offset >> 1;
 	length = in_eeprom->length >> 1;
 	if ((first >= hw->nvm.word_size) ||
-	    ((first + length) >= hw->nvm.word_size))
+	    ((first + length) > hw->nvm.word_size))
 		return -EINVAL;
 
 	in_eeprom->magic = hw->vendor_id |