public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Guy Levi <guyle@mellanox.com>, Yishai Hadas <yishaih@nvidia.com>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	linux-rdma@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] RDMA/mlx4: Make check for invalid flags stricter
Date: Tue, 4 Jul 2023 16:38:41 +0300	[thread overview]
Message-ID: <20230704133841.GD6455@unreal> (raw)
In-Reply-To: <233ed975-982d-422a-b498-410f71d8a101@moroto.mountain>

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 <dan.carpenter@linaro.org>
> ---
> 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

  reply	other threads:[~2023-07-04 13:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29  6:07 [PATCH] RDMA/mlx4: Make check for invalid flags stricter Dan Carpenter
2023-07-04 13:38 ` Leon Romanovsky [this message]
2023-07-04 14:07   ` Dan Carpenter
2023-07-04 17:19     ` Leon Romanovsky
2023-07-10 18:49     ` Jason Gunthorpe
2023-07-12 12:41 ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230704133841.GD6455@unreal \
    --to=leon@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=guyle@mellanox.com \
    --cc=jgg@ziepe.ca \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=yishaih@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox