net/bnxt: add Truflow flush-timer to alloc table scope
authorShahaji Bhosle <sbhosle@broadcom.com>
Sat, 25 Apr 2020 03:47:25 +0000 (09:17 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 5 May 2020 13:53:57 +0000 (15:53 +0200)
Updated the params list to include flush timer, this will
allow users to set the HW flush timer value in 10th of second.
Setting 0 will disable the pending cache flush feature.

Signed-off-by: Shahaji Bhosle <sbhosle@broadcom.com>
Signed-off-by: Randy Schacher <stuart.schacher@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>
drivers/net/bnxt/tf_core/tf_core.h
drivers/net/bnxt/tf_core/tf_msg.c
drivers/net/bnxt/tf_core/tf_msg.h
drivers/net/bnxt/tf_core/tf_tbl.c
drivers/net/bnxt/tf_ulp/bnxt_ulp.c

index 4b60973..1eedd80 100644 (file)
@@ -560,6 +560,12 @@ struct tf_alloc_tbl_scope_parms {
         * [in] Brd4 only receive table access interface id
         */
        uint32_t tx_tbl_if_id;
+       /**
+        * [in] Flush pending HW cached flows every 1/10th of value
+        * set in seconds, both idle and active flows are flushed
+        * from the HW cache. If set to 0, this feature will be disabled.
+        */
+       uint8_t hw_flow_cache_flush_timer;
        /**
         * [out] table scope identifier
         */
index bdf8f15..beecafd 100644 (file)
@@ -978,6 +978,7 @@ int tf_msg_em_cfg(struct tf *tfp,
                  uint16_t   key1_ctx_id,
                  uint16_t   record_ctx_id,
                  uint16_t   efc_ctx_id,
+                 uint8_t    flush_interval,
                  int        dir)
 {
        int rc;
@@ -993,6 +994,8 @@ int tf_msg_em_cfg(struct tf *tfp,
        req.flags = tfp_cpu_to_le_32(flags);
        req.num_entries = tfp_cpu_to_le_32(num_entries);
 
+       req.flush_interval = flush_interval;
+
        req.key0_ctx_id = tfp_cpu_to_le_16(key0_ctx_id);
        req.key1_ctx_id = tfp_cpu_to_le_16(key1_ctx_id);
        req.record_ctx_id = tfp_cpu_to_le_16(record_ctx_id);
index b8d8c1e..030d188 100644 (file)
@@ -152,6 +152,7 @@ int tf_msg_em_cfg(struct tf *tfp,
                  uint16_t      key1_ctx_id,
                  uint16_t      record_ctx_id,
                  uint16_t      efc_ctx_id,
+                 uint8_t       flush_interval,
                  int           dir);
 
 /**
index 236affe..93f387e 100644 (file)
@@ -1500,6 +1500,7 @@ tf_alloc_eem_tbl_scope(struct tf *tfp,
                                   em_tables[KEY1_TABLE].ctx_id,
                                   em_tables[RECORD_TABLE].ctx_id,
                                   em_tables[EFC_TABLE].ctx_id,
+                                  parms->hw_flow_cache_flush_timer,
                                   dir);
                if (rc) {
                        PMD_DRV_LOG(ERR,
index f8047f0..a9cc92d 100644 (file)
@@ -121,6 +121,12 @@ bnxt_init_tbl_scope_parms(struct bnxt *bp,
        else
                dparms = bnxt_ulp_device_params_get(dev_id);
 
+       /*
+        * Set the flush timer for EEM entries. The value is in 100ms intervals,
+        * so 100 is 10s.
+        */
+       params->hw_flow_cache_flush_timer = 100;
+
        if (!dparms) {
                params->rx_max_key_sz_in_bits = BNXT_ULP_DFLT_RX_MAX_KEY;
                params->rx_max_action_entry_sz_in_bits =