DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@qlogic.com>
To: <dev@dpdk.org>
Cc: <Dept-EngDPDKDev@qlogic.com>, Harish Patil <harish.patil@qlogic.com>
Subject: [dpdk-dev] [PATCH 2/2] qede: return LAN stats to MFW
Date: Fri, 6 May 2016 21:21:31 -0700	[thread overview]
Message-ID: <1462594891-21169-2-git-send-email-rasesh.mody@qlogic.com> (raw)
In-Reply-To: <1462594891-21169-1-git-send-email-rasesh.mody@qlogic.com>

From: Harish Patil <harish.patil@qlogic.com>

Under certain scenarios, MFW periodically polls the driver
for LAN statistics. This patch implements the osal hook to
fill in the stats.

Fixes: ffa002d318d36 ("qede: add base driver")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/base/bcm_osal.c |   21 +++++++++++++++++++++
 drivers/net/qede/base/bcm_osal.h |    9 ++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/drivers/net/qede/base/bcm_osal.c b/drivers/net/qede/base/bcm_osal.c
index 9540c4b..8a62056 100644
--- a/drivers/net/qede/base/bcm_osal.c
+++ b/drivers/net/qede/base/bcm_osal.c
@@ -15,6 +15,9 @@
 #include "ecore.h"
 #include "ecore_hw.h"
 #include "ecore_iov_api.h"
+#include "ecore_mcp_api.h"
+#include "ecore_l2_api.h"
+
 
 unsigned long qede_log2_align(unsigned long n)
 {
@@ -179,3 +182,21 @@ u32 qede_unzip_data(struct ecore_hwfn *p_hwfn, u32 input_len,
 
 	return p_hwfn->stream->total_out / 4;
 }
+
+void
+qede_get_mcp_proto_stats(struct ecore_dev *edev,
+			 enum ecore_mcp_protocol_type type,
+			 union ecore_mcp_protocol_stats *stats)
+{
+	struct ecore_eth_stats lan_stats;
+
+	if (type == ECORE_MCP_LAN_STATS) {
+		ecore_get_vport_stats(edev, &lan_stats);
+		stats->lan_stats.ucast_rx_pkts = lan_stats.rx_ucast_pkts;
+		stats->lan_stats.ucast_tx_pkts = lan_stats.tx_ucast_pkts;
+		stats->lan_stats.fcs_err = -1;
+	} else {
+		DP_INFO(edev, "Statistics request type %d not supported\n",
+		       type);
+	}
+}
diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h
index 47d056e..3e2aeb0 100644
--- a/drivers/net/qede/base/bcm_osal.h
+++ b/drivers/net/qede/base/bcm_osal.h
@@ -24,6 +24,9 @@ struct ecore_dev;
 struct ecore_hwfn;
 struct ecore_vf_acquire_sw_info;
 struct vf_pf_resc_request;
+enum ecore_mcp_protocol_type;
+union ecore_mcp_protocol_stats;
+
 void qed_link_update(struct ecore_hwfn *hwfn);
 
 #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN
@@ -390,7 +393,11 @@ u32 qede_osal_log2(u32);
 #define OSAL_MAX_T(type, __max1, __max2)	\
 	((type)(__max1) > (type)(__max2) ? (type)(__max1) : (type)(__max2))
 
-#define	OSAL_GET_PROTOCOL_STATS(p_hwfn, type, stats) (0)
+void qede_get_mcp_proto_stats(struct ecore_dev *, enum ecore_mcp_protocol_type,
+			      union ecore_mcp_protocol_stats *);
+#define	OSAL_GET_PROTOCOL_STATS(dev, type, stats) \
+	qede_get_mcp_proto_stats(dev, type, stats)
+
 #define	OSAL_SLOWPATH_IRQ_REQ(p_hwfn) (0)
 
 #endif /* __BCM_OSAL_H */
-- 
1.7.10.3

  reply	other threads:[~2016-05-07  4:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-07  4:21 [dpdk-dev] [PATCH 1/2] qede: rename config option Rasesh Mody
2016-05-07  4:21 ` Rasesh Mody [this message]
2016-05-30 14:34   ` [dpdk-dev] [PATCH 2/2] qede: return LAN stats to MFW Bruce Richardson
2016-05-31 19:21     ` Harish Patil
2016-06-01  9:43       ` Thomas Monjalon
2016-06-01 14:16         ` Harish Patil
2016-06-01 14:31           ` Richardson, Bruce
2016-06-01 14:33             ` Harish Patil
2016-05-30 14:38 ` [dpdk-dev] [PATCH 1/2] qede: rename config option Bruce Richardson
2016-06-03 15:01   ` Bruce Richardson
2016-06-03 15:54     ` Rasesh Mody

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1462594891-21169-2-git-send-email-rasesh.mody@qlogic.com \
    --to=rasesh.mody@qlogic.com \
    --cc=Dept-EngDPDKDev@qlogic.com \
    --cc=dev@dpdk.org \
    --cc=harish.patil@qlogic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).