diff mbox

[rdma-next,2/2] IB/mlx5: Enlarge autogroup flow table

Message ID 20170329030901.5772-2-leon@kernel.org (mailing list archive)
State Accepted
Headers show

Commit Message

Leon Romanovsky March 29, 2017, 3:09 a.m. UTC
From: Maor Gottlieb <maorg@mellanox.com>

In order to enlarge the flow group size to 8k, we decrease
the number of flow group types to 6 and increase the flow
table size to 64k.

Flow group size is calculated as follow:
  group_size = table_size / (#group_types + 1)

Fixes: 038d2ef87572 ('IB/mlx5: Add flow steering support')
Signed-off-by: Maor Gottlieb <maorg@mellanox.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
---
 drivers/infiniband/hw/mlx5/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Bart Van Assche March 29, 2017, 3:20 a.m. UTC | #1
On Wed, 2017-03-29 at 06:09 +0300, Leon Romanovsky wrote:
> -#define MLX5_FS_MAX_TYPES	 10

> -#define MLX5_FS_MAX_ENTRIES	 32000UL

> +#define MLX5_FS_MAX_TYPES	 6

> +#define MLX5_FS_MAX_ENTRIES	 BIT(16)


Hello Leon and Maor,

The use of the BIT() macro here looks misleading to me. Elsewhere in the
kernel BIT() is used to represent a bitmask. My understanding is that
MLX5_FS_MAX_ENTRIES is not a bitmask but a value?

Thanks,

Bart.
Leon Romanovsky March 29, 2017, 4:23 a.m. UTC | #2
On Wed, Mar 29, 2017 at 03:20:37AM +0000, Bart Van Assche wrote:
> On Wed, 2017-03-29 at 06:09 +0300, Leon Romanovsky wrote:
> > -#define MLX5_FS_MAX_TYPES	 10
> > -#define MLX5_FS_MAX_ENTRIES	 32000UL
> > +#define MLX5_FS_MAX_TYPES	 6
> > +#define MLX5_FS_MAX_ENTRIES	 BIT(16)
>
> Hello Leon and Maor,
>
> The use of the BIT() macro here looks misleading to me. Elsewhere in the
> kernel BIT() is used to represent a bitmask. My understanding is that
> MLX5_FS_MAX_ENTRIES is not a bitmask but a value?

Hello Bart,

I agree with you that the name "MAX_ENTRIES" is misleading. This define
MLX5_FS_MAX_ENTRIES is needed to compare num_entries with max_table_size
which is represented in BIT() format. The max_table was added in previous
patch and we thought that it will be much convenient for the reader to
compare the same BIT(..) constructions.

If you think that we abused the BIT() macro, let me know and I'll send
updated version (without BIT()).

>
> Thanks,

Thanks

>
> Bart.
Bart Van Assche March 29, 2017, 4:15 p.m. UTC | #3
On Wed, 2017-03-29 at 07:23 +0300, Leon Romanovsky wrote:
> On Wed, Mar 29, 2017 at 03:20:37AM +0000, Bart Van Assche wrote:
> > On Wed, 2017-03-29 at 06:09 +0300, Leon Romanovsky wrote:
> > > -#define MLX5_FS_MAX_TYPES	 10
> > > -#define MLX5_FS_MAX_ENTRIES	 32000UL
> > > +#define MLX5_FS_MAX_TYPES	 6
> > > +#define MLX5_FS_MAX_ENTRIES	 BIT(16)
> > 
> > Hello Leon and Maor,
> > 
> > The use of the BIT() macro here looks misleading to me. Elsewhere in the
> > kernel BIT() is used to represent a bitmask. My understanding is that
> > MLX5_FS_MAX_ENTRIES is not a bitmask but a value?
> 
> Hello Bart,
> 
> I agree with you that the name "MAX_ENTRIES" is misleading. This define
> MLX5_FS_MAX_ENTRIES is needed to compare num_entries with max_table_size
> which is represented in BIT() format. The max_table was added in previous
> patch and we thought that it will be much convenient for the reader to
> compare the same BIT(..) constructions.
> 
> If you think that we abused the BIT() macro, let me know and I'll send
> updated version (without BIT()).

Hello Leon,

It's not that important to me, but does MLX5_FS_MAX_ENTRIES represent a number
or a bitmask? To me the name "MLX5_FS_MAX_ENTRIES" suggests that it is a number
and using BIT() suggests that it's a bitmask. This seems contradictory to me.

Thanks,

Bart.--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky March 30, 2017, 3 p.m. UTC | #4
On Wed, Mar 29, 2017 at 04:15:10PM +0000, Bart Van Assche wrote:
> On Wed, 2017-03-29 at 07:23 +0300, Leon Romanovsky wrote:
> > On Wed, Mar 29, 2017 at 03:20:37AM +0000, Bart Van Assche wrote:
> > > On Wed, 2017-03-29 at 06:09 +0300, Leon Romanovsky wrote:
> > > > -#define MLX5_FS_MAX_TYPES	 10
> > > > -#define MLX5_FS_MAX_ENTRIES	 32000UL
> > > > +#define MLX5_FS_MAX_TYPES	 6
> > > > +#define MLX5_FS_MAX_ENTRIES	 BIT(16)
> > >
> > > Hello Leon and Maor,
> > >
> > > The use of the BIT() macro here looks misleading to me. Elsewhere in the
> > > kernel BIT() is used to represent a bitmask. My understanding is that
> > > MLX5_FS_MAX_ENTRIES is not a bitmask but a value?
> >
> > Hello Bart,
> >
> > I agree with you that the name "MAX_ENTRIES" is misleading. This define
> > MLX5_FS_MAX_ENTRIES is needed to compare num_entries with max_table_size
> > which is represented in BIT() format. The max_table was added in previous
> > patch and we thought that it will be much convenient for the reader to
> > compare the same BIT(..) constructions.
> >
> > If you think that we abused the BIT() macro, let me know and I'll send
> > updated version (without BIT()).
>
> Hello Leon,
>
> It's not that important to me, but does MLX5_FS_MAX_ENTRIES represent a number
> or a bitmask? To me the name "MLX5_FS_MAX_ENTRIES" suggests that it is a number
> and using BIT() suggests that it's a bitmask. This seems contradictory to me.

Down the road, that define is translated to bitmask, and it is hard for me
to categorize it. If we limit ourselves to the upper layer only, it will be a number,
otherwise it will be a bitmask.

>
> Thanks,
>
> Bart.--
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
index 1bef4f5da31c..ca2cb2861afc 100644
--- a/drivers/infiniband/hw/mlx5/main.c
+++ b/drivers/infiniband/hw/mlx5/main.c
@@ -2038,8 +2038,8 @@  enum flow_table_type {
 	MLX5_IB_FT_TX
 };
 
-#define MLX5_FS_MAX_TYPES	 10
-#define MLX5_FS_MAX_ENTRIES	 32000UL
+#define MLX5_FS_MAX_TYPES	 6
+#define MLX5_FS_MAX_ENTRIES	 BIT(16)
 static struct mlx5_ib_flow_prio *get_flow_table(struct mlx5_ib_dev *dev,
 						struct ib_flow_attr *flow_attr,
 						enum flow_table_type ft_type)