Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp3967446ybc; Thu, 21 Nov 2019 17:09:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzJZpy7Gl/6Rqznvdu+0unxGZg19vl91dUmMdFz3ETxjeV0q1CWhwAO73v+LTvq4KM9mKsN X-Received: by 2002:a17:906:2241:: with SMTP id 1mr17974544ejr.16.1574384961329; Thu, 21 Nov 2019 17:09:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574384961; cv=none; d=google.com; s=arc-20160816; b=Bx0Ew/BZU1tVl0aLSNISockNRPGKWY+mz+MzW0deA+ceNG6j0IcP4oizy9LhLpV9EK QxQKTJvQVxXKiHG5Hz8l+464GPJKm6dZksE/5ywgGlM2aj5VEcGAvD39825V1KJ8fv1j QUMKISLtcdY7HAfWmvE0NoXkVO+0HbuOQhM5JOznlWans3rVRGAcDjDA2tOT6YzTphjy iBEEm6xp2JyeIujNaqqVuDXF/U4sQP9kAg/aw6ZPWryrocGX9zeKhoEuP3iO4jIWf4EY Y5bSvoIy1/sgDt6py5XoqInA6dG1SCeE3LuPxiHwP/eO+g31u+qDT9b0UxqAFD/ojx2v 9qhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from; bh=oQryy69ArEkC/FZqpGLKfHx7LMBCdIirWxpR0Ulfhqs=; b=SomVEVgYJxkFXak6SyG0d9m2i5Ba2Szkw7PtNNdX/HId8+A4k4gNwYERl7+8DfLjYx gu55k5H2NqMHZdO9dimy0IG+yYoyVnrYzbMycQFsXYH9KsXt+81Y0pci6N57gwh5wNFH rFZBoICuzpMWcq4rJw+ssGuilzy0+7TUceOX49iqfjI++Q4WdsItlFBpUFsCTfq4o1hz 8eJtfT8aoyUA+88yGtsg9VTZwlv+vuhLUeIIfvgSybTnq/aS5sV23f959Qu958Hecj+b ITKyhvLVFm9y/h/tGEhxBAen4Dc/zqqqRj1+8ODPOAfJ6y88rR+tax/cP21Efq/a/pdA Zg5g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f25si3030750eje.225.2019.11.21.17.08.57; Thu, 21 Nov 2019 17:09:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726540AbfKVBIw (ORCPT + 99 others); Thu, 21 Nov 2019 20:08:52 -0500 Received: from stargate.chelsio.com ([12.32.117.8]:16792 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbfKVBIv (ORCPT ); Thu, 21 Nov 2019 20:08:51 -0500 Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id xAM18jhG011887; Thu, 21 Nov 2019 17:08:46 -0800 From: Rahul Lakkireddy To: netdev@vger.kernel.org, linux-crypto@vger.kernel.org Cc: davem@davemloft.net, herbert@gondor.apana.org.au, nirranjan@chelsio.com, atul.gupta@chelsio.com, vishal@chelsio.com, dt@chelsio.com Subject: [PATCH net-next v2 3/3] cxgb4: add stats for MQPRIO QoS offload Tx path Date: Fri, 22 Nov 2019 06:30:03 +0530 Message-Id: <28488132436a491f5fd8fa7da8e84694e70ef9d5.1574383652.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Export necessary stats for traffic flowing through MQPRIO QoS offload Tx path. v2: - No change. Signed-off-by: Rahul Lakkireddy --- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 1 + drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c | 13 ++++++++++++- drivers/net/ethernet/chelsio/cxgb4/sge.c | 14 ++++++++++++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 04cb8909feeb..a70ac2097892 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h @@ -850,6 +850,7 @@ struct sge_eohw_txq { struct sge_txq q; /* HW Txq */ struct adapter *adap; /* Backpointer to adapter */ unsigned long tso; /* # of TSO requests */ + unsigned long uso; /* # of USO requests */ unsigned long tx_cso; /* # of Tx checksum offloads */ unsigned long vlan_ins; /* # of Tx VLAN insertions */ unsigned long mapping_err; /* # of I/O MMU packet mapping errors */ diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c index fa229d0f1016..93868dca186a 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c @@ -2797,6 +2797,7 @@ do { \ RL("RxAN", stats.an); RL("RxNoMem", stats.nomem); TL("TSO:", tso); + TL("USO:", uso); TL("TxCSO:", tx_cso); TL("VLANins:", vlan_ins); TL("TxQFull:", q.stops); diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c index f57457453561..20ab3b6285a2 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_ethtool.c @@ -242,9 +242,10 @@ static void collect_sge_port_stats(const struct adapter *adap, const struct port_info *p, struct queue_port_stats *s) { - int i; const struct sge_eth_txq *tx = &adap->sge.ethtxq[p->first_qset]; const struct sge_eth_rxq *rx = &adap->sge.ethrxq[p->first_qset]; + struct sge_eohw_txq *eohw_tx; + unsigned int i; memset(s, 0, sizeof(*s)); for (i = 0; i < p->nqsets; i++, rx++, tx++) { @@ -257,6 +258,16 @@ static void collect_sge_port_stats(const struct adapter *adap, s->gro_pkts += rx->stats.lro_pkts; s->gro_merged += rx->stats.lro_merged; } + + if (adap->sge.eohw_txq) { + eohw_tx = &adap->sge.eohw_txq[p->first_qset]; + for (i = 0; i < p->nqsets; i++, eohw_tx++) { + s->tso += eohw_tx->tso; + s->uso += eohw_tx->uso; + s->tx_csum += eohw_tx->tx_cso; + s->vlan_ins += eohw_tx->vlan_ins; + } + } } static void collect_adapter_stats(struct adapter *adap, struct adapter_stats *s) diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c index 53f9a821c29f..97cda501e7e8 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/sge.c +++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c @@ -2262,6 +2262,19 @@ static void ethofld_hard_xmit(struct net_device *dev, d->addr); } + if (skb_shinfo(skb)->gso_size) { + if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) + eohw_txq->uso++; + else + eohw_txq->tso++; + eohw_txq->tx_cso += skb_shinfo(skb)->gso_segs; + } else if (skb->ip_summed == CHECKSUM_PARTIAL) { + eohw_txq->tx_cso++; + } + + if (skb_vlan_tag_present(skb)) + eohw_txq->vlan_ins++; + txq_advance(&eohw_txq->q, ndesc); cxgb4_ring_tx_db(adap, &eohw_txq->q, ndesc); eosw_txq_advance_index(&eosw_txq->last_pidx, 1, eosw_txq->ndesc); @@ -4546,6 +4559,7 @@ int t4_sge_alloc_ethofld_txq(struct adapter *adap, struct sge_eohw_txq *txq, spin_lock_init(&txq->lock); txq->adap = adap; txq->tso = 0; + txq->uso = 0; txq->tx_cso = 0; txq->vlan_ins = 0; txq->mapping_err = 0; -- 2.24.0