From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C09ABA0597; Sat, 18 Apr 2020 00:03:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 901801DD65; Sat, 18 Apr 2020 00:03:35 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 2D2C61DC9F for ; Sat, 18 Apr 2020 00:03:33 +0200 (CEST) IronPort-SDR: SZTogeuETtzxtqUu/QXldF3fL9xEwfyT9rn3yYoPN8vqQbJvH8hwSQzBjaLmW0Ct6gg3QDcrKi JT6QwawzHpTg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Apr 2020 15:03:32 -0700 IronPort-SDR: fQXsaghirf6Fk8BGwHbCm99F5nJsiFvFHQTdGMwI9Sj0+Yo7/4RMFlz8jQ1L9IzFNovIao9s0K hq8cqCm3YwFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,395,1580803200"; d="scan'208";a="246394117" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.252.10.35]) ([10.252.10.35]) by fmsmga008.fm.intel.com with ESMTP; 17 Apr 2020 15:03:30 -0700 To: Ajit Khaparde , dpdk-dev Cc: Somnath Kotur , Sriharsha Basavapatna References: <20200417053709.92576-1-ajit.khaparde@broadcom.com> <20200417054916.94488-1-ajit.khaparde@broadcom.com> From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@intel.com; prefer-encrypt=mutual; keydata= mQINBFXZCFABEADCujshBOAaqPZpwShdkzkyGpJ15lmxiSr3jVMqOtQS/sB3FYLT0/d3+bvy qbL9YnlbPyRvZfnP3pXiKwkRoR1RJwEo2BOf6h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QnABEBAAGJAjwEGAEKACYCGwwWIQTSNlOHQi7ChOOZgcf5M+tD3xNh HwUCXWZ5wAUJB3FgggAKCRD5M+tD3xNhH2O+D/9OEz62YuJQLuIuOfL67eFTIB5/1+0j8Tsu o2psca1PUQ61SZJZOMl6VwNxpdvEaolVdrpnSxUF31kPEvR0Igy8HysQ11pj8AcgH0a9FrvU /8k2Roccd2ZIdpNLkirGFZR7LtRw41Kt1Jg+lafI0efkiHKMT/6D/P1EUp1RxOBNtWGV2hrd 0Yg9ds+VMphHHU69fDH02SwgpvXwG8Qm14Zi5WQ66R4CtTkHuYtA63sS17vMl8fDuTCtvfPF HzvdJLIhDYN3Mm1oMjKLlq4PUdYh68Fiwm+boJoBUFGuregJFlO3hM7uHBDhSEnXQr5mqpPM 6R/7Q5BjAxrwVBisH0yQGjsWlnysRWNfExAE2sRePSl0or9q19ddkRYltl6X4FDUXy2DTXa9 a+Fw4e1EvmcF3PjmTYs9IE3Vc64CRQXkhujcN4ZZh5lvOpU8WgyDxFq7bavFnSS6kx7Tk29/ wNJBp+cf9qsQxLbqhW5kfORuZGecus0TLcmpZEFKKjTJBK9gELRBB/zoN3j41hlEl7uTUXTI JQFLhpsFlEdKLujyvT/aCwP3XWT+B2uZDKrMAElF6ltpTxI53JYi22WO7NH7MR16Fhi4R6vh FHNBOkiAhUpoXRZXaCR6+X4qwA8CwHGqHRBfYFSU/Ulq1ZLR+S3hNj2mbnSx0lBs1eEqe2vh cA== Message-ID: <1c9a63af-136a-e29f-f723-9f44e6004f1f@intel.com> Date: Fri, 17 Apr 2020 23:03:29 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2] net/bnxt: add flow stats in extended stats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 4/17/2020 3:49 PM, Ajit Khaparde wrote: > On Thu, Apr 16, 2020 at 10:49 PM Ajit Khaparde > wrote: > >> From: Somnath Kotur >> >> This patch allows to display flow stats in extended stats. >> To do this, DMA-able memory is registered with the FW during device >> initialization. Then the driver uses an alarm thread to query the >> per flow stats using the HWRM_CFA_COUNTER_QSTATS HWRM command at >> regular intervals and stores it locally which will be displayed >> when the application queries the xstats. >> The DMA-able memory is unregistered during driver cleanup. >> This functionality can be enabled using the flow-xstat devarg and >> will be disabled by default. The intention behind this is to allow >> stats to be displayed for all the flows in one shot instead of >> querying one at a time. >> >> Signed-off-by: Somnath Kotur >> Signed-off-by: Ajit Khaparde >> Reviewed-by: Sriharsha Basavapatna >> > Patch applied to dpdk-next-net-brcm. > <...> >> +static int bnxt_register_fc_ctx_mem(struct bnxt *bp) >> +{ >> + int rc = 0; >> + >> + rc = bnxt_hwrm_ctx_rgtr(bp, bp->rx_fc_in_tbl.dma, >> + &bp->rx_fc_in_tbl.ctx_id); >> + if (rc) >> + return rc; >> + >> + PMD_DRV_LOG(DEBUG, >> + "rx_fc_in_tbl.va = %p rx_fc_in_tbl.dma = %p" >> + " rx_fc_in_tbl.ctx_id = %d\n", >> + bp->rx_fc_in_tbl.va, (void *)bp->rx_fc_in_tbl.dma, >> + bp->rx_fc_in_tbl.ctx_id); >> + >> + rc = bnxt_hwrm_ctx_rgtr(bp, bp->rx_fc_out_tbl.dma, >> + &bp->rx_fc_out_tbl.ctx_id); >> + if (rc) >> + return rc; >> + >> + PMD_DRV_LOG(DEBUG, >> + "rx_fc_out_tbl.va = %p rx_fc_out_tbl.dma = %p" >> + " rx_fc_out_tbl.ctx_id = %d\n", >> + bp->rx_fc_out_tbl.va, (void *)bp->rx_fc_out_tbl.dma, This fails on 32-bit, as it does in previous set, please check 32-bit build before submitting. build error [1], same for below logs. Fixing while merging as following: - bp->rx_fc_in_tbl.va, (void *)bp->rx_fc_in_tbl.dma, + bp->rx_fc_in_tbl.va, + (void *)((uintptr_t)bp->rx_fc_in_tbl.dma), [1] ...dpdk/drivers/net/bnxt/bnxt_ethdev.c:356:28: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] 356 | bp->rx_fc_in_tbl.va, (void *)bp->rx_fc_in_tbl.dma, | ^ ...dpdk/drivers/net/bnxt/bnxt.h:747:16: note: in definition of macro ‘PMD_DRV_LOG_RAW’ 747 | __func__, ## args) | ^~~~ ...dpdk/drivers/net/bnxt/bnxt_ethdev.c:353:2: note: in expansion of macro ‘PMD_DRV_LOG’ 353 | PMD_DRV_LOG(DEBUG, | ^~~~~~~~~~~ <...> >> +void bnxt_flow_cnt_alarm_cb(void *arg) >> +{ >> + int rc = 0; >> + struct bnxt *bp = arg; >> + >> + if (!bp->rx_fc_out_tbl.va) { >> + PMD_DRV_LOG(ERR, "bp->rx_fc_out_tbl.va is NULL?\n"); >> + bnxt_cancel_fc_thread(bp); >> + return; >> + } >> + >> + if (!bp->flow_count) { >> + bnxt_cancel_fc_thread(bp); >> + return; >> + } >> + >> + if (!bp->eth_dev->data->dev_started) { >> + bnxt_cancel_fc_thread(bp); >> + return; >> + } >> + >> + rc = bnxt_flow_stats_req(bp); >> + if (rc) { >> + PMD_DRV_LOG(ERR, "Flow stat alarm not rescheduled.\n"); >> + return; >> + } >> + >> + rte_eal_alarm_set(US_PER_S * BNXT_FC_TIMER, >> + bnxt_flow_cnt_alarm_cb, >> + (void *)bp); >> +} Cross build is failing because of 'US_PER_S' [3], it seems header is missing, adding it while merging [4]. [3] ...dpdk/drivers/net/bnxt/bnxt_flow.c: In function ‘bnxt_setup_flow_counter’: ...dpdk/drivers/net/bnxt/bnxt_flow.c:1636:21: error: ‘US_PER_S’ undeclared (first use in this function); did you mean ‘US_PER_MS’? rte_eal_alarm_set(US_PER_S * BNXT_FC_TIMER, ^~~~~~~~ US_PER_MS ...dpdk/drivers/net/bnxt/bnxt_flow.c:1636:21: note: each undeclared identifier is reported only once for each function it appears in ...dpdk/drivers/net/bnxt/bnxt_flow.c: In function ‘bnxt_flow_cnt_alarm_cb’: ...dpdk/drivers/net/bnxt/bnxt_flow.c:1670:20: error: ‘US_PER_S’ undeclared (first use in this function); did you mean ‘US_PER_MS’? rte_eal_alarm_set(US_PER_S * BNXT_FC_TIMER, ^~~~~~~~ US_PER_MS [4] --- a/drivers/net/bnxt/bnxt_flow.c +++ b/drivers/net/bnxt/bnxt_flow.c @@ -10,6 +10,8 @@ #include #include #include +#include +#include