From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-0016ce01.pphosted.com (mx0b-0016ce01.pphosted.com [67.231.156.153]) by dpdk.org (Postfix) with ESMTP id A55465A17 for ; Sat, 7 May 2016 06:21:40 +0200 (CEST) Received: from pps.filterd (m0085408.ppops.net [127.0.0.1]) by mx0b-0016ce01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u474K861025712 for ; Fri, 6 May 2016 21:21:40 -0700 Received: from avcashub1.qlogic.com ([198.186.0.117]) by mx0b-0016ce01.pphosted.com with ESMTP id 22s225rj12-1 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT) for ; Fri, 06 May 2016 21:21:40 -0700 Received: from avluser05.qlc.com (10.1.113.115) by qlc.com (10.1.4.192) with Microsoft SMTP Server id 14.3.235.1; Fri, 6 May 2016 21:21:39 -0700 Received: (from rmody@localhost) by avluser05.qlc.com (8.14.4/8.14.4/Submit) id u474LdiS021222; Fri, 6 May 2016 21:21:39 -0700 X-Authentication-Warning: avluser05.qlc.com: rmody set sender to rasesh.mody@qlogic.com using -f From: Rasesh Mody To: CC: , Harish Patil Date: Fri, 6 May 2016 21:21:31 -0700 Message-ID: <1462594891-21169-2-git-send-email-rasesh.mody@qlogic.com> X-Mailer: git-send-email 1.7.10.3 In-Reply-To: <1462594891-21169-1-git-send-email-rasesh.mody@qlogic.com> References: <1462594891-21169-1-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain disclaimer: bypass X-Proofpoint-Virus-Version: vendor=nai engine=5800 definitions=8157 signatures=670715 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 adultscore=8 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1603290000 definitions=main-1605070065 Subject: [dpdk-dev] [PATCH 2/2] qede: return LAN stats to MFW X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2016 04:21:40 -0000 From: Harish Patil 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 --- 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