Patchwork [net-next,3/3] cxgb4: report GRO stats with ethtool -S

login
register
mail settings
Submitter Dimitris Michailidis
Date May 11, 2010, 1:58 a.m.
Message ID <1273543089-10938-3-git-send-email-dm@chelsio.com>
Download mbox | patch
Permalink /patch/52271/
State Accepted
Delegated to: David Miller
Headers show

Comments

Dimitris Michailidis - May 11, 2010, 1:58 a.m.
Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
---
 drivers/net/cxgb4/cxgb4_main.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
Ben Greear - May 11, 2010, 3:02 a.m.
On 05/10/2010 06:58 PM, Dimitris Michailidis wrote:
> Signed-off-by: Dimitris Michailidis<dm@chelsio.com>

One of these is on-wire packets?  If so, maybe use the same
string as Intel ixgbe uses:

rx_pkts_nic  # Pkts received by NIC from wire.
rx_bytes_nic # Bytes received by NIC from wire.
tx_pkts_nic  # Pkts transmitted to wire by NIC.
tx_bytes_nic # Bytes transmitted to wire by NIC.

Thanks,
Ben



> ---
>   drivers/net/cxgb4/cxgb4_main.c |    6 ++++++
>   1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
> index 80c3fc5..90d375b 100644
> --- a/drivers/net/cxgb4/cxgb4_main.c
> +++ b/drivers/net/cxgb4/cxgb4_main.c
> @@ -859,6 +859,8 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
>   	"RxCsumGood         ",
>   	"VLANextractions    ",
>   	"VLANinsertions     ",
> +	"GROpackets         ",
> +	"GROmerged          ",
>   };
>
>   static int get_sset_count(struct net_device *dev, int sset)
> @@ -922,6 +924,8 @@ struct queue_port_stats {
>   	u64 rx_csum;
>   	u64 vlan_ex;
>   	u64 vlan_ins;
> +	u64 gro_pkts;
> +	u64 gro_merged;
>   };
>
>   static void collect_sge_port_stats(const struct adapter *adap,
> @@ -938,6 +942,8 @@ static void collect_sge_port_stats(const struct adapter *adap,
>   		s->rx_csum += rx->stats.rx_cso;
>   		s->vlan_ex += rx->stats.vlan_ex;
>   		s->vlan_ins += tx->vlan_ins;
> +		s->gro_pkts += rx->stats.lro_pkts;
> +		s->gro_merged += rx->stats.lro_merged;
>   	}
>   }
>
Dimitris Michailidis - May 11, 2010, 8:45 a.m.
Ben Greear wrote:
> On 05/10/2010 06:58 PM, Dimitris Michailidis wrote:
>> Signed-off-by: Dimitris Michailidis<dm@chelsio.com>
> 
> One of these is on-wire packets?  If so, maybe use the same
> string as Intel ixgbe uses:
> 
> rx_pkts_nic  # Pkts received by NIC from wire.
> rx_bytes_nic # Bytes received by NIC from wire.
> tx_pkts_nic  # Pkts transmitted to wire by NIC.
> tx_bytes_nic # Bytes transmitted to wire by NIC.

The two stats I'm adding don't correspond to any of the 4 above.  One is the 
superpackets coming out of GRO, the other is packets merged by GRO to create 
the superpackets.

> 
> Thanks,
> Ben
> 
> 
> 
>> ---
>>   drivers/net/cxgb4/cxgb4_main.c |    6 ++++++
>>   1 files changed, 6 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/net/cxgb4/cxgb4_main.c 
>> b/drivers/net/cxgb4/cxgb4_main.c
>> index 80c3fc5..90d375b 100644
>> --- a/drivers/net/cxgb4/cxgb4_main.c
>> +++ b/drivers/net/cxgb4/cxgb4_main.c
>> @@ -859,6 +859,8 @@ static char stats_strings[][ETH_GSTRING_LEN] = {
>>       "RxCsumGood         ",
>>       "VLANextractions    ",
>>       "VLANinsertions     ",
>> +    "GROpackets         ",
>> +    "GROmerged          ",
>>   };
>>
>>   static int get_sset_count(struct net_device *dev, int sset)
>> @@ -922,6 +924,8 @@ struct queue_port_stats {
>>       u64 rx_csum;
>>       u64 vlan_ex;
>>       u64 vlan_ins;
>> +    u64 gro_pkts;
>> +    u64 gro_merged;
>>   };
>>
>>   static void collect_sge_port_stats(const struct adapter *adap,
>> @@ -938,6 +942,8 @@ static void collect_sge_port_stats(const struct 
>> adapter *adap,
>>           s->rx_csum += rx->stats.rx_cso;
>>           s->vlan_ex += rx->stats.vlan_ex;
>>           s->vlan_ins += tx->vlan_ins;
>> +        s->gro_pkts += rx->stats.lro_pkts;
>> +        s->gro_merged += rx->stats.lro_merged;
>>       }
>>   }
>>
> 
> 

--
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
David Miller - May 13, 2010, 6:32 a.m.
From: Dimitris Michailidis <dm@chelsio.com>
Date: Mon, 10 May 2010 18:58:09 -0700

> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>

Applied.
--
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/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 80c3fc5..90d375b 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -859,6 +859,8 @@  static char stats_strings[][ETH_GSTRING_LEN] = {
 	"RxCsumGood         ",
 	"VLANextractions    ",
 	"VLANinsertions     ",
+	"GROpackets         ",
+	"GROmerged          ",
 };
 
 static int get_sset_count(struct net_device *dev, int sset)
@@ -922,6 +924,8 @@  struct queue_port_stats {
 	u64 rx_csum;
 	u64 vlan_ex;
 	u64 vlan_ins;
+	u64 gro_pkts;
+	u64 gro_merged;
 };
 
 static void collect_sge_port_stats(const struct adapter *adap,
@@ -938,6 +942,8 @@  static void collect_sge_port_stats(const struct adapter *adap,
 		s->rx_csum += rx->stats.rx_cso;
 		s->vlan_ex += rx->stats.vlan_ex;
 		s->vlan_ins += tx->vlan_ins;
+		s->gro_pkts += rx->stats.lro_pkts;
+		s->gro_merged += rx->stats.lro_merged;
 	}
 }