[v5,2/5] net/ice: refine flow engine disabling
Checks
Commit Message
Only "disable_engine_mask" for flow engine disabling
In PF mode, only ACL engine will be disabled.
In DCF mode, FDIR and HASH engine will be disabled.
In DCF mode with "acl=off", ACL engine will also be
disabled.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/ice/ice_acl_filter.c | 3 ---
drivers/net/ice/ice_dcf_parent.c | 3 +++
drivers/net/ice/ice_ethdev.c | 1 +
drivers/net/ice/ice_fdir_filter.c | 3 ---
drivers/net/ice/ice_hash.c | 3 ---
5 files changed, 4 insertions(+), 9 deletions(-)
@@ -995,9 +995,6 @@ ice_acl_init(struct ice_adapter *ad)
struct ice_hw *hw = ICE_PF_TO_HW(pf);
struct ice_flow_parser *parser = &ice_acl_parser;
- if (!ad->hw.dcf_enabled)
- return 0;
-
ret = ice_acl_prof_alloc(hw);
if (ret) {
PMD_DRV_LOG(ERR, "Cannot allocate memory for "
@@ -474,6 +474,9 @@ ice_dcf_init_parent_adapter(struct rte_eth_dev *eth_dev)
if (ice_devargs_check(eth_dev->device->devargs, ICE_DCF_DEVARG_ACL))
parent_adapter->disabled_engine_mask |= BIT(ICE_FLOW_ENGINE_ACL);
+ parent_adapter->disabled_engine_mask |= BIT(ICE_FLOW_ENGINE_FDIR);
+ parent_adapter->disabled_engine_mask |= BIT(ICE_FLOW_ENGINE_HASH);
+
err = ice_flow_init(parent_adapter);
if (err) {
PMD_INIT_LOG(ERR, "Failed to initialize flow");
@@ -2442,6 +2442,7 @@ ice_dev_init(struct rte_eth_dev *dev)
}
if (!ad->is_safe_mode) {
+ ad->disabled_engine_mask |= BIT(ICE_FLOW_ENGINE_ACL);
ret = ice_flow_init(ad);
if (ret) {
PMD_INIT_LOG(ERR, "Failed to initialize flow");
@@ -1150,9 +1150,6 @@ ice_fdir_init(struct ice_adapter *ad)
struct ice_flow_parser *parser;
int ret;
- if (ad->hw.dcf_enabled)
- return 0;
-
ret = ice_fdir_setup(pf);
if (ret)
return ret;
@@ -591,9 +591,6 @@ ice_hash_init(struct ice_adapter *ad)
{
struct ice_flow_parser *parser = NULL;
- if (ad->hw.dcf_enabled)
- return 0;
-
parser = &ice_hash_parser;
return ice_register_parser(parser, ad);