On 3/9/23 14:02, Simon Horman wrote:
> From: Peng Zhang <[email protected]>
> 
> Add API to offload DPDK meter to HW, and the corresponding functions to call
> the DPDK meter callbacks from all the registered flow API providers.
> The interfaces are like those related to DPDK meter in dpif_class, in order
> to pass necessary info to HW.
> 
> Signed-off-by: Peng Zhang <[email protected]>
> Signed-off-by: Jin Liu <[email protected]>
> Signed-off-by: Simon Horman <[email protected]>
> ---
>  Documentation/howto/dpdk.rst  |  5 +-
>  lib/netdev-offload-provider.h | 30 +++++++++++
>  lib/netdev-offload.c          | 99 +++++++++++++++++++++++++++++++++++
>  lib/netdev-offload.h          |  9 ++++
>  4 files changed, 141 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/howto/dpdk.rst b/Documentation/howto/dpdk.rst
> index 04609b20bd21..02fc568770ee 100644
> --- a/Documentation/howto/dpdk.rst
> +++ b/Documentation/howto/dpdk.rst
> @@ -401,10 +401,11 @@ Supported actions for hardware offload are:
>  - Modification of IPv6 (set_field:<ADDR>->ipv6_src/ipv6_dst/mod_nw_ttl).
>  - Clone/output (tnl_push and output) for encapsulating over a tunnel.
>  - Tunnel pop, for packets received on physical ports.
> +- Meter.
>  
>  .. note::
> -  Tunnel offloads are experimental APIs in DPDK. In order to enable it,
> -  compile with -DALLOW_EXPERIMENTAL_API.
> +  Tunnel offloads and Meter offloads are experimental APIs in DPDK. To enable
> +  these features, compile with -DALLOW_EXPERIMENTAL_API.
>  
>  Multiprocess
>  ------------
> diff --git a/lib/netdev-offload-provider.h b/lib/netdev-offload-provider.h
> index 9108856d18d1..7ecbb8d026f1 100644
> --- a/lib/netdev-offload-provider.h
> +++ b/lib/netdev-offload-provider.h
> @@ -102,6 +102,16 @@ struct netdev_flow_api {
>      int (*meter_set)(ofproto_meter_id meter_id,
>                       struct ofputil_meter_config *config);
>  
> +    /* Offloads or modifies the offloaded meter on the netdev with the given
> +     * 'meter_id' and the configuration in 'config'. On failure, a non-zero
> +     * error code is returned.
> +     *
> +     * The meter id specified through 'config->meter_id' is converted as an
> +     * internal meter id. */
> +    int (*dpdk_meter_set)(struct netdev *,
> +                          ofproto_meter_id meter_id,
> +                          struct ofputil_meter_config *);

Hi.

This looks strange.  We do already have the meter API here.
There is no need to create a separate set of APIs for each
offload provider.  This breaks the abstraction.

If there is something missing in existing meter_* callbacks,
modify them, so they can be suitable for both implementations.
If you need to iterate over all the ports, we have a special
netdev_ports_traverse() function that can be used from the
netdev-offload-dpdk.

Also, In my reply for v1 I mentioned that this patch set
should be sent for dpdk-latest branch, not master.  i.e.,
it should have 'dpdk-latest' in the subject prefix.

CC: Ian.

dpdk-latest branch may need a rebase though.  Ian, may I ask
you to rebase it on the latest master?  Or I can do that
myself, if necessary.

Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to