]> git.droids-corp.org - dpdk.git/commitdiff
net/bnxt: remove devargs option for stats accumulation
authorKishore Padmanabha <kishore.padmanabha@broadcom.com>
Wed, 3 Nov 2021 00:52:41 +0000 (17:52 -0700)
committerAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 4 Nov 2021 21:11:56 +0000 (22:11 +0100)
The accumulation of flow counters is not determined by the application
device arguments anymore. Instead it is now dictated by the platform
capabilities whether to do software based accumulation or not.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Reviewed-by: Mike Baucom <michael.baucom@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
doc/guides/rel_notes/release_21_11.rst
drivers/net/bnxt/bnxt.h
drivers/net/bnxt/bnxt_ethdev.c
drivers/net/bnxt/tf_ulp/bnxt_ulp.c
drivers/net/bnxt/tf_ulp/bnxt_ulp.h
drivers/net/bnxt/tf_ulp/ulp_fc_mgr.c

index 565b9a97457f5783e44e7ba19ecf275a9b96801b..ed79c761ee48ea966ee689cd4c5311d4b5e5908c 100644 (file)
@@ -157,6 +157,7 @@ New Features
   * Added support for socket redirection.
   * Added wildcard match support for ingress flows.
   * Added support for inner IP header for GRE tunnel flows.
+  * Removed devargs option for stats accumulation.
 
 * **Updated Cisco enic driver.**
 
index 54039ba1a99c059a114d850e65dcd7c51efc4c75..04b994e5ec7a18aeb5b857f0e14e94e62a4583a8 100644 (file)
@@ -718,11 +718,8 @@ struct bnxt {
        uint32_t                        flags2;
 #define BNXT_FLAGS2_PTP_TIMESYNC_ENABLED       BIT(0)
 #define BNXT_FLAGS2_PTP_ALARM_SCHEDULED                BIT(1)
-#define        BNXT_FLAGS2_ACCUM_STATS_EN              BIT(2)
 #define BNXT_P5_PTP_TIMESYNC_ENABLED(bp)       \
        ((bp)->flags2 & BNXT_FLAGS2_PTP_TIMESYNC_ENABLED)
-#define        BNXT_ACCUM_STATS_EN(bp)                 \
-       ((bp)->flags2 & BNXT_FLAGS2_ACCUM_STATS_EN)
 
        uint16_t                chip_num;
 #define CHIP_NUM_58818         0xd818
index 90836401b7e0d38c47ba06f2c2b853d64dcc6c40..4413b5d72e28f0a9a3c43cceeba155a6939694d2 100644 (file)
@@ -87,7 +87,6 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
        { .vendor_id = 0, /* sentinel */ },
 };
 
-#define        BNXT_DEVARG_ACCUM_STATS "accum-stats"
 #define BNXT_DEVARG_FLOW_XSTAT "flow-xstat"
 #define BNXT_DEVARG_MAX_NUM_KFLOWS  "max-num-kflows"
 #define BNXT_DEVARG_REPRESENTOR        "representor"
@@ -101,7 +100,6 @@ static const struct rte_pci_id bnxt_pci_id_map[] = {
 
 static const char *const bnxt_dev_args[] = {
        BNXT_DEVARG_REPRESENTOR,
-       BNXT_DEVARG_ACCUM_STATS,
        BNXT_DEVARG_FLOW_XSTAT,
        BNXT_DEVARG_MAX_NUM_KFLOWS,
        BNXT_DEVARG_REP_BASED_PF,
@@ -114,12 +112,6 @@ static const char *const bnxt_dev_args[] = {
        NULL
 };
 
-/*
- * accum-stats == false to disable flow counter accumulation
- * accum-stats == true to enable flow counter accumulation
- */
-#define        BNXT_DEVARG_ACCUM_STATS_INVALID(accum_stats)    ((accum_stats) > 1)
-
 /*
  * app-id = an non-negative 8-bit number
  */
@@ -5290,45 +5282,6 @@ static int bnxt_init_resources(struct bnxt *bp, bool reconfig_dev)
        return 0;
 }
 
-static int
-bnxt_parse_devarg_accum_stats(__rte_unused const char *key,
-                             const char *value, void *opaque_arg)
-{
-       struct bnxt *bp = opaque_arg;
-       unsigned long accum_stats;
-       char *end = NULL;
-
-       if (!value || !opaque_arg) {
-               PMD_DRV_LOG(ERR,
-                           "Invalid parameter passed to accum-stats devargs.\n");
-               return -EINVAL;
-       }
-
-       accum_stats = strtoul(value, &end, 10);
-       if (end == NULL || *end != '\0' ||
-           (accum_stats == ULONG_MAX && errno == ERANGE)) {
-               PMD_DRV_LOG(ERR,
-                           "Invalid parameter passed to accum-stats devargs.\n");
-               return -EINVAL;
-       }
-
-       if (BNXT_DEVARG_ACCUM_STATS_INVALID(accum_stats)) {
-               PMD_DRV_LOG(ERR,
-                           "Invalid value passed to accum-stats devargs.\n");
-               return -EINVAL;
-       }
-
-       if (accum_stats) {
-               bp->flags2 |= BNXT_FLAGS2_ACCUM_STATS_EN;
-               PMD_DRV_LOG(INFO, "Host-based accum-stats feature enabled.\n");
-       } else {
-               bp->flags2 &= ~BNXT_FLAGS2_ACCUM_STATS_EN;
-               PMD_DRV_LOG(INFO, "Host-based accum-stats feature disabled.\n");
-       }
-
-       return 0;
-}
-
 static int
 bnxt_parse_devarg_flow_xstat(__rte_unused const char *key,
                             const char *value, void *opaque_arg)
@@ -5681,12 +5634,6 @@ bnxt_parse_dev_args(struct bnxt *bp, struct rte_devargs *devargs)
        if (ret)
                goto err;
 
-       /*
-        * Handler for "accum-stats" devarg.
-        * Invoked as for ex: "-a 0000:00:0d.0,accum-stats=1"
-        */
-       rte_kvargs_process(kvlist, BNXT_DEVARG_ACCUM_STATS,
-                          bnxt_parse_devarg_accum_stats, bp);
        /*
         * Handler for "max_num_kflows" devarg.
         * Invoked as for ex: "-a 000:00:0d.0,max_num_kflows=32"
index 2ac1a8625fe3d7639b10cc72803dfb1833e1fbfa..7deacd1f3e6ae3c46305e206617eea7006bbcfdd 100644 (file)
@@ -1490,14 +1490,6 @@ bnxt_ulp_port_init(struct bnxt *bp)
                goto jump_to_error;
        }
 
-       /* set the accumulation of the stats */
-       if (BNXT_ACCUM_STATS_EN(bp))
-               bp->ulp_ctx->cfg_data->accum_stats = true;
-
-       BNXT_TF_DBG(DEBUG, "BNXT Port:%d ULP port init, accum_stats:%d\n",
-                   bp->eth_dev->data->port_id,
-                   bp->ulp_ctx->cfg_data->accum_stats);
-
        /* set the unicast mode */
        if (bnxt_ulp_cntxt_ptr2_ulp_flags_get(bp->ulp_ctx, &ulp_flags)) {
                BNXT_TF_DBG(ERR, "Error in getting ULP context flags\n");
index 960a5a0c93e639a8494e8e35db1003db3aaec1ee..17c6898196009afa87fcc56644edc6780618f41c 100644 (file)
@@ -92,7 +92,6 @@ struct bnxt_ulp_data {
 #define        BNXT_ULP_TUN_ENTRY_INVALID      -1
 #define        BNXT_ULP_MAX_TUN_CACHE_ENTRIES  16
        struct bnxt_tun_cache_entry     tun_tbl[BNXT_ULP_MAX_TUN_CACHE_ENTRIES];
-       bool                            accum_stats;
        uint8_t                         app_id;
        uint8_t                         num_shared_clients;
        struct bnxt_flow_app_tun_ent    app_tun[BNXT_ULP_MAX_TUN_CACHE_ENTRIES];
index d6b4f93d31114a902d1dbdd0f14e7381528097f6..92243083b582dbe36a04edb0b1097172c06ff88d 100644 (file)
@@ -396,21 +396,17 @@ static int ulp_get_single_flow_stat(struct bnxt_ulp_context *ctxt,
                return rc;
        }
 
-       /* TBD - Get PKT/BYTE COUNT SHIFT/MASK from Template */
+       /* PKT/BYTE COUNT SHIFT/MASK are device specific */
        sw_cntr_indx = hw_cntr_id - fc_info->shadow_hw_tbl[dir].start_idx;
        sw_acc_tbl_entry = &fc_info->sw_acc_tbl[dir][sw_cntr_indx];
+
        /* Some dpdk applications may accumulate the flow counters while some
         * may not. In cases where the application is accumulating the counters
         * the PMD need not do the accumulation itself and viceversa to report
         * the correct flow counters.
         */
-       if (ctxt->cfg_data->accum_stats) {
-               sw_acc_tbl_entry->pkt_count += FLOW_CNTR_PKTS(stats, dparms);
-               sw_acc_tbl_entry->byte_count += FLOW_CNTR_BYTES(stats, dparms);
-       } else {
-               sw_acc_tbl_entry->pkt_count = FLOW_CNTR_PKTS(stats, dparms);
-               sw_acc_tbl_entry->byte_count = FLOW_CNTR_BYTES(stats, dparms);
-       }
+       sw_acc_tbl_entry->pkt_count += FLOW_CNTR_PKTS(stats, dparms);
+       sw_acc_tbl_entry->byte_count += FLOW_CNTR_BYTES(stats, dparms);
 
        /* Update the parent counters if it is child flow */
        if (sw_acc_tbl_entry->pc_flow_idx & FLOW_CNTR_PC_FLOW_VALID) {