DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Burakov, Anatoly" <anatoly.burakov@intel.com>
To: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>,
	<dev@dpdk.org>, Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: [PATCH v3 15/19] net/i40e: refactor FDIR engine infrastructure
Date: Mon, 5 Oct 2026 16:46:10 +0200	[thread overview]
Message-ID: <14800b6d-5de7-4831-b887-b6b744ba4ec6@intel.com> (raw)
In-Reply-To: <46e66110-5473-400e-abec-fc60e4f5f033@intel.com>

On 9/19/2026 6:13 PM, Medvedkin, Vladimir wrote:
> 
> On 9/16/2026 1:18 PM, Anatoly Burakov wrote:
>> Currently, there are multiple problems with how i40e flow directory 
>> feature
>> is implemented, both in terms of how it works with rte_flow, and how it
>> integrates with the PMD-specific packet template API.
>>
>> For one, these two subsystems, while using shared infrastructure, do not
>> really interact or cooperate, and are built on top of special cases in 
>> FDIR
>> path. More specifically, the packet template code does not store its
>> packet in the hash map, and has a different hashing scheme, yet it still
>> registers itself in FDIR flow list, hash table, and hash map. This list
>> is then used by `dev_start` to restore FDIR filters that user has
>> inserted into the list. These filters, as written, cannot be reprogrammed
>> that way because the information a filter restore function would need is
>> lost on insert (the packet pointer is not added to the hash map).
>>
>> Another issue is that while rte_flow FDIR code does lazy FDIR init on 
>> first
>> added flow, the packet template API does not, even though it too 
>> relies on
>> the same hardware feature, nor does it ever do teardown on last FDIR 
>> flow.
>>
>> Yet another issue is how the "filter restore" code itself is implemented,
>> namely that currently it simply does not work. When doing filter restore,
>> the driver will walk every FDIR filter stored in the TAILQ, and 
>> attempt to
>> program it. However, inside the program function, there is a 
>> deduplication
>> check (to see if flow being installed is already present in the flow hash
>> table), which fails because the flows we are programming come from the 
>> same
>> list that is being checked for deduplication, which makes the entire 
>> filter
>> restore a no-op.
>>
>> The FDIR filter programming code itself also has a number of readability
>> problems as well as being otherwise hard to use - SW bookkeeping,
>> validation, and flow programming is interspersed within the code, and it
>> is difficult to reason about what happens when the code is called from
>> this or that context.
>>
>> So, this refactor does the following:
>>
>> - Reorganize FDIR internals to track packet templates and rte_flow FDIR
>>    flows separately
>> - Refactor FDIR init/teardown to always happen on first/last rule, so 
>> that
>>    whichever API happens to call FDIR first, the state is consistent
> nit: it seems you've moved it to the next patch



>> - Rework the FDIR code to disentangle FDIR flow rule programming, Flex 
>> PIT
>>    checks, SW bookkeeping, etc. from each other
>> - Remove both the rte_flow FDIR TAILQ and the hash map (filter array)
>>    structure, because they are redundant (information about the flow is
>>    already stored in the rte_flow flow list, and hash_map structure only
>>    stored pointers to data we also have in that same list)
>> - Fix FDIR filter restore to replay all configuration correctly, as 
>> well as
>>    re-init the FDIR queue enablement tracking
>> - Rework the internal FDIR global state data structure to make a little
>>    more sense by grouping things that belong together into structures
>>
>> Additionally, there was a delay mechanism at flow director rule program
>> time, as when programming a rule we might not know if it's actually
>> possible to install the rule, because space for the rules may come either
>> from our own pool, or it may come from a pool that is shared with other
>> VSI's. However, it only makes sense to wait on rule create (i.e. when 
>> it is
>> programmed into the hardware for the first time), but not when we are
>> replaying or removing these rules. So, adjust the waiting mechanism to 
>> only
>> wait on FDIR rule creation.
>>
>> Signed-off-by: Anatoly Burakov<anatoly.burakov@intel.com>
>> ---
> <snip>
>> @@ -3860,16 +3851,15 @@ i40e_flow_destroy(struct rte_eth_dev *dev,
>>           ret = i40e_flow_destroy_tunnel_filter(pf,
>>                     (struct i40e_tunnel_filter *)flow->rule);
>>           break;
>> -    case RTE_ETH_FILTER_FDIR:
>> -        ret = i40e_flow_add_del_fdir_filter(dev,
>> -                &((struct i40e_fdir_filter *)flow->rule)->fdir,
>> -                0);
>> +    case RTE_ETH_FILTER_FDIR: {
>> +        struct i40e_fdir_filter *node = flow->rule;
>> -        /* If the last flow is destroyed, disable fdir. */
>> -        if (!ret && TAILQ_EMPTY(&pf->fdir.fdir_list)) {
>> -            i40e_fdir_rx_proc_enable(dev, 0);
>> -        }
>> +        ret = i40e_fdir_filter_program(dev, node, 0, false);
> previous implementation set wait_status depending on fdir_info- 
>  >fdir_invalprio. Do we really need to wait here?

We do not, and wait is false here. We used to set wait_status here 
depending on fdir_info->fdir_invalprio, but in actuality we can avoid 
waiting here (see commit message).

-- 
Thanks,
Anatoly

  reply	other threads:[~2026-10-05 14:46 UTC|newest]

Thread overview: 160+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-20 14:00 [PATCH v1 00/21] Building a better rte_flow parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 01/21] ethdev: add flow graph API Anatoly Burakov
2026-08-25 13:55   ` Thomas Monjalon
2026-08-26  8:58     ` Burakov, Anatoly
2026-08-26  9:21       ` Thomas Monjalon
2026-08-26  9:26         ` Bruce Richardson
2026-08-26 10:20         ` Burakov, Anatoly
2026-08-26 14:46           ` Thomas Monjalon
2026-08-27  7:58             ` Burakov, Anatoly
2026-08-27  8:02               ` Thomas Monjalon
2026-08-20 14:00 ` [PATCH v1 02/21] net/intel/common: add flow engines infrastructure Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 03/21] net/intel/common: add utility functions Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 04/21] net/ixgbe: add support for common flow parsing Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 05/21] net/ixgbe: reimplement ethertype parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 06/21] net/ixgbe: reimplement syn parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 07/21] net/ixgbe: reimplement L2 tunnel parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 08/21] net/ixgbe: reimplement ntuple parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 09/21] net/ixgbe: reimplement security parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 10/21] net/ixgbe: reimplement FDIR parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 11/21] net/ixgbe: reimplement hash parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 12/21] net/i40e: add support for common flow parsing Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 13/21] net/i40e: reimplement ethertype parser Anatoly Burakov
2026-08-20 14:00 ` [PATCH v1 14/21] net/i40e: reimplement FDIR parser Anatoly Burakov
2026-08-20 14:01 ` [PATCH v1 15/21] net/i40e: reimplement tunnel QinQ parser Anatoly Burakov
2026-08-20 14:01 ` [PATCH v1 16/21] net/i40e: reimplement VXLAN parser Anatoly Burakov
2026-08-20 14:01 ` [PATCH v1 17/21] net/i40e: reimplement NVGRE parser Anatoly Burakov
2026-08-20 14:01 ` [PATCH v1 18/21] net/i40e: reimplement MPLS parser Anatoly Burakov
2026-08-20 14:01 ` [PATCH v1 19/21] net/i40e: reimplement gtp parser Anatoly Burakov
2026-08-20 14:01 ` [PATCH v1 20/21] net/i40e: reimplement L4 cloud parser Anatoly Burakov
2026-08-20 14:01 ` [PATCH v1 21/21] net/i40e: reimplement hash parser Anatoly Burakov
2026-08-21 15:27 ` [PATCH v1 00/21] Building a better rte_flow parser Stephen Hemminger
2026-09-08 15:20 ` [PATCH v2 00/19] " Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 01/19] ethdev: add flow graph API Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 02/19] net/intel/common: add flow engines infrastructure Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 03/19] net/intel/common: add utility functions Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 04/19] net/ixgbe: add support for common flow parsing Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 05/19] net/ixgbe: reimplement ethertype parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 06/19] net/ixgbe: reimplement syn parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 07/19] net/ixgbe: reimplement L2 tunnel parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 08/19] net/ixgbe: reimplement ntuple parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 09/19] net/ixgbe: reimplement security parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 10/19] net/ixgbe: reimplement FDIR parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 11/19] net/ixgbe: reimplement hash parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 12/19] net/ixgbe: advertise flow keep capability Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 13/19] net/i40e: add support for common flow parsing Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 14/19] net/i40e: reimplement ethertype parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 15/19] net/i40e: refactor FDIR engine infrastructure Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 16/19] net/i40e: reimplement FDIR parser Anatoly Burakov
2026-09-08 15:20   ` [PATCH v2 17/19] net/i40e: reimplement tunnel parsers Anatoly Burakov
2026-09-08 15:21   ` [PATCH v2 18/19] net/i40e: reimplement hash parser Anatoly Burakov
2026-09-08 15:21   ` [PATCH v2 19/19] net/i40e: advertise flow keep capability Anatoly Burakov
2026-09-09  9:08   ` [PATCH v2 00/19] Building a better rte_flow parser Burakov, Anatoly
2026-09-16 12:18 ` [PATCH v3 " Anatoly Burakov
2026-09-16 12:18   ` [PATCH v3 01/19] ethdev: add flow graph API Anatoly Burakov
2026-09-17  0:21     ` Stephen Hemminger
2026-10-02 11:00       ` Burakov, Anatoly
2026-09-19 16:09     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 02/19] net/intel/common: add flow engines infrastructure Anatoly Burakov
2026-09-17  0:26     ` Stephen Hemminger
2026-09-18  9:17       ` Burakov, Anatoly
2026-09-19 16:09     ` Medvedkin, Vladimir
2026-10-02 11:29       ` Burakov, Anatoly
2026-10-02 13:13       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 03/19] net/intel/common: add utility functions Anatoly Burakov
2026-09-17  0:30     ` Stephen Hemminger
2026-09-18  9:20       ` Burakov, Anatoly
2026-09-19 16:09     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 04/19] net/ixgbe: add support for common flow parsing Anatoly Burakov
2026-09-19 16:09     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 05/19] net/ixgbe: reimplement ethertype parser Anatoly Burakov
2026-09-19 16:10     ` Medvedkin, Vladimir
2026-10-02 14:45       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 06/19] net/ixgbe: reimplement syn parser Anatoly Burakov
2026-09-19 16:10     ` Medvedkin, Vladimir
2026-10-05  8:35       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 07/19] net/ixgbe: reimplement L2 tunnel parser Anatoly Burakov
2026-09-19 16:10     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 08/19] net/ixgbe: reimplement ntuple parser Anatoly Burakov
2026-09-19 16:11     ` Medvedkin, Vladimir
2026-10-05  9:45       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 09/19] net/ixgbe: reimplement security parser Anatoly Burakov
2026-09-19 16:11     ` Medvedkin, Vladimir
2026-10-05 12:16       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 10/19] net/ixgbe: reimplement FDIR parser Anatoly Burakov
2026-09-19 16:11     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 11/19] net/ixgbe: reimplement hash parser Anatoly Burakov
2026-09-19 16:11     ` Medvedkin, Vladimir
2026-10-05 12:35       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 12/19] net/ixgbe: advertise flow keep capability Anatoly Burakov
2026-09-19 16:11     ` Medvedkin, Vladimir
2026-10-05 12:54       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 13/19] net/i40e: add support for common flow parsing Anatoly Burakov
2026-09-19 16:13     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 14/19] net/i40e: reimplement ethertype parser Anatoly Burakov
2026-09-19 16:13     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 15/19] net/i40e: refactor FDIR engine infrastructure Anatoly Burakov
2026-09-19 16:13     ` Medvedkin, Vladimir
2026-10-05 14:46       ` Burakov, Anatoly [this message]
2026-09-16 12:18   ` [PATCH v3 16/19] net/i40e: reimplement FDIR parser Anatoly Burakov
2026-09-19 16:13     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 17/19] net/i40e: reimplement tunnel parsers Anatoly Burakov
2026-09-19 16:14     ` Medvedkin, Vladimir
2026-10-05 15:45       ` Burakov, Anatoly
2026-09-16 12:18   ` [PATCH v3 18/19] net/i40e: reimplement hash parser Anatoly Burakov
2026-09-19 16:14     ` Medvedkin, Vladimir
2026-09-16 12:18   ` [PATCH v3 19/19] net/i40e: advertise flow keep capability Anatoly Burakov
2026-09-19 16:16     ` Medvedkin, Vladimir
2026-09-17  0:19   ` [PATCH v3 00/19] Building a better rte_flow parser Stephen Hemminger
2026-10-05 16:37 ` [PATCH v4 00/24] " Anatoly Burakov
2026-10-05 16:37   ` [PATCH v4 01/24] ethdev: add default mask query to flow Anatoly Burakov
2026-10-05 16:37   ` [PATCH v4 02/24] ethdev: add flow graph API Anatoly Burakov
2026-10-05 16:37   ` [PATCH v4 03/24] net/intel/common: add flow engines infrastructure Anatoly Burakov
2026-10-05 16:37   ` [PATCH v4 04/24] net/intel/common: add utility functions Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 05/24] net/ixgbe: add support for common flow parsing Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 06/24] net/ixgbe: make ethertype filter table dynamic Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 07/24] net/ixgbe: reimplement ethertype parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 08/24] net/ixgbe: fix syn filter priority Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 09/24] net/ixgbe: reimplement syn parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 10/24] net/ixgbe: reimplement L2 tunnel parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 11/24] net/ixgbe: fix ntuple filter priority Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 12/24] net/ixgbe: reimplement ntuple parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 13/24] net/ixgbe: reimplement security parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 14/24] net/ixgbe: reimplement FDIR parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 15/24] net/ixgbe: don't embed RSS conf in filter structs Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 16/24] net/ixgbe: reimplement hash parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 17/24] net/ixgbe: advertise flow keep capability Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 18/24] net/i40e: add support for common flow parsing Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 19/24] net/i40e: reimplement ethertype parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 20/24] net/i40e: refactor FDIR engine infrastructure Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 21/24] net/i40e: reimplement FDIR parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 22/24] net/i40e: reimplement tunnel parsers Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 23/24] net/i40e: reimplement hash parser Anatoly Burakov
2026-10-05 16:38   ` [PATCH v4 24/24] net/i40e: advertise flow keep capability Anatoly Burakov
2026-10-07 10:49 ` [PATCH v5 00/25] Building a better rte_flow parser Anatoly Burakov
2026-10-07 10:49   ` [PATCH v5 01/25] ethdev: add default mask query to flow Anatoly Burakov
2026-10-07 14:40     ` Thomas Monjalon
2026-10-07 10:49   ` [PATCH v5 02/25] ethdev: add flow graph API Anatoly Burakov
2026-10-07 10:49   ` [PATCH v5 03/25] net/intel/common: add flow engines infrastructure Anatoly Burakov
2026-10-07 10:49   ` [PATCH v5 04/25] net/intel/common: add utility functions Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 05/25] net/ixgbe: add support for common flow parsing Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 06/25] net/ixgbe: make ethertype filter table dynamic Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 07/25] net/ixgbe: reimplement ethertype parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 08/25] net/ixgbe: fix syn filter priority Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 09/25] net/ixgbe: reimplement syn parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 10/25] net/ixgbe: reimplement L2 tunnel parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 11/25] net/ixgbe: fix ntuple filter priority Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 12/25] net/ixgbe: fix protocol-only ntuple parsing Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 13/25] net/ixgbe: reimplement ntuple parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 14/25] net/ixgbe: reimplement security parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 15/25] net/ixgbe: reimplement FDIR parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 16/25] net/ixgbe: don't embed RSS conf in filter structs Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 17/25] net/ixgbe: reimplement hash parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 18/25] net/ixgbe: advertise flow keep capability Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 19/25] net/i40e: add support for common flow parsing Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 20/25] net/i40e: reimplement ethertype parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 21/25] net/i40e: refactor FDIR engine infrastructure Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 22/25] net/i40e: reimplement FDIR parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 23/25] net/i40e: reimplement tunnel parsers Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 24/25] net/i40e: reimplement hash parser Anatoly Burakov
2026-10-07 10:50   ` [PATCH v5 25/25] net/i40e: advertise flow keep capability Anatoly Burakov

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=14800b6d-5de7-4831-b887-b6b744ba4ec6@intel.com \
    --to=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=vladimir.medvedkin@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