[ovs-dev] [PATCH v2] flow: Read recirculation depth once for whole batch in miniflow_extract

Gaëtan Rivet grive at u256.net
Wed Apr 14 16:36:24 UTC 2021


On Wed, Apr 14, 2021, at 10:55, Balazs Nemeth wrote:
> The call to recirc_depth_get involves accessing a TLS value which is
> slower than accessing the stack.
> 
> Signed-off-by: Balazs Nemeth <bnemeth at redhat.com>
> ---
>  lib/dpif-netdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index afe4d6c4c..525bec913 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -7095,6 +7095,7 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd,
>      struct dp_packet *packet;
>      const size_t cnt = dp_packet_batch_size(packets_);
>      uint32_t cur_min = pmd->ctx.emc_insert_min;
> +    const uint32_t recirc_depth = *recirc_depth_get();
>      int i;
>      uint16_t tcp_flags;
>      bool smc_enable_db;
> @@ -7127,7 +7128,7 @@ dfc_processing(struct dp_netdev_pmd_thread *pmd,
>              pkt_metadata_init(&packet->md, port_no);
>          }
>  
> -        if ((*recirc_depth_get() == 0) &&
> +        if (recirc_depth == 0 &&
>              dp_packet_has_flow_mark(packet, &mark)) {
>              flow = mark_to_flow_find(pmd, mark);
>              if (OVS_LIKELY(flow)) {
> -- 
> 2.30.2
> 
> 

Thanks!

Acked-by: Gaetan Rivet <grive at u256.net>

-- 
Gaetan Rivet


More information about the dev mailing list