[dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro

2015-10-14 Thread Roger B. Melton


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 

Acked-by: Roger Melton 


[dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro

2015-10-13 Thread Roger B. Melton
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 
> ---
>   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 at 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 |



[dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro

2015-10-12 Thread Harry van Haaren
Fix a misinterpreatation of VF statistic macro in e1000/igb.

Signed-off-by: Harry van Haaren 
---
 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



[dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro

2015-10-12 Thread Harry van Haaren
Fix a misinterpreatation of VF statistic macro in e1000/igb.

Signed-off-by: Harry van Haaren 
---
 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



[dpdk-dev] [PATCH 2/2] igb: fix VF statistic wraparound handling macro

2015-10-12 Thread Roger B. Melton
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 
> ---
>   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 at 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 |