From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F1CAC433E1 for ; Tue, 14 Jul 2020 06:10:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E24FA221E8 for ; Tue, 14 Jul 2020 06:10:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594707012; bh=dGj8pSWSs8dJIqpanzQ+3mYL7Zh3xfok/Q4ROWBr/m4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=lES2aC/0w6NA56ktxJgkBYheSdkKK0w9PRde2SYLplMsbkd/ig0IbqCWFWAPrVm+8 Yn58l9DDhq1A1I7fhwKIWK/Q8rkqisqmPHmzPtOycpIkkVMYqhu9SXRl2YKdHHPCV0 wwFoSOdP098SqGgaaiJKcHqFVfxbZW6sekoWoslU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725877AbgGNGKL (ORCPT ); Tue, 14 Jul 2020 02:10:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:56158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725306AbgGNGKL (ORCPT ); Tue, 14 Jul 2020 02:10:11 -0400 Received: from localhost (unknown [213.57.247.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E944E20890; Tue, 14 Jul 2020 06:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594707010; bh=dGj8pSWSs8dJIqpanzQ+3mYL7Zh3xfok/Q4ROWBr/m4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VFDqR1Py+PGaKm3v9dXNV7MQQM8gFUExhrIuk9agbmAasVYGI3+8HHCAz4v7cqaaH 9LZq5APo2z62RSHby1mbMru43N272y52oyBjjGVEy3wf//5zWIHzjxQTCdHb4a5ugj 6E9gnu0gDl4x5qZ0fcsbOLWjkNKtVNr5p8CfezJ4= Date: Tue, 14 Jul 2020 09:10:07 +0300 From: Leon Romanovsky To: Jason Gunthorpe Cc: Doug Ledford , Daria Velikovsky , linux-rdma@vger.kernel.org, Maor Gottlieb Subject: Re: [PATCH rdma-next] RDMA/mlx5: Init dest_type when create flow Message-ID: <20200714061007.GF7287@unreal> References: <20200707110259.882276-1-leon@kernel.org> <20200710194644.GA2130282@nvidia.com> <20200712174016.GC7287@unreal> <20200713115313.GA2021234@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200713115313.GA2021234@nvidia.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Mon, Jul 13, 2020 at 08:53:13AM -0300, Jason Gunthorpe wrote: > On Sun, Jul 12, 2020 at 08:40:16PM +0300, Leon Romanovsky wrote: > > On Fri, Jul 10, 2020 at 04:46:44PM -0300, Jason Gunthorpe wrote: > > > On Tue, Jul 07, 2020 at 02:02:59PM +0300, Leon Romanovsky wrote: > > > > From: Daria Velikovsky > > > > > > > > When using action drop dest_type was never assigned to any value. > > > > Add initialization of dest_type to -1 since 0 is valid. > > > > > > > > Fixes: f29de9eee782 ("RDMA/mlx5: Add support for drop action in DV steering") > > > > Signed-off-by: Daria Velikovsky > > > > Reviewed-by: Maor Gottlieb > > > > Signed-off-by: Leon Romanovsky > > > > Based on > > > > https://lore.kernel.org/lkml/20200702081809.423482-1-leon@kernel.org > > > > drivers/infiniband/hw/mlx5/fs.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/infiniband/hw/mlx5/fs.c b/drivers/infiniband/hw/mlx5/fs.c > > > > index 0d8abb7c3cdf..1a7e6226f11a 100644 > > > > +++ b/drivers/infiniband/hw/mlx5/fs.c > > > > @@ -1903,7 +1903,7 @@ static int UVERBS_HANDLER(MLX5_IB_METHOD_CREATE_FLOW)( > > > > struct mlx5_flow_context flow_context = {.flow_tag = > > > > MLX5_FS_DEFAULT_FLOW_TAG}; > > > > u32 *offset_attr, offset = 0, counter_id = 0; > > > > - int dest_id, dest_type, inlen, len, ret, i; > > > > + int dest_id, dest_type = -1, inlen, len, ret, i; > > > > > > I think this should be done inside get_dests() - it is pretty ugly to > > > have an function with an output pointer that is only filled sometimes > > > on success. > > > > This was original patch which I rewrote because don't like the approach > > when function changes fields when it doesn't need to change. I prefer > > the current approach where caller has explicitly decided which default > > value he wants. > > How is it a "default value" ? The function's job is to fill dest_type, > it should fill it correctly or fail It is one of the possible implementations to fix the bug, I presented different way that is preferrable by me. Do you think that it is so important that we MUST do your variant? Thanks > > Jason