Re: [PATCH net] mlx5: avoid 64-bit division in dr_icm_pool_mr_create()
On 10/2/2019 3:12 PM, Michal Kubecek wrote: > Recently added code introduces 64-bit division in dr_icm_pool_mr_create() > so that build on 32-bit architectures fails with > >ERROR: "__umoddi3" [drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.ko] > undefined! > > As the divisor is always a power of 2, we can use bitwise operation > instead. > > Fixes: 29cf8febd185 ("net/mlx5: DR, ICM pool memory allocator") > Reported-by: Borislav Petkov > Signed-off-by: Michal Kubecek > --- > drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c > b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c > index 913f1e5aaaf2..d7c7467e2d53 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_icm_pool.c > @@ -137,7 +137,8 @@ dr_icm_pool_mr_create(struct mlx5dr_icm_pool *pool, > > icm_mr->icm_start_addr = icm_mr->dm.addr; > > - align_diff = icm_mr->icm_start_addr % align_base; > + /* align_base is always a power of 2 */ > + align_diff = icm_mr->icm_start_addr & (align_base - 1); > if (align_diff) > icm_mr->used_length = align_base - align_diff; > Align diff is power of 2, looks good to me. Thanks for fixing it Michal.
Re: [PATCH net-next v2 1/2] fs/crashdd: add API to collect hardware dump in second kernel
On 4/2/2018 12:12 PM, Jiri Pirko wrote: Fri, Mar 30, 2018 at 05:11:29PM CEST, and...@lunn.ch wrote: Please see: http://patchwork.ozlabs.org/project/netdev/list/?series=36524 I bevieve that the solution in the patchset could be used for your usecase too. Hi Jiri https://lkml.org/lkml/2018/3/20/436 How well does this API work for a 2Gbyte snapshot? Ccing Alex who did the tests. I didn't check the performance for such a large snapshot. From my measurement it takes 0.09s for 1 MB of data this means about ~3m. This can be tuned and improved since this is a socket application. Andrew
Re: [PATCH net-next v2 1/2] fs/crashdd: add API to collect hardware dump in second kernel
On 4/2/2018 12:12 PM, Jiri Pirko wrote: Fri, Mar 30, 2018 at 05:11:29PM CEST, and...@lunn.ch wrote: Please see: http://patchwork.ozlabs.org/project/netdev/list/?series=36524 I bevieve that the solution in the patchset could be used for your usecase too. Hi Jiri https://lkml.org/lkml/2018/3/20/436 How well does this API work for a 2Gbyte snapshot? Ccing Alex who did the tests. I didn't check the performance for such a large snapshot. From my measurement it takes 0.09s for 1 MB of data this means about ~3m. This can be tuned and improved since this is a socket application. Andrew