#define BNXT_FLAG_RX_VECTOR_PKT_MODE BIT(24)
#define BNXT_FLAG_FLOW_XSTATS_EN BIT(25)
#define BNXT_FLAG_DFLT_MAC_SET BIT(26)
-#define BNXT_FLAG_TRUFLOW_EN BIT(27)
-#define BNXT_FLAG_GFID_ENABLE BIT(28)
-#define BNXT_FLAG_RFS_NEEDS_VNIC BIT(29)
-#define BNXT_FLAG_FLOW_CFA_RFS_RING_TBL_IDX_V2 BIT(30)
+#define BNXT_FLAG_GFID_ENABLE BIT(27)
+#define BNXT_FLAG_RFS_NEEDS_VNIC BIT(28)
+#define BNXT_FLAG_FLOW_CFA_RFS_RING_TBL_IDX_V2 BIT(29)
#define BNXT_RFS_NEEDS_VNIC(bp) ((bp)->flags & BNXT_FLAG_RFS_NEEDS_VNIC)
#define BNXT_PF(bp) (!((bp)->flags & BNXT_FLAG_VF))
#define BNXT_VF(bp) ((bp)->flags & BNXT_FLAG_VF)
#define BNXT_HAS_RING_GRPS(bp) (!BNXT_CHIP_P5(bp))
#define BNXT_FLOW_XSTATS_EN(bp) ((bp)->flags & BNXT_FLAG_FLOW_XSTATS_EN)
#define BNXT_HAS_DFLT_MAC_SET(bp) ((bp)->flags & BNXT_FLAG_DFLT_MAC_SET)
-#define BNXT_TRUFLOW_EN(bp) ((bp)->flags & BNXT_FLAG_TRUFLOW_EN)
#define BNXT_GFID_ENABLED(bp) ((bp)->flags & BNXT_FLAG_GFID_ENABLE)
uint32_t flags2;
#define BNXT_FW_CAP_ADV_FLOW_MGMT BIT(5)
#define BNXT_FW_CAP_ADV_FLOW_COUNTERS BIT(6)
#define BNXT_FW_CAP_LINK_ADMIN BIT(7)
+#define BNXT_FW_CAP_TRUFLOW_EN BIT(8)
+#define BNXT_TRUFLOW_EN(bp) ((bp)->fw_cap & BNXT_FW_CAP_TRUFLOW_EN)
pthread_mutex_t flow_lock;
{ .vendor_id = 0, /* sentinel */ },
};
-#define BNXT_DEVARG_TRUFLOW "host-based-truflow"
#define BNXT_DEVARG_FLOW_XSTAT "flow-xstat"
#define BNXT_DEVARG_MAX_NUM_KFLOWS "max-num-kflows"
#define BNXT_DEVARG_REPRESENTOR "representor"
static const char *const bnxt_dev_args[] = {
BNXT_DEVARG_REPRESENTOR,
- BNXT_DEVARG_TRUFLOW,
BNXT_DEVARG_FLOW_XSTAT,
BNXT_DEVARG_MAX_NUM_KFLOWS,
BNXT_DEVARG_REP_BASED_PF,
NULL
};
-/*
- * truflow == false to disable the feature
- * truflow == true to enable the feature
- */
-#define BNXT_DEVARG_TRUFLOW_INVALID(truflow) ((truflow) > 1)
-
/*
* flow_xstat == false to disable the feature
* flow_xstat == true to enable the feature
return 0;
}
-static int
-bnxt_parse_devarg_truflow(__rte_unused const char *key,
- const char *value, void *opaque_arg)
-{
- struct bnxt *bp = opaque_arg;
- unsigned long truflow;
- char *end = NULL;
-
- if (!value || !opaque_arg) {
- PMD_DRV_LOG(ERR,
- "Invalid parameter passed to truflow devargs.\n");
- return -EINVAL;
- }
-
- truflow = strtoul(value, &end, 10);
- if (end == NULL || *end != '\0' ||
- (truflow == ULONG_MAX && errno == ERANGE)) {
- PMD_DRV_LOG(ERR,
- "Invalid parameter passed to truflow devargs.\n");
- return -EINVAL;
- }
-
- if (BNXT_DEVARG_TRUFLOW_INVALID(truflow)) {
- PMD_DRV_LOG(ERR,
- "Invalid value passed to truflow devargs.\n");
- return -EINVAL;
- }
-
- if (truflow) {
- bp->flags |= BNXT_FLAG_TRUFLOW_EN;
- PMD_DRV_LOG(INFO, "Host-based truflow feature enabled.\n");
- } else {
- bp->flags &= ~BNXT_FLAG_TRUFLOW_EN;
- PMD_DRV_LOG(INFO, "Host-based truflow feature disabled.\n");
- }
-
- return 0;
-}
-
static int
bnxt_parse_devarg_flow_xstat(__rte_unused const char *key,
const char *value, void *opaque_arg)
if (kvlist == NULL)
return -EINVAL;
- /*
- * Handler for "truflow" devarg.
- * Invoked as for ex: "-a 0000:00:0d.0,host-based-truflow=1"
- */
- ret = rte_kvargs_process(kvlist, BNXT_DEVARG_TRUFLOW,
- bnxt_parse_devarg_truflow, bp);
- if (ret)
- goto err;
-
/*
* Handler for "flow_xstat" devarg.
* Invoked as for ex: "-a 0000:00:0d.0,flow_xstat=1"
bp->fw_cap |= BNXT_FW_CAP_ADV_FLOW_COUNTERS;
}
+ if (dev_caps_cfg &
+ HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_CFA_TRUFLOW_SUPPORTED) {
+ PMD_DRV_LOG(DEBUG, "Host-based truflow feature enabled.\n");
+ bp->fw_cap |= BNXT_FW_CAP_TRUFLOW_EN;
+ }
+
error:
HWRM_UNLOCK();
return rc;
return rc;
}
-
int bnxt_hwrm_flash_nvram(struct bnxt *bp, uint16_t dir_type,
uint16_t dir_ordinal, uint16_t dir_ext,
uint16_t dir_attr, const uint8_t *data,