From owner-svn-src-head@freebsd.org Thu Nov 29 06:46:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D40BB1154035; Thu, 29 Nov 2018 06:46:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8520478865; Thu, 29 Nov 2018 06:46:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF55915FE6; Thu, 29 Nov 2018 06:46:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wAT6ktJo026161; Thu, 29 Nov 2018 06:46:55 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wAT6ktDn026158; Thu, 29 Nov 2018 06:46:55 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201811290646.wAT6ktDn026158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 29 Nov 2018 06:46:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r341212 - head/sys/dev/sfxge/common X-SVN-Group: head X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: head/sys/dev/sfxge/common X-SVN-Commit-Revision: 341212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8520478865 X-Spamd-Result: default: False [1.28 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_SPAM_LONG(0.51)[0.511,0]; NEURAL_SPAM_MEDIUM(0.31)[0.308,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_SPAM_SHORT(0.46)[0.458,0] X-Rspamd-Server: mx1.freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Nov 2018 06:46:59 -0000 Author: arybchik Date: Thu Nov 29 06:46:55 2018 New Revision: 341212 URL: https://svnweb.freebsd.org/changeset/base/341212 Log: sfxge(4): add Medford2 head-of-line blocking stats These stats are availble on Medford2 DPDK firmware variant which support equal stride super-buffer Rx mode. RXDP_HLB_IDLE capability bit is set when the stats are available. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18243 Modified: head/sys/dev/sfxge/common/ef10_mac.c head/sys/dev/sfxge/common/ef10_nic.c head/sys/dev/sfxge/common/efx.h Modified: head/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:46:44 2018 (r341211) +++ head/sys/dev/sfxge/common/ef10_mac.c Thu Nov 29 06:46:55 2018 (r341212) @@ -571,8 +571,19 @@ ef10_mac_stats_get_mask( goto fail8; } + if (encp->enc_hlb_counters) { + const struct efx_mac_stats_range ef10_hlb[] = { + { EFX_MAC_RXDP_HLB_IDLE, EFX_MAC_RXDP_HLB_TIMEOUT }, + }; + if ((rc = efx_mac_stats_mask_add_ranges(maskp, mask_size, + ef10_hlb, EFX_ARRAY_SIZE(ef10_hlb))) != 0) + goto fail9; + } + return (0); +fail9: + EFSYS_PROBE(fail9); fail8: EFSYS_PROBE(fail8); fail7: @@ -1025,6 +1036,13 @@ ef10_mac_stats_update( &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_SCATTER_DISABLED_TRUNC]), &value); + + /* Head-of-line blocking */ + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_IDLE, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_IDLE]), &value); + + EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_RXDP_HLB_TIMEOUT, &value); + EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_RXDP_HLB_TIMEOUT]), &value); done: /* Read START generation counter */ Modified: head/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:44 2018 (r341211) +++ head/sys/dev/sfxge/common/ef10_nic.c Thu Nov 29 06:46:55 2018 (r341212) @@ -1272,6 +1272,12 @@ ef10_get_datapath_caps( else encp->enc_fec_counters = B_FALSE; + /* Check if the firmware provides head-of-line blocking counters */ + if (CAP_FLAGS2(req, RXDP_HLB_IDLE)) + encp->enc_hlb_counters = B_TRUE; + else + encp->enc_hlb_counters = B_FALSE; + if (CAP_FLAGS1(req, RX_RSS_LIMITED)) { /* Only one exclusive RSS context is available per port. */ encp->enc_rx_scale_max_exclusive_contexts = 1; Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:44 2018 (r341211) +++ head/sys/dev/sfxge/common/efx.h Thu Nov 29 06:46:55 2018 (r341212) @@ -1324,6 +1324,7 @@ typedef struct efx_nic_cfg_s { /* Firmware support for extended MAC_STATS buffer */ uint32_t enc_mac_stats_nstats; boolean_t enc_fec_counters; + boolean_t enc_hlb_counters; /* Firmware support for "FLAG" and "MARK" filter actions */ boolean_t enc_filter_action_flag_supported; boolean_t enc_filter_action_mark_supported;