[PATCH v4] ethdev: add indirect list flow action
Gregory Etelson
getelson at nvidia.com
Thu May 25 10:14:16 CEST 2023
Hello Ori,
[snip]
> > +/**
> > + * @warning
> > + * @b EXPERIMENTAL: this API may change without prior notice.
> > + *
> > + * Query and/or update indirect flow actions list.
> > + * If both query and update not NULL, the function atomically
> > + * queries and updates indirect action. Query and update are carried in
> > order
> > + * specified in the mode parameter.
> > + * If ether query or update is NULL, the function executes
> > + * complementing operation.
> > + *
> > + * @param port_id
> > + * Port identifier of Ethernet device.
> > + * @param handle
> > + * Handle for the indirect actions list object to be updated.
> > + * @param update
> > + * If not NULL, update profile specification used to modify the action
>
> It should be explained that the upate/query points always to array with the size
> of number of actions, the the query/update query/upate all the actions at the
> same time
>
I added update and query parameters description in v5
> This comment is for all such parameters in async and synced functions.
>
> > + * pointed by handle.
> > + * @see struct rte_flow_action_indirect_list
> > + * @param query
> > + * If not NULL pointer to storage for the associated query data type.
> > + * @see struct rte_flow_action_indirect_list
> > + * @param mode
> > + * Operational mode.
> > + * @param error
> > + * Perform verbose error reporting if not NULL.
> > + * PMDs initialize this structure in case of error only.
> > + *
> > + * @return
> > + * - (0) if success.
> > + * - (-ENODEV) if *port_id* invalid.
> > + * - (-ENOTSUP) if underlying device does not support this functionality.
> > + * - (-EINVAL) if *handle* or *mode* invalid or
> > + * both *query* and *update* are NULL.
> > + */
> > +__rte_experimental
> > +int
> > +rte_flow_action_list_handle_query_update(uint16_t port_id,
> > + const struct
> > + rte_flow_action_list_handle
> > *handle,
> > + const void **update, void **query,
> > + enum
> > rte_flow_query_update_mode mode,
> > + struct rte_flow_error *error);
> > +
> > +/**
> > + * @warning
> > + * @b EXPERIMENTAL: this API may change without prior notice.
> > + *
> > + * Enqueue async indirect flow actions list query and/or update
> > + *
> > + * @param port_id
> > + * Port identifier of Ethernet device.
> > + * @param queue_id
> > + * Flow queue which is used to update the rule.
> > + * @param attr
> > + * Indirect action update operation attributes.
> > + * @param handle
> > + * Handle for the indirect actions list object to be updated.
> > + * @param update
> > + * If not NULL, update profile specification used to modify the action
> > + * pointed by handle.
> > + * @see struct rte_flow_action_indirect_list
> > + * @param query
> > + * If not NULL, pointer to storage for the associated query data type.
> > + * Query result returned on async completion event.
> > + * @see struct rte_flow_action_indirect_list
> > + * @param mode
> > + * Operational mode.
> > + * @param user_data
> > + * The user data that will be returned on async completion event.
> > + * @param error
> > + * Perform verbose error reporting if not NULL.
> > + * PMDs initialize this structure in case of error only.
> > + *
> > + * @return
> > + * - (0) if success.
> > + * - (-ENODEV) if *port_id* invalid.
> > + * - (-ENOTSUP) if underlying device does not support this functionality.
> > + * - (-EINVAL) if *handle* or *mode* invalid or
> > + * both *update* and *query* are NULL.
> > + */
> > +__rte_experimental
> > +int
> > +rte_flow_async_action_list_handle_query_update(uint16_t port_id,
> > uint32_t queue_id,
> > + const struct rte_flow_op_attr *attr,
> > + const struct
> > + rte_flow_action_list_handle
> > *handle,
> > + const void **update, void **query,
> > + enum
> > rte_flow_query_update_mode mode,
> > + void *user_data,
> > + struct rte_flow_error *error);
> > +
> > +
> > #ifdef __cplusplus
> > }
> > #endif
> > diff --git a/lib/ethdev/rte_flow_driver.h b/lib/ethdev/rte_flow_driver.h
> > index a129a4605d..af63ef9b5c 100644
> > --- a/lib/ethdev/rte_flow_driver.h
> > +++ b/lib/ethdev/rte_flow_driver.h
> > @@ -121,6 +121,17 @@ struct rte_flow_ops {
> > const void *update, void *query,
> > enum rte_flow_query_update_mode qu_mode,
> > struct rte_flow_error *error);
> > + /** @see rte_flow_action_list_handle_create() */
> > + struct rte_flow_action_list_handle *(*action_list_handle_create)
> > + (struct rte_eth_dev *dev,
> > + const struct rte_flow_indir_action_conf *conf,
> > + const struct rte_flow_action actions[],
> > + struct rte_flow_error *error);
> > + /** @see rte_flow_action_list_handle_destroy() */
> > + int (*action_list_handle_destroy)
> > + (struct rte_eth_dev *dev,
> > + struct rte_flow_action_list_handle *handle,
> > + struct rte_flow_error *error);
> > /** See rte_flow_tunnel_decap_set() */
> > int (*tunnel_decap_set)
> > (struct rte_eth_dev *dev,
> > @@ -302,6 +313,36 @@ struct rte_flow_ops {
> > const void *update, void *query,
> > enum rte_flow_query_update_mode qu_mode,
> > void *user_data, struct rte_flow_error *error);
> > + /** @see rte_flow_async_action_list_handle_create() */
> > + struct rte_flow_action_list_handle *
> > + (*async_action_list_handle_create)
> > + (struct rte_eth_dev *dev, uint32_t queue_id,
> > + const struct rte_flow_op_attr *attr,
> > + const struct rte_flow_indir_action_conf *conf,
> > + const struct rte_flow_action *actions,
> > + void *user_data, struct rte_flow_error *error);
> > + /** @see rte_flow_async_action_list_handle_destroy() */
> > + int (*async_action_list_handle_destroy)
> > + (struct rte_eth_dev *dev, uint32_t queue_id,
> > + const struct rte_flow_op_attr *op_attr,
> > + struct rte_flow_action_list_handle *action_handle,
> > + void *user_data, struct rte_flow_error *error);
> > + /** @see rte_flow_action_list_handle_query_update() */
> > + int (*action_list_handle_query_update)
> > + (struct rte_eth_dev *dev,
> > + const struct rte_flow_action_list_handle *handle,
> > + const void **update, void **query,
> > + enum rte_flow_query_update_mode mode,
> > + struct rte_flow_error *error);
> > + /** @see rte_flow_async_action_list_handle_query_update() */
> > + int (*async_action_list_handle_query_update)
> > + (struct rte_eth_dev *dev, uint32_t queue_id,
> > + const struct rte_flow_op_attr *attr,
> > + const struct rte_flow_action_list_handle *handle,
> > + const void **update, void **query,
> > + enum rte_flow_query_update_mode mode,
> > + void *user_data, struct rte_flow_error *error);
> > +
> > };
> >
> > /**
> > diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map
> > index 357d1a88c0..02372b3a7e 100644
> > --- a/lib/ethdev/version.map
> > +++ b/lib/ethdev/version.map
> > @@ -299,6 +299,14 @@ EXPERIMENTAL {
> > rte_flow_action_handle_query_update;
> > rte_flow_async_action_handle_query_update;
> > rte_flow_async_create_by_index;
> > +
> > + # added in 23.07
> > + rte_flow_action_list_handle_create;
> > + rte_flow_action_list_handle_destroy;
> > + rte_flow_action_list_handle_query_update;
> > + rte_flow_async_action_list_handle_create;
> > + rte_flow_async_action_list_handle_destroy;
> > + rte_flow_async_action_list_handle_query_update;
> > };
> >
> > INTERNAL {
> > --
> > 2.34.1
More information about the dev
mailing list