From: Simei Su Date: Tue, 10 Nov 2020 02:01:50 +0000 (+0800) Subject: net/ice: fix crash when device reset X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=333e1bde9db6b6e111c5a4863208bb15f60f5266;p=dpdk.git net/ice: fix crash when device reset When device resets, it should not implement ACL initialization which is only executed in DCF. This patch disable ACL init and uninit when in DPDK PF only mode. Fixes: 40d466fa9f76 ("net/ice: support ACL filter in DCF") Signed-off-by: Simei Su Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_acl_filter.c b/drivers/net/ice/ice_acl_filter.c index ca483f0e14..8ca88d2167 100644 --- a/drivers/net/ice/ice_acl_filter.c +++ b/drivers/net/ice/ice_acl_filter.c @@ -935,6 +935,9 @@ 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 " @@ -979,10 +982,11 @@ ice_acl_uninit(struct ice_adapter *ad) struct ice_hw *hw = ICE_PF_TO_HW(pf); struct ice_flow_parser *parser = &ice_acl_parser; - ice_unregister_parser(parser, ad); - - ice_deinit_acl(pf); - ice_acl_prof_free(hw); + if (ad->hw.dcf_enabled) { + ice_unregister_parser(parser, ad); + ice_deinit_acl(pf); + ice_acl_prof_free(hw); + } } static struct