net/mlx5: introduce helper to set IP version match