DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ixgbe: Out-by-one in get/set EEPROM
@ 2015-09-16 13:07 Remy Horton
  2015-09-16 13:23 ` Thomas Monjalon
  2015-09-17  9:05 ` [dpdk-dev] [PATCH v2] ixgbe: fix access to last byte of EEPROM Remy Horton
  0 siblings, 2 replies; 7+ messages in thread
From: Remy Horton @ 2015-09-16 13:07 UTC (permalink / raw)
  To: dev

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.

Signed-off-by: Remy Horton <remy.horton@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);
-- 
1.9.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH] ixgbe: Out-by-one in get/set EEPROM
  2015-09-16 13:07 [dpdk-dev] [PATCH] ixgbe: Out-by-one in get/set EEPROM Remy Horton
@ 2015-09-16 13:23 ` Thomas Monjalon
  2015-09-17  9:05 ` [dpdk-dev] [PATCH v2] ixgbe: fix access to last byte of EEPROM Remy Horton
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2015-09-16 13:23 UTC (permalink / raw)
  To: Remy Horton; +Cc: dev

2015-09-16 14:07, Remy Horton:
> 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.

This explanation is good but the title is not clear enough. It should
start with "ixgbe: fix". Fix what? I'd say "fix access to last byte of EEPROM".
Then creating a commit starting with "fix" should trigger 2 other things:
	- a Fixes: tag
	- an update in the release notes (because the bug exists in previous releases)

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v2] ixgbe: fix access to last byte of EEPROM
  2015-09-16 13:07 [dpdk-dev] [PATCH] ixgbe: Out-by-one in get/set EEPROM Remy Horton
  2015-09-16 13:23 ` Thomas Monjalon
@ 2015-09-17  9:05 ` Remy Horton
  2015-09-17 10:13   ` Thomas Monjalon
  2015-09-17 13:47   ` [dpdk-dev] [PATCH v3] " Remy Horton
  1 sibling, 2 replies; 7+ messages in thread
From: Remy Horton @ 2015-09-17  9:05 UTC (permalink / raw)
  To: dev

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.

Signed-off-by: Remy Horton <remy.horton@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);
-- 
1.9.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v2] ixgbe: fix access to last byte of EEPROM
  2015-09-17  9:05 ` [dpdk-dev] [PATCH v2] ixgbe: fix access to last byte of EEPROM Remy Horton
@ 2015-09-17 10:13   ` Thomas Monjalon
  2015-09-17 13:47   ` [dpdk-dev] [PATCH v3] " Remy Horton
  1 sibling, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2015-09-17 10:13 UTC (permalink / raw)
  To: Remy Horton; +Cc: dev

2015-09-17 10:05, Remy Horton:
> 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.
> 
> Signed-off-by: Remy Horton <remy.horton@intel.com>
> ---
>  drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

>From my previous comment:
"
Then creating a commit starting with "fix" should trigger 2 other things:
        - a Fixes: tag
        - an update in the release notes (because the bug exists in previous releases)
"

Maybe it does not deserve an entry in the release notes if the bug
has no real impact.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [dpdk-dev] [PATCH v3] ixgbe: fix access to last byte of EEPROM
  2015-09-17  9:05 ` [dpdk-dev] [PATCH v2] ixgbe: fix access to last byte of EEPROM Remy Horton
  2015-09-17 10:13   ` Thomas Monjalon
@ 2015-09-17 13:47   ` Remy Horton
  2015-09-21  9:13     ` Ananyev, Konstantin
  1 sibling, 1 reply; 7+ messages in thread
From: Remy Horton @ 2015-09-17 13:47 UTC (permalink / raw)
  To: dev

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@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);
-- 
1.9.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ixgbe: fix access to last byte of EEPROM
  2015-09-17 13:47   ` [dpdk-dev] [PATCH v3] " Remy Horton
@ 2015-09-21  9:13     ` Ananyev, Konstantin
  2015-10-28 16:15       ` Thomas Monjalon
  0 siblings, 1 reply; 7+ messages in thread
From: Ananyev, Konstantin @ 2015-09-21  9:13 UTC (permalink / raw)
  To: Horton, Remy, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Remy Horton
> Sent: Thursday, September 17, 2015 2:47 PM
> To: dev@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@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@intel.com>

> 1.9.3

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [dpdk-dev] [PATCH v3] ixgbe: fix access to last byte of EEPROM
  2015-09-21  9:13     ` Ananyev, Konstantin
@ 2015-10-28 16:15       ` Thomas Monjalon
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Monjalon @ 2015-10-28 16:15 UTC (permalink / raw)
  To: Horton, Remy; +Cc: dev

> > 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@intel.com>
> 
> Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-10-28 16:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16 13:07 [dpdk-dev] [PATCH] ixgbe: Out-by-one in get/set EEPROM Remy Horton
2015-09-16 13:23 ` Thomas Monjalon
2015-09-17  9:05 ` [dpdk-dev] [PATCH v2] ixgbe: fix access to last byte of EEPROM Remy Horton
2015-09-17 10:13   ` Thomas Monjalon
2015-09-17 13:47   ` [dpdk-dev] [PATCH v3] " Remy Horton
2015-09-21  9:13     ` Ananyev, Konstantin
2015-10-28 16:15       ` Thomas Monjalon

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).