Patchwork [net,5/7] igb: fix stats for i210 rx_fifo_errors

login
register
mail settings
Submitter Jeff Kirsher
Date April 19, 2014, 1:59 a.m.
Message ID <1397872767-4001-6-git-send-email-jeffrey.t.kirsher@intel.com>
Download mbox | patch
Permalink /patch/340451/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jeff Kirsher - April 19, 2014, 1:59 a.m.
From: Todd Fujinaka <todd.fujinaka@intel.com>

RQDPC on i210/i211 is R/W not ReadClear. Clear after reading.

Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Sergei Shtylyov - April 19, 2014, 9:58 p.m.
Hello.

On 04/19/2014 05:59 AM, Jeff Kirsher wrote:

> From: Todd Fujinaka <todd.fujinaka@intel.com>

> RQDPC on i210/i211 is R/W not ReadClear. Clear after reading.

> Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com>
> Tested-by: Aaron Brown <aaron.f.brown@intel.com>
> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
> ---
>   drivers/net/ethernet/intel/igb/igb_main.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index fb98d46..16430a8 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -5193,8 +5193,10 @@ void igb_update_stats(struct igb_adapter *adapter,
>
>   	rcu_read_lock();
>   	for (i = 0; i < adapter->num_rx_queues; i++) {
> -		u32 rqdpc = rd32(E1000_RQDPC(i));
>   		struct igb_ring *ring = adapter->rx_ring[i];
> +		u32 rqdpc = rd32(E1000_RQDPC(i));

    Empty line needed after declaration. It was present before this patch.

> +		if (hw->mac.type >= e1000_i210)
> +			wr32(E1000_RQDPC(i), 0);
>
>   		if (rqdpc) {
>   			ring->rx_stats.drops += rqdpc;

WBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index fb98d46..16430a8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -5193,8 +5193,10 @@  void igb_update_stats(struct igb_adapter *adapter,
 
 	rcu_read_lock();
 	for (i = 0; i < adapter->num_rx_queues; i++) {
-		u32 rqdpc = rd32(E1000_RQDPC(i));
 		struct igb_ring *ring = adapter->rx_ring[i];
+		u32 rqdpc = rd32(E1000_RQDPC(i));
+		if (hw->mac.type >= e1000_i210)
+			wr32(E1000_RQDPC(i), 0);
 
 		if (rqdpc) {
 			ring->rx_stats.drops += rqdpc;