From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julian Wiedmann Subject: [PATCH net-next 08/13] s390/qeth: add stats counter for RX csum offload Date: Thu, 26 Apr 2018 09:42:19 +0200 Message-ID: <20180426074224.100432-9-jwi@linux.ibm.com> References: <20180426074224.100432-1-jwi@linux.ibm.com> Cc: , , Martin Schwidefsky , Heiko Carstens , Stefan Raspl , Ursula Braun , Julian Wiedmann To: David Miller Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41934 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754117AbeDZHnL (ORCPT ); Thu, 26 Apr 2018 03:43:11 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w3Q7fjKr118296 for ; Thu, 26 Apr 2018 03:43:11 -0400 Received: from e06smtp11.uk.ibm.com (e06smtp11.uk.ibm.com [195.75.94.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hk96uutj5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 26 Apr 2018 03:43:10 -0400 Received: from localhost by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 26 Apr 2018 08:43:08 +0100 In-Reply-To: <20180426074224.100432-1-jwi@linux.ibm.com> Sender: netdev-owner@vger.kernel.org List-ID: From: Kittipon Meesompop This matches the statistics we gather for the TX offload path. Signed-off-by: Kittipon Meesompop Signed-off-by: Julian Wiedmann --- drivers/s390/net/qeth_core.h | 8 ++++++-- drivers/s390/net/qeth_core_main.c | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 2cfeae485a08..e8108f6891b2 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -148,6 +148,7 @@ struct qeth_perf_stats { unsigned int tx_csum; unsigned int tx_lin; unsigned int tx_linfail; + unsigned int rx_csum; }; /* Routing stuff */ @@ -868,10 +869,13 @@ static inline void qeth_rx_csum(struct qeth_card *card, struct sk_buff *skb, u8 flags) { if ((card->dev->features & NETIF_F_RXCSUM) && - (flags & QETH_HDR_EXT_CSUM_TRANSP_REQ)) + (flags & QETH_HDR_EXT_CSUM_TRANSP_REQ)) { skb->ip_summed = CHECKSUM_UNNECESSARY; - else + if (card->options.performance_stats) + card->perf_stats.rx_csum++; + } else { skb->ip_summed = CHECKSUM_NONE; + } } static inline void qeth_tx_csum(struct sk_buff *skb, u8 *flags) diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 7feb50ac0a8b..b90f38d78ad9 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -6005,7 +6005,8 @@ static struct { {"tx lin"}, {"tx linfail"}, {"cq handler count"}, - {"cq handler time"} + {"cq handler time"}, + {"rx csum"} }; int qeth_core_get_sset_count(struct net_device *dev, int stringset) @@ -6067,6 +6068,7 @@ void qeth_core_get_ethtool_stats(struct net_device *dev, data[35] = card->perf_stats.tx_linfail; data[36] = card->perf_stats.cq_cnt; data[37] = card->perf_stats.cq_time; + data[38] = card->perf_stats.rx_csum; } EXPORT_SYMBOL_GPL(qeth_core_get_ethtool_stats); -- 2.13.5 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julian Wiedmann Subject: [PATCH net-next 08/13] s390/qeth: add stats counter for RX csum offload Date: Thu, 26 Apr 2018 09:42:19 +0200 Message-ID: <20180426074224.100432-9-jwi@linux.ibm.com> References: <20180426074224.100432-1-jwi@linux.ibm.com> Return-path: In-Reply-To: <20180426074224.100432-1-jwi@linux.ibm.com> Sender: netdev-owner@vger.kernel.org List-Archive: List-Post: To: David Miller Cc: netdev@vger.kernel.org, linux-s390@vger.kernel.org, Martin Schwidefsky , Heiko Carstens , Stefan Raspl , Ursula Braun , Julian Wiedmann List-ID: From: Kittipon Meesompop This matches the statistics we gather for the TX offload path. Signed-off-by: Kittipon Meesompop Signed-off-by: Julian Wiedmann --- drivers/s390/net/qeth_core.h | 8 ++++++-- drivers/s390/net/qeth_core_main.c | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h index 2cfeae485a08..e8108f6891b2 100644 --- a/drivers/s390/net/qeth_core.h +++ b/drivers/s390/net/qeth_core.h @@ -148,6 +148,7 @@ struct qeth_perf_stats { unsigned int tx_csum; unsigned int tx_lin; unsigned int tx_linfail; + unsigned int rx_csum; }; /* Routing stuff */ @@ -868,10 +869,13 @@ static inline void qeth_rx_csum(struct qeth_card *card, struct sk_buff *skb, u8 flags) { if ((card->dev->features & NETIF_F_RXCSUM) && - (flags & QETH_HDR_EXT_CSUM_TRANSP_REQ)) + (flags & QETH_HDR_EXT_CSUM_TRANSP_REQ)) { skb->ip_summed = CHECKSUM_UNNECESSARY; - else + if (card->options.performance_stats) + card->perf_stats.rx_csum++; + } else { skb->ip_summed = CHECKSUM_NONE; + } } static inline void qeth_tx_csum(struct sk_buff *skb, u8 *flags) diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c index 7feb50ac0a8b..b90f38d78ad9 100644 --- a/drivers/s390/net/qeth_core_main.c +++ b/drivers/s390/net/qeth_core_main.c @@ -6005,7 +6005,8 @@ static struct { {"tx lin"}, {"tx linfail"}, {"cq handler count"}, - {"cq handler time"} + {"cq handler time"}, + {"rx csum"} }; int qeth_core_get_sset_count(struct net_device *dev, int stringset) @@ -6067,6 +6068,7 @@ void qeth_core_get_ethtool_stats(struct net_device *dev, data[35] = card->perf_stats.tx_linfail; data[36] = card->perf_stats.cq_cnt; data[37] = card->perf_stats.cq_time; + data[38] = card->perf_stats.rx_csum; } EXPORT_SYMBOL_GPL(qeth_core_get_ethtool_stats); -- 2.13.5