DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro
@ 2015-10-12 13:33 Harry van Haaren
  2015-10-12 13:33 ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
  2015-10-12 13:33 ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
  0 siblings, 2 replies; 16+ messages in thread
From: Harry van Haaren @ 2015-10-12 13:33 UTC (permalink / raw)
  To: dev

The following two patches fix a misinterpretation of the cyclic
counters of igb and ixgbe VF. When the 32bit value wraps around,
the code now handles the wrapped new value appropriatly.

Harry van Haaren (2):
  ixgbe: fix VF statistic wraparound handling macro
  igb: fix VF statistic wraparound handling macro

 drivers/net/e1000/igb_ethdev.c   | 6 +++++-
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

-- 
1.9.1

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

* [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 13:33 [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
@ 2015-10-12 13:33 ` Harry van Haaren
  2015-10-12 14:45   ` Roger B. Melton
  2015-10-12 15:41   ` Alexander Duyck
  2015-10-12 13:33 ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
  1 sibling, 2 replies; 16+ messages in thread
From: Harry van Haaren @ 2015-10-12 13:33 UTC (permalink / raw)
  To: dev

Fix a misinterpretation of VF stats in ixgbe

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ec2918c..d226e8d 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -329,10 +329,14 @@ static int ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 /*
  * Define VF Stats MACRO for Non "cleared on read" register
  */
-#define UPDATE_VF_STAT(reg, last, cur)	                        \
+#define UPDATE_VF_STAT(reg, last, cur)                          \
 {                                                               \
 	uint32_t latest = IXGBE_READ_REG(hw, reg);              \
-	cur += latest - last;                                   \
+	if(likely(latest > last)) {                             \
+		cur += latest - last;                           \
+	} else {                                                \
+		cur += (UINT_MAX - last) + latest;              \
+	}                                                       \
 	last = latest;                                          \
 }
 
-- 
1.9.1

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

* [dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro
  2015-10-12 13:33 [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
  2015-10-12 13:33 ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
@ 2015-10-12 13:33 ` Harry van Haaren
  2015-10-12 15:02   ` Roger B. Melton
  1 sibling, 1 reply; 16+ messages in thread
From: Harry van Haaren @ 2015-10-12 13:33 UTC (permalink / raw)
  To: dev

Fix a misinterpreatation of VF statistic macro in e1000/igb.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 848ef6e..e3f7402 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -246,7 +246,11 @@ static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev);
 #define UPDATE_VF_STAT(reg, last, cur)            \
 {                                                 \
 	u32 latest = E1000_READ_REG(hw, reg);     \
-	cur += latest - last;                     \
+	if(likely(latest > last)) {               \
+		cur += latest - last;             \
+	} else {                                  \
+		cur += (UINT_MAX - last) + latest;\
+	}                                         \
 	last = latest;                            \
 }
 
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 13:33 ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
@ 2015-10-12 14:45   ` Roger B. Melton
  2015-10-12 15:41   ` Alexander Duyck
  1 sibling, 0 replies; 16+ messages in thread
From: Roger B. Melton @ 2015-10-12 14:45 UTC (permalink / raw)
  To: dev

ack

On 10/12/15 9:33 AM, Harry van Haaren wrote:
> Fix a misinterpretation of VF stats in ixgbe
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>   drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ec2918c..d226e8d 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -329,10 +329,14 @@ static int ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
>   /*
>    * Define VF Stats MACRO for Non "cleared on read" register
>    */
> -#define UPDATE_VF_STAT(reg, last, cur)	                        \
> +#define UPDATE_VF_STAT(reg, last, cur)                          \
>   {                                                               \
>   	uint32_t latest = IXGBE_READ_REG(hw, reg);              \
> -	cur += latest - last;                                   \
> +	if(likely(latest > last)) {                             \
> +		cur += latest - last;                           \
> +	} else {                                                \
> +		cur += (UINT_MAX - last) + latest;              \
> +	}                                                       \
>   	last = latest;                                          \
>   }
>   

-- 
  ____________________________________________________________________
|Roger B. Melton                |          |      Cisco Systems      |
|CPP Software                  :|:        :|:     7100 Kit Creek Rd  |
|+1.919.476.2332 phone        :|||:      :|||:    RTP, NC 27709-4987 |
|+1.919.392.1094 fax       .:|||||||:..:|||||||:. rmelton@cisco.com  |
|                                                                    |
| This email may contain confidential and privileged material for the|
| sole use of the intended recipient. Any review, use, distribution  |
| or disclosure by others is strictly prohibited. If you are not the |
| intended recipient (or authorized to receive for the recipient),   |
| please contact the sender by reply email and delete all copies of  |
| this message.                                                      |
|                                                                    |
| For corporate legal information go to:                             |
| http://www.cisco.com/web/about/doing_business/legal/cri/index.html |
|__________________________ http://www.cisco.com ____________________|

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

* Re: [dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro
  2015-10-12 13:33 ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
@ 2015-10-12 15:02   ` Roger B. Melton
  0 siblings, 0 replies; 16+ messages in thread
From: Roger B. Melton @ 2015-10-12 15:02 UTC (permalink / raw)
  To: dev

ack

On 10/12/15 9:33 AM, Harry van Haaren wrote:
> Fix a misinterpreatation of VF statistic macro in e1000/igb.
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>   drivers/net/e1000/igb_ethdev.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
> index 848ef6e..e3f7402 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -246,7 +246,11 @@ static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev);
>   #define UPDATE_VF_STAT(reg, last, cur)            \
>   {                                                 \
>   	u32 latest = E1000_READ_REG(hw, reg);     \
> -	cur += latest - last;                     \
> +	if(likely(latest > last)) {               \
> +		cur += latest - last;             \
> +	} else {                                  \
> +		cur += (UINT_MAX - last) + latest;\
> +	}                                         \
>   	last = latest;                            \
>   }
>   

-- 
  ____________________________________________________________________
|Roger B. Melton                |          |      Cisco Systems      |
|CPP Software                  :|:        :|:     7100 Kit Creek Rd  |
|+1.919.476.2332 phone        :|||:      :|||:    RTP, NC 27709-4987 |
|+1.919.392.1094 fax       .:|||||||:..:|||||||:. rmelton@cisco.com  |
|                                                                    |
| This email may contain confidential and privileged material for the|
| sole use of the intended recipient. Any review, use, distribution  |
| or disclosure by others is strictly prohibited. If you are not the |
| intended recipient (or authorized to receive for the recipient),   |
| please contact the sender by reply email and delete all copies of  |
| this message.                                                      |
|                                                                    |
| For corporate legal information go to:                             |
| http://www.cisco.com/web/about/doing_business/legal/cri/index.html |
|__________________________ http://www.cisco.com ____________________|

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

* Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 13:33 ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
  2015-10-12 14:45   ` Roger B. Melton
@ 2015-10-12 15:41   ` Alexander Duyck
  2015-10-12 16:45     ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
  2015-10-13 19:43     ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Roger B. Melton
  1 sibling, 2 replies; 16+ messages in thread
From: Alexander Duyck @ 2015-10-12 15:41 UTC (permalink / raw)
  To: Harry van Haaren, dev

On 10/12/2015 06:33 AM, Harry van Haaren wrote:
> Fix a misinterpretation of VF stats in ixgbe
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>   drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ec2918c..d226e8d 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -329,10 +329,14 @@ static int ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
>   /*
>    * Define VF Stats MACRO for Non "cleared on read" register
>    */
> -#define UPDATE_VF_STAT(reg, last, cur)	                        \
> +#define UPDATE_VF_STAT(reg, last, cur)                          \
>   {                                                               \
>   	uint32_t latest = IXGBE_READ_REG(hw, reg);              \
> -	cur += latest - last;                                   \
> +	if(likely(latest > last)) {                             \
> +		cur += latest - last;                           \
> +	} else {                                                \
> +		cur += (UINT_MAX - last) + latest;              \
> +	}                                                       \
>   	last = latest;                                          \
>   }
>   

 From what I can tell your math is adding an off by one error.  You 
should probably be using UINT_MAX as a mask for the result, not as a 
part of the calculation itself.

So the correct way to compute this would be "cur += (latest - last) & 
UINT_MAX".  Also the mask approach should be faster as it avoids any 
conditional jumps.

- Alex

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

* [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro
  2015-10-12 15:41   ` Alexander Duyck
@ 2015-10-12 16:45     ` Harry van Haaren
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
                         ` (2 more replies)
  2015-10-13 19:43     ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Roger B. Melton
  1 sibling, 3 replies; 16+ messages in thread
From: Harry van Haaren @ 2015-10-12 16:45 UTC (permalink / raw)
  To: dev

The following two patches fix a misinterpretation of the cyclic
counters of igb and ixgbe VF. When the 32bit value wraps around,
the code now handles the wrapped new value appropriatly.

v2:
- Reimplemented with Alex's suggested fix for off-by-one

v1:
- Initial implementation

Harry van Haaren (2):
  ixgbe: fix VF statistic wraparound handling macro
  igb: fix VF statistic wraparound handling macro

 drivers/net/e1000/igb_ethdev.c   | 3 +--
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

-- 
1.9.1

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

* [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 16:45     ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
@ 2015-10-12 16:45       ` Harry van Haaren
  2015-10-13 19:43         ` Roger B. Melton
                           ` (2 more replies)
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
  2015-10-28 13:40       ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Thomas Monjalon
  2 siblings, 3 replies; 16+ messages in thread
From: Harry van Haaren @ 2015-10-12 16:45 UTC (permalink / raw)
  To: dev

Fix a misinterpretation of VF stats in ixgbe

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index ec2918c..86dcd87 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -329,10 +329,10 @@ static int ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
 /*
  * Define VF Stats MACRO for Non "cleared on read" register
  */
-#define UPDATE_VF_STAT(reg, last, cur)	                        \
+#define UPDATE_VF_STAT(reg, last, cur)                          \
 {                                                               \
 	uint32_t latest = IXGBE_READ_REG(hw, reg);              \
-	cur += latest - last;                                   \
+	cur += (latest-last) & UINT_MAX;                        \
 	last = latest;                                          \
 }
 
-- 
1.9.1

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

* [dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro
  2015-10-12 16:45     ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
@ 2015-10-12 16:45       ` Harry van Haaren
  2015-10-13 19:44         ` Roger B. Melton
  2015-10-14 10:16         ` Roger B. Melton
  2015-10-28 13:40       ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Thomas Monjalon
  2 siblings, 2 replies; 16+ messages in thread
From: Harry van Haaren @ 2015-10-12 16:45 UTC (permalink / raw)
  To: dev

Fix a misinterpreatation of VF statistic macro in e1000/igb.

Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
---
 drivers/net/e1000/igb_ethdev.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 848ef6e..e4911fc 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -246,11 +246,10 @@ static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev);
 #define UPDATE_VF_STAT(reg, last, cur)            \
 {                                                 \
 	u32 latest = E1000_READ_REG(hw, reg);     \
-	cur += latest - last;                     \
+	cur += (latest-last) & UINT_MAX;          \
 	last = latest;                            \
 }
 
-
 #define IGB_FC_PAUSE_TIME 0x0680
 #define IGB_LINK_UPDATE_CHECK_TIMEOUT  90  /* 9s */
 #define IGB_LINK_UPDATE_CHECK_INTERVAL 100 /* ms */
-- 
1.9.1

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

* Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 15:41   ` Alexander Duyck
  2015-10-12 16:45     ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
@ 2015-10-13 19:43     ` Roger B. Melton
  1 sibling, 0 replies; 16+ messages in thread
From: Roger B. Melton @ 2015-10-13 19:43 UTC (permalink / raw)
  To: dev

Agreed, this handles the off by one error on wrap around and should be 
faster.

-Roger


On 10/12/15 11:41 AM, Alexander Duyck wrote:
> On 10/12/2015 06:33 AM, Harry van Haaren wrote:
>> Fix a misinterpretation of VF stats in ixgbe
>>
>> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
>> ---
>>   drivers/net/ixgbe/ixgbe_ethdev.c | 8 ++++++--
>>   1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c 
>> b/drivers/net/ixgbe/ixgbe_ethdev.c
>> index ec2918c..d226e8d 100644
>> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
>> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
>> @@ -329,10 +329,14 @@ static int 
>> ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
>>   /*
>>    * Define VF Stats MACRO for Non "cleared on read" register
>>    */
>> -#define UPDATE_VF_STAT(reg, last, cur)                            \
>> +#define UPDATE_VF_STAT(reg, last, cur) \
>> { \
>>       uint32_t latest = IXGBE_READ_REG(hw, reg);              \
>> -    cur += latest - last;                                   \
>> +    if(likely(latest > last)) { \
>> +        cur += latest - last;                           \
>> +    } else {                                                \
>> +        cur += (UINT_MAX - last) + latest;              \
>> +    }                                                       \
>>       last = latest;                                          \
>>   }
>
> From what I can tell your math is adding an off by one error.  You 
> should probably be using UINT_MAX as a mask for the result, not as a 
> part of the calculation itself.
>
> So the correct way to compute this would be "cur += (latest - last) & 
> UINT_MAX".  Also the mask approach should be faster as it avoids any 
> conditional jumps.
>
> - Alex
> .
>

-- 
  ____________________________________________________________________
|Roger B. Melton                |          |      Cisco Systems      |
|CPP Software                  :|:        :|:     7100 Kit Creek Rd  |
|+1.919.476.2332 phone        :|||:      :|||:    RTP, NC 27709-4987 |
|+1.919.392.1094 fax       .:|||||||:..:|||||||:. rmelton@cisco.com  |
|                                                                    |
| This email may contain confidential and privileged material for the|
| sole use of the intended recipient. Any review, use, distribution  |
| or disclosure by others is strictly prohibited. If you are not the |
| intended recipient (or authorized to receive for the recipient),   |
| please contact the sender by reply email and delete all copies of  |
| this message.                                                      |
|                                                                    |
| For corporate legal information go to:                             |
| http://www.cisco.com/web/about/doing_business/legal/cri/index.html |
|__________________________ http://www.cisco.com ____________________|

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

* Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
@ 2015-10-13 19:43         ` Roger B. Melton
  2015-10-14 10:15         ` Roger B. Melton
  2015-10-28 13:37         ` Thomas Monjalon
  2 siblings, 0 replies; 16+ messages in thread
From: Roger B. Melton @ 2015-10-13 19:43 UTC (permalink / raw)
  To: dev

ack

On 10/12/15 12:45 PM, Harry van Haaren wrote:
> Fix a misinterpretation of VF stats in ixgbe
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>   drivers/net/ixgbe/ixgbe_ethdev.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
> index ec2918c..86dcd87 100644
> --- a/drivers/net/ixgbe/ixgbe_ethdev.c
> +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
> @@ -329,10 +329,10 @@ static int ixgbe_timesync_read_tx_timestamp(struct rte_eth_dev *dev,
>   /*
>    * Define VF Stats MACRO for Non "cleared on read" register
>    */
> -#define UPDATE_VF_STAT(reg, last, cur)	                        \
> +#define UPDATE_VF_STAT(reg, last, cur)                          \
>   {                                                               \
>   	uint32_t latest = IXGBE_READ_REG(hw, reg);              \
> -	cur += latest - last;                                   \
> +	cur += (latest-last) & UINT_MAX;                        \
>   	last = latest;                                          \
>   }
>   

-- 
  ____________________________________________________________________
|Roger B. Melton                |          |      Cisco Systems      |
|CPP Software                  :|:        :|:     7100 Kit Creek Rd  |
|+1.919.476.2332 phone        :|||:      :|||:    RTP, NC 27709-4987 |
|+1.919.392.1094 fax       .:|||||||:..:|||||||:. rmelton@cisco.com  |
|                                                                    |
| This email may contain confidential and privileged material for the|
| sole use of the intended recipient. Any review, use, distribution  |
| or disclosure by others is strictly prohibited. If you are not the |
| intended recipient (or authorized to receive for the recipient),   |
| please contact the sender by reply email and delete all copies of  |
| this message.                                                      |
|                                                                    |
| For corporate legal information go to:                             |
| http://www.cisco.com/web/about/doing_business/legal/cri/index.html |
|__________________________ http://www.cisco.com ____________________|

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

* Re: [dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
@ 2015-10-13 19:44         ` Roger B. Melton
  2015-10-14 10:16         ` Roger B. Melton
  1 sibling, 0 replies; 16+ messages in thread
From: Roger B. Melton @ 2015-10-13 19:44 UTC (permalink / raw)
  To: dev

ack

On 10/12/15 12:45 PM, Harry van Haaren wrote:
> Fix a misinterpreatation of VF statistic macro in e1000/igb.
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>
> ---
>   drivers/net/e1000/igb_ethdev.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
> index 848ef6e..e4911fc 100644
> --- a/drivers/net/e1000/igb_ethdev.c
> +++ b/drivers/net/e1000/igb_ethdev.c
> @@ -246,11 +246,10 @@ static void eth_igb_configure_msix_intr(struct rte_eth_dev *dev);
>   #define UPDATE_VF_STAT(reg, last, cur)            \
>   {                                                 \
>   	u32 latest = E1000_READ_REG(hw, reg);     \
> -	cur += latest - last;                     \
> +	cur += (latest-last) & UINT_MAX;          \
>   	last = latest;                            \
>   }
>   
> -
>   #define IGB_FC_PAUSE_TIME 0x0680
>   #define IGB_LINK_UPDATE_CHECK_TIMEOUT  90  /* 9s */
>   #define IGB_LINK_UPDATE_CHECK_INTERVAL 100 /* ms */

-- 
  ____________________________________________________________________
|Roger B. Melton                |          |      Cisco Systems      |
|CPP Software                  :|:        :|:     7100 Kit Creek Rd  |
|+1.919.476.2332 phone        :|||:      :|||:    RTP, NC 27709-4987 |
|+1.919.392.1094 fax       .:|||||||:..:|||||||:. rmelton@cisco.com  |
|                                                                    |
| This email may contain confidential and privileged material for the|
| sole use of the intended recipient. Any review, use, distribution  |
| or disclosure by others is strictly prohibited. If you are not the |
| intended recipient (or authorized to receive for the recipient),   |
| please contact the sender by reply email and delete all copies of  |
| this message.                                                      |
|                                                                    |
| For corporate legal information go to:                             |
| http://www.cisco.com/web/about/doing_business/legal/cri/index.html |
|__________________________ http://www.cisco.com ____________________|

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

* Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
  2015-10-13 19:43         ` Roger B. Melton
@ 2015-10-14 10:15         ` Roger B. Melton
  2015-10-28 13:37         ` Thomas Monjalon
  2 siblings, 0 replies; 16+ messages in thread
From: Roger B. Melton @ 2015-10-14 10:15 UTC (permalink / raw)
  To: dev



On 10/12/15 12:45 PM, Harry van Haaren wrote:
> Fix a misinterpretation of VF stats in ixgbe
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

Acked-by: Roger Melton <rmelton@cisco.com>

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

* Re: [dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
  2015-10-13 19:44         ` Roger B. Melton
@ 2015-10-14 10:16         ` Roger B. Melton
  1 sibling, 0 replies; 16+ messages in thread
From: Roger B. Melton @ 2015-10-14 10:16 UTC (permalink / raw)
  To: dev



On 10/12/15 12:45 PM, Harry van Haaren wrote:
> Fix a misinterpreatation of VF statistic macro in e1000/igb.
>
> Signed-off-by: Harry van Haaren <harry.van.haaren@intel.com>

Acked-by: Roger Melton <rmelton@cisco.com>

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

* Re: [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
  2015-10-13 19:43         ` Roger B. Melton
  2015-10-14 10:15         ` Roger B. Melton
@ 2015-10-28 13:37         ` Thomas Monjalon
  2 siblings, 0 replies; 16+ messages in thread
From: Thomas Monjalon @ 2015-10-28 13:37 UTC (permalink / raw)
  To: dev

2015-10-12 17:45, Harry van Haaren:
> -	cur += latest - last;                                   \
> +	cur += (latest-last) & UINT_MAX;                        \

CHECK:SPACING: spaces preferred around that '-' (ctx:VxV)

Please use checkpatch before submitting.
Thanks

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

* Re: [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro
  2015-10-12 16:45     ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
  2015-10-12 16:45       ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
@ 2015-10-28 13:40       ` Thomas Monjalon
  2 siblings, 0 replies; 16+ messages in thread
From: Thomas Monjalon @ 2015-10-28 13:40 UTC (permalink / raw)
  To: Harry van Haaren; +Cc: dev

2015-10-12 17:45, Harry van Haaren:
> The following two patches fix a misinterpretation of the cyclic
> counters of igb and ixgbe VF. When the 32bit value wraps around,
> the code now handles the wrapped new value appropriatly.
> 
> v2:
> - Reimplemented with Alex's suggested fix for off-by-one
> 
> v1:
> - Initial implementation
> 
> Harry van Haaren (2):
>   ixgbe: fix VF statistic wraparound handling macro
>   igb: fix VF statistic wraparound handling macro

Applied (with spacing fixes), thanks

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

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

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-12 13:33 [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
2015-10-12 13:33 ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
2015-10-12 14:45   ` Roger B. Melton
2015-10-12 15:41   ` Alexander Duyck
2015-10-12 16:45     ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Harry van Haaren
2015-10-12 16:45       ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Harry van Haaren
2015-10-13 19:43         ` Roger B. Melton
2015-10-14 10:15         ` Roger B. Melton
2015-10-28 13:37         ` Thomas Monjalon
2015-10-12 16:45       ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
2015-10-13 19:44         ` Roger B. Melton
2015-10-14 10:16         ` Roger B. Melton
2015-10-28 13:40       ` [dpdk-dev] [PATCH 0/2] fix vf statistic wraparound handling in macro Thomas Monjalon
2015-10-13 19:43     ` [dpdk-dev] [PATCH 1/2] ixgbe: fix VF statistic wraparound handling macro Roger B. Melton
2015-10-12 13:33 ` [dpdk-dev] [PATCH 2/2] igb: " Harry van Haaren
2015-10-12 15:02   ` Roger B. Melton

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