> -----Original Message-----
> From: Amber, Kumar <[email protected]>
> Sent: Tuesday, June 28, 2022 9:45 AM
> To: [email protected]
> Cc: [email protected]; [email protected]; Ferriter, Cian
> <[email protected]>; Stokes, Ian <[email protected]>; 
> [email protected];
> Van Haaren, Harry <[email protected]>; Amber, Kumar
> <[email protected]>
> Subject: [PATCH v3 4/5] dpif-netdev: Add function pointer for dpif 
> re-circulate.
> 
> The patch adds and re-uses the dpif set command to set the
> function pointers to be used to switch between different inner
> dpifs.
> 
> Signed-off-by: Kumar Amber <[email protected]>
> Signed-off-by: Cian Ferriter <[email protected]>
> Co-authored-by: Cian Ferriter <[email protected]>
> 
> ---
> v3:
> - Add description  to the dpif recirc function.
> - Fix use of return value to fall back to scalar dpif.
> ---
> ---
>  lib/dpif-netdev-private-dpif.c   | 57 +++++++++++++++++++++++++++-----
>  lib/dpif-netdev-private-dpif.h   | 18 ++++++++++
>  lib/dpif-netdev-private-thread.h |  3 ++
>  lib/dpif-netdev.c                | 19 +++++++++--
>  4 files changed, 87 insertions(+), 10 deletions(-)
> 
> diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c
> index 2dc51270a..96bfd4824 100644
> --- a/lib/dpif-netdev-private-dpif.c
> +++ b/lib/dpif-netdev-private-dpif.c
> @@ -27,6 +27,8 @@
>  #include "util.h"
> 
>  VLOG_DEFINE_THIS_MODULE(dpif_netdev_impl);
> +#define DPIF_NETDEV_IMPL_AVX512_CHECK (__x86_64__ && HAVE_AVX512F \
> +    && HAVE_LD_AVX512_GOOD && __SSE4_2__)

This #define rework should be in a different patch, it is not related to "add 
func ptr for dpif recirc".


<snip>

> +/* Returns the default recirculate DPIF which is first ./configure selected,
> + * but can be overridden at runtime. */
> +dp_netdev_recirc_func dp_netdev_recirc_impl_get_default(void);

Simplify comment?
/* Returns the default implementation to recirculate packets. */

The wording today suggests the compile time ./configure selected can be 
overridden...
which reads funny and isn't technically true. Simply state what the func does 
instead.

<snip>

> @@ -8819,7 +8828,10 @@ dp_execute_cb(void *aux_, struct dp_packet_batch
> *packets_,
>                  }
> 
>                  (*depth)++;
> -                dp_netdev_recirculate(pmd, packets_);
> +                int ret = pmd->netdev_input_recirc_func(pmd, packets_);
> +                if (ret != 0) {
> +                    dp_netdev_recirculate(pmd, packets_);
> +                }

Prefer the simpler if() format below?

if (ret) {

exists another time below.

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to