The refactor allows us to use *recirc_depth_get() to obtain the depth across ovs which was previously limited to only dpif-netdev.c. The patch enables the use of recirc_depth_get() function in avx512 dpif.
Signed-off-by: Kumar Amber <kumar.am...@intel.com> Signed-off-by: Cian Ferriter <cian.ferri...@intel.com> Co-authored-by: Cian Ferriter <cian.ferri...@intel.com> Acked-by: Harry van Haaren <harry.van.haa...@intel.com> Acked-by: Sunil Pai G <sunil.pa...@intel.com> --- lib/dpif-netdev-private-dpif.c | 2 ++ lib/dpif-netdev-private-dpif.h | 5 +++++ lib/dpif-netdev.c | 3 --- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/dpif-netdev-private-dpif.c b/lib/dpif-netdev-private-dpif.c index ef4cee2ba..7f16fa0dc 100644 --- a/lib/dpif-netdev-private-dpif.c +++ b/lib/dpif-netdev-private-dpif.c @@ -31,6 +31,8 @@ VLOG_DEFINE_THIS_MODULE(dpif_netdev_impl); #define DPIF_NETDEV_IMPL_AVX512_CHECK (__x86_64__ && HAVE_AVX512F \ && HAVE_LD_AVX512_GOOD && __SSE4_2__) +DEFINE_EXTERN_PER_THREAD_DATA(recirc_depth, 0); + enum dpif_netdev_impl_info_idx { DPIF_NETDEV_IMPL_SCALAR, DPIF_NETDEV_IMPL_AVX512 diff --git a/lib/dpif-netdev-private-dpif.h b/lib/dpif-netdev-private-dpif.h index cf331cec7..b3e75b7a2 100644 --- a/lib/dpif-netdev-private-dpif.h +++ b/lib/dpif-netdev-private-dpif.h @@ -18,6 +18,11 @@ #define DPIF_NETDEV_PRIVATE_DPIF_H 1 #include "openvswitch/types.h" +#include "ovs-thread.h" + +#define MAX_RECIRC_DEPTH 6 +/* Use per thread recirc_depth to prevent recirculation loop. */ +DECLARE_EXTERN_PER_THREAD_DATA(uint32_t, recirc_depth); /* Forward declarations to avoid including files. */ struct dp_netdev_pmd_thread; diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index a45b46014..4866231a3 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -98,9 +98,6 @@ VLOG_DEFINE_THIS_MODULE(dpif_netdev); #define MIN_TO_MSEC 60000 #define FLOW_DUMP_MAX_BATCH 50 -/* Use per thread recirc_depth to prevent recirculation loop. */ -#define MAX_RECIRC_DEPTH 6 -DEFINE_STATIC_PER_THREAD_DATA(uint32_t, recirc_depth, 0) /* Use instant packet send by default. */ #define DEFAULT_TX_FLUSH_INTERVAL 0 -- 2.25.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev