From: Bruce Richardson <bruce.richardson@intel.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: <dev@dpdk.org>, Xiaolong Ye <xiaolong.ye@intel.com>,
Yahui Cao <yahui.cao@intel.com>, Qi Zhang <qi.z.zhang@intel.com>
Subject: Re: [PATCH v1 2/6] net/ice: fix inconsistent state on FDIR failure
Date: Wed, 21 Oct 2026 10:17:36 +0100 [thread overview]
Message-ID: <atiDMDdGHN3HrcS2@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <c1c40841ee6fba9e2d0322a2ae1fd7ae06cff891.1792498154.git.anatoly.burakov@intel.com>
On Tue, Oct 20, 2026 at 01:11:05PM +0100, Anatoly Burakov wrote:
> FDIR creation programs the hardware rule before inserting its software
> hash entry. If insertion fails, creation returns without removing the
> hardware rule or releasing its counter, and MARK parsing may remain
> enabled despite no flow handle being returned.
>
> Reserve the hash entry before programming the rule, and release the
> counter if reservation fails. Remove the reserved entry if hardware
> programming fails. Enable MARK parsing only after both steps succeed.
>
> Fixes: 1a2fc1799f09 ("net/ice: reject duplicated flow for flow director")
> Cc: stable@dpdk.org
>
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
> drivers/net/intel/ice/ice_fdir_filter.c | 18 ++++++++++--------
> 1 file changed, 10 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/net/intel/ice/ice_fdir_filter.c b/drivers/net/intel/ice/ice_fdir_filter.c
> index 517c32cecf..63a0d9fb1f 100644
> --- a/drivers/net/intel/ice/ice_fdir_filter.c
> +++ b/drivers/net/intel/ice/ice_fdir_filter.c
> @@ -1654,8 +1654,18 @@ ice_fdir_create_filter(struct ice_adapter *ad,
> filter->input.cnt_index = filter->counter->hw_index;
> }
>
> + /* Reserve the software entry before installing the hardware rule. */
> + ret = ice_fdir_entry_insert(pf, entry, &key);
> + if (ret) {
> + rte_flow_error_set(error, -ret,
> + RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
> + "Insert entry to table failed.");
> + goto free_counter;
> + }
> +
> ret = ice_fdir_add_del_filter(pf, filter, true);
> if (ret) {
> + ice_fdir_entry_del(pf, &key);
> rte_flow_error_set(error, -ret,
> RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
> "Add filter rule failed.");
> @@ -1666,14 +1676,6 @@ ice_fdir_create_filter(struct ice_adapter *ad,
> ice_fdir_rx_parsing_enable(ad, 1);
>
> memcpy(entry, filter, sizeof(*entry));
> - ret = ice_fdir_entry_insert(pf, entry, &key);
> - if (ret) {
> - rte_flow_error_set(error, -ret,
> - RTE_FLOW_ERROR_TYPE_HANDLE, NULL,
> - "Insert entry to table failed.");
> - goto free_entry;
> - }
> -
> flow->rule = entry;
> ice_fdir_cnt_update(pf, filter->input.flow_type, is_tun, true);
>
> --
> 2.52.0
>
next prev parent reply other threads:[~2026-10-21 9:17 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 12:11 [PATCH v1 0/6] Centralize flow memory management in ICE Anatoly Burakov
2026-10-20 12:11 ` [PATCH v1 1/6] net/ice: release ACL slot on entry creation failure Anatoly Burakov
2026-10-21 9:17 ` Bruce Richardson
2026-10-20 12:11 ` [PATCH v1 2/6] net/ice: fix inconsistent state on FDIR failure Anatoly Burakov
2026-10-21 9:17 ` Bruce Richardson [this message]
2026-10-20 12:11 ` [PATCH v1 3/6] net/ice: standardize VOID handling in flow parsers Anatoly Burakov
2026-10-21 9:18 ` Bruce Richardson
2026-10-20 12:11 ` [PATCH v1 4/6] net/ice: remove temporary flow pattern buffer Anatoly Burakov
2026-10-21 9:19 ` Bruce Richardson
2026-10-20 12:11 ` [PATCH v1 5/6] net/ice: use caller-owned pattern match storage Anatoly Burakov
2026-10-21 9:25 ` Bruce Richardson
2026-10-21 9:55 ` Burakov, Anatoly
2026-10-20 12:11 ` [PATCH v1 6/6] net/ice: centralize flow rule memory management Anatoly Burakov
2026-10-21 9:59 ` Bruce Richardson
2026-10-21 10:07 ` Burakov, Anatoly
2026-10-21 10:02 ` [PATCH v1 0/6] Centralize flow memory management in ICE Bruce Richardson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=atiDMDdGHN3HrcS2@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=qi.z.zhang@intel.com \
--cc=xiaolong.ye@intel.com \
--cc=yahui.cao@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox