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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07617C001B0 for ; Tue, 4 Jul 2023 13:39:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbjGDNjN (ORCPT ); Tue, 4 Jul 2023 09:39:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231287AbjGDNjM (ORCPT ); Tue, 4 Jul 2023 09:39:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7453710E9; Tue, 4 Jul 2023 06:38:50 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0227D61233; Tue, 4 Jul 2023 13:38:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83F00C433C7; Tue, 4 Jul 2023 13:38:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1688477929; bh=FSssLGG07LMCBwfEBfa/VdfDAgvNSLFXksXtukkgDHk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XmofkqpwAFQfiJ1NsJfiahXWuMSkuD0tuzi+nQNLl6Eugcb0zkykuSMsIyiOdvt3W QEaDceeUsXEvcHLEjKtEj8a+lhvUAX/QsdX8VnjRxngb2evWKZWcCh89aUag20XAm9 5W+X1kJe4bEY6YZjCTytKpcnA6VncRohRZEcAd9eWs+YpxpIGgzOp5Dy9JQ0FPbxn7 nDHTklZ6xHtHUIPNaII2cI28dKtoHSuBxZP3vmBiMjCCkjjmx0N+0G42RDZ72K1zDg /7/wKkx2YF1JVqY7c1J5w03rs9mboGF5c1sxQGZqJtPKr8WMXzJjAPsT3Tf33tiuuW Ens9/Hd2dzr0Q== Date: Tue, 4 Jul 2023 16:38:41 +0300 From: Leon Romanovsky To: Dan Carpenter Cc: Guy Levi , Yishai Hadas , Jason Gunthorpe , linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] RDMA/mlx4: Make check for invalid flags stricter Message-ID: <20230704133841.GD6455@unreal> References: <233ed975-982d-422a-b498-410f71d8a101@moroto.mountain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <233ed975-982d-422a-b498-410f71d8a101@moroto.mountain> Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org On Thu, Jun 29, 2023 at 09:07:37AM +0300, Dan Carpenter wrote: > This code is trying to ensure that only the flags specified in the list > are allowed. The problem is that ucmd->rx_hash_fields_mask is a u64 and > the flags are an enum which is treated as a u32 in this context. That > means the test doesn't check whether the highest 32 bits are zero. > > Fixes: 4d02ebd9bbbd ("IB/mlx4: Fix RSS hash fields restrictions") > Signed-off-by: Dan Carpenter > --- > The MLX4_IB_RX_HASH_INNER value is declared as > "MLX4_IB_RX_HASH_INNER = 1ULL << 31," which suggests that it > should be type ULL but that doesn't work. It will still be basically a > u32. (Enum types are weird). Can you please elaborate more why enum left to be int? It is surprise to me. Thanks