From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Ajit Khaparde <ajit.khaparde@broadcom.com>, dpdk-dev <dev@dpdk.org>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>,
Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Subject: Re: [dpdk-dev] [PATCH v2] net/bnxt: add flow stats in extended stats
Date: Fri, 17 Apr 2020 23:03:29 +0100 [thread overview]
Message-ID: <1c9a63af-136a-e29f-f723-9f44e6004f1f@intel.com> (raw)
In-Reply-To: <CACZ4nhuXmnOvd_bWuXR8-nHbLKCctjtJHJBBO_N1WJH+cR5JEQ@mail.gmail.com>
On 4/17/2020 3:49 PM, Ajit Khaparde wrote:
> On Thu, Apr 16, 2020 at 10:49 PM Ajit Khaparde <ajit.khaparde@broadcom.com>
> wrote:
>
>> From: Somnath Kotur <somnath.kotur@broadcom.com>
>>
>> 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 <somnath.kotur@broadcom.com>
>> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
>> Reviewed-by: Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
>>
> 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 <rte_flow.h>
#include <rte_flow_driver.h>
#include <rte_tailq.h>
+#include <rte_alarm.h>
+#include <rte_cycles.h>
prev parent reply other threads:[~2020-04-17 22:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-17 5:37 [dpdk-dev] [PATCH] " Ajit Khaparde
2020-04-17 5:49 ` [dpdk-dev] [PATCH v2] " Ajit Khaparde
2020-04-17 14:49 ` Ajit Khaparde
2020-04-17 22:03 ` Ferruh Yigit [this message]
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=1c9a63af-136a-e29f-f723-9f44e6004f1f@intel.com \
--to=ferruh.yigit@intel.com \
--cc=ajit.khaparde@broadcom.com \
--cc=dev@dpdk.org \
--cc=somnath.kotur@broadcom.com \
--cc=sriharsha.basavapatna@broadcom.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).