Skip to content

RFC ethdev: datapath-focused meter actions

Alexander Kozyrev dpdk-dev 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest posting 2/23 patches 0 repliesNew
  2. v2 posting 1/20 of 3 patches 0 repliesSuperseded
  3. v1 RFC1 patch 4 repliesSuperseded

Patches in v2 posting 2/2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ethdev: add meter color matching to Flow APIlib/ethdev/rte_flow.h+26 -00 replies
2/3ethdev: allow meter color modificationlib/ethdev/rte_flow.h+1 -00 replies
3/3ethdev: add extended meter action to Flow APIlib/ethdev/rte_flow.h+22 -00 replies

Reviews trailers per patch

None of the 3 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchOri KamAndrew RybchenkoCristian DumitrescuAjit Khaparde
SeriesA-b A-b A-b A-b A-b A-b A-b A-b A-b Series-acked-by Series-acked-by R-b R-b Series-acked-by Series-acked-by Series-acked-by
1/3
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v2 thread

Cover letter [RFC v2 0/3] ethdev: datapath-focused meter actions

The introduction of asynchronous flow rules operations allowed users to create/destroy flow rules as part of the datapath without blocking on Flow API and slowing the packet processing down.

That applies to every possible action that has no preparation steps. Unfortunately, one notable exception is the meter action. There is a separate API to prepare a meter profile and a meter policy before any meter object can be used as a flow rule action.

The application logic is the following:
1. rte_mtr_meter_profile_add() is called to create the meter profile first to define how to classify incoming packets and to assign an appropriate color to them.
2. rte_mtr_meter_policy_add() is invoked to define the fate of a packet, based on its color (practically creating flow rules, matching colors).
3. rte_mtr_create() is then needed to search (with locks) for previously created profile and policy in order to create the meter object.
4. rte_flow_create() is now finally can be used to specify the created meter as an action.

This approach doesn't fit into the asynchronous rule creation model and can be improved with the following proposal:
1. Creating a policy may be replaced with the creation of a group with up to 3 different rules for every color using asynchronous Flow API. That requires the introduction of a new pattern item - meter color. Then creation a flow rule with the meter means a simple jump to a group:
rte_flow_async_create(group=1, pattern=color, actions=...); rte_flow_async_create(group=0, pattern=5-tuple,

		      actions=meter,jump group 1);

This allows to classify packets and act upon their color classifications. The Meter action assigns a color to a packet and an appropriate action is selected based on the Meter color in group 1.

2. Preparing a meter object should be the part of flow rule creation and use the same flow queue to benefit from asynchronous operations:
rte_flow_async_create(group=0, pattern=5-tuple,

		      actions=meter id 1 profile rfc2697, jump group 1);

Creation of the meter object takes time and flow creation must wait until it is ready before inserting the rule. Using the same queue allows ensuring that. There is no need to create a meter object outside of the Flow API, but this approach won't affect the old Meter API in any way.

3. Another point of optimization is to prepare all the resources needed in advance in rte_flow_configure(). All the policy rules can be created during the initialization stage easily and put into several groups. These groups can be used by many meter objects by simple jump action to an appropriate group. Meter objects can be preallocated as well and configured with required profile parameters later at the flow rule creation stage. The number of pre-allocated profiles/policies is specified in the Flow engine resources settings.

These optimizations alongside already existing pattern/actions templates can improve the insertion rate significantly and allow meter usage as part of the datapath. The introduction of the new API is intended to be used with the asynchronous Flow API. Deprecation of the old Meter API is not planned at this point.

Alexander Kozyrev (3):
ethdev: add meter color matching to Flow API
ethdev: allow meter color modification
ethdev: add extended meter action to Flow API

 lib/ethdev/rte_flow.h | 49 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)
Signature · 1 line
2.18.2