Is this patch necessary? I don't see the usage of 
dpif_netdev_packet_get_rss_hash() change in the patch set. I can also remove 
this patch from the series and still build and test the way I did before.

Am I missing something here?

> -----Original Message-----
> From: Amber, Kumar <[email protected]>
> Sent: Sunday 27 March 2022 08:09
> To: [email protected]
> Cc: Stokes, Ian <[email protected]>; [email protected]; 
> [email protected]; [email protected];
> Ferriter, Cian <[email protected]>; [email protected]; Van Haaren, Harry
> <[email protected]>; Amber, Kumar <[email protected]>
> Subject: [PATCH v2 2/4] dpif-netdev: Refactor hashing function.
> 
> The changes moves the get_rss hashing function to its
> own .h files so that it can be used accross ovs which
> was previously only limited to dpif-netdev.c.
> 
> Signed-off-by: Kumar Amber <[email protected]>
> Signed-off-by: Cian Ferriter <[email protected]>
> Co-authored-by: Cian Ferriter <[email protected]>
> ---
>  lib/dpif-netdev-private-dpcls.h | 23 +++++++++++++++++++++++
>  lib/dpif-netdev.c               | 22 ----------------------
>  2 files changed, 23 insertions(+), 22 deletions(-)
> 
> diff --git a/lib/dpif-netdev-private-dpcls.h b/lib/dpif-netdev-private-dpcls.h
> index 0d5da73c7..a86ea449b 100644
> --- a/lib/dpif-netdev-private-dpcls.h
> +++ b/lib/dpif-netdev-private-dpcls.h
> @@ -25,6 +25,7 @@
> 
>  #include "cmap.h"
>  #include "openvswitch/thread.h"
> +#include "dpif-netdev-private-dpif.h"
> 
>  #ifdef  __cplusplus
>  extern "C" {
> @@ -124,6 +125,28 @@ dpif_netdev_packet_get_rss_hash_orig_pkt(struct 
> dp_packet *packet,
>      return hash;
>  }
> 
> +static inline uint32_t
> +dpif_netdev_packet_get_rss_hash(struct dp_packet *packet,
> +                                const struct miniflow *mf)
> +{
> +    uint32_t hash;
> +
> +    if (OVS_LIKELY(dp_packet_rss_valid(packet))) {
> +        hash = dp_packet_get_rss_hash(packet);
> +    } else {
> +        hash = miniflow_hash_5tuple(mf, 0);
> +        dp_packet_set_rss_hash(packet, hash);
> +    }
> +
> +    /* The RSS hash must account for the recirculation depth to avoid
> +     * collisions in the exact match cache */
> +    uint32_t recirc_depth = *recirc_depth_get();
> +    if (OVS_UNLIKELY(recirc_depth)) {
> +        hash = hash_finish(hash, recirc_depth);
> +    }
> +    return hash;
> +}
> +
>  /* Allow other implementations to call dpcls_lookup() for subtable search. */
>  bool
>  dpcls_lookup(struct dpcls *cls, const struct netdev_flow_key *keys[],
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
> index 5c2123e0c..5fc68bdbe 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -7787,28 +7787,6 @@ dp_netdev_upcall(struct dp_netdev_pmd_thread *pmd, 
> struct dp_packet *packet_,
>                           actions, wc, put_actions, dp->upcall_aux);
>  }
> 
> -static inline uint32_t
> -dpif_netdev_packet_get_rss_hash(struct dp_packet *packet,
> -                                const struct miniflow *mf)
> -{
> -    uint32_t hash, recirc_depth;
> -
> -    if (OVS_LIKELY(dp_packet_rss_valid(packet))) {
> -        hash = dp_packet_get_rss_hash(packet);
> -    } else {
> -        hash = miniflow_hash_5tuple(mf, 0);
> -        dp_packet_set_rss_hash(packet, hash);
> -    }
> -
> -    /* The RSS hash must account for the recirculation depth to avoid
> -     * collisions in the exact match cache */
> -    recirc_depth = *recirc_depth_get_unsafe();
> -    if (OVS_UNLIKELY(recirc_depth)) {
> -        hash = hash_finish(hash, recirc_depth);
> -    }
> -    return hash;
> -}
> -
>  struct packet_batch_per_flow {
>      unsigned int byte_count;
>      uint16_t tcp_flags;
> --
> 2.25.1

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

Reply via email to