From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
Adham Faris <afaris@nvidia.com>,
kernel test robot <lkp@intel.com>,
Dan Carpenter <error27@gmail.com>
Subject: [net 03/10] net/mlx5e: Remove redundant xsk pointer check in mlx5e_mpwrq_validate_xsk
Date: Wed, 18 Jan 2023 00:04:07 -0800 [thread overview]
Message-ID: <20230118080414.77902-4-saeed@kernel.org> (raw)
In-Reply-To: <20230118080414.77902-1-saeed@kernel.org>
From: Adham Faris <afaris@nvidia.com>
This validation function is relevant only for XSK cases, hence it
assumes to be called only with xsk != NULL.
Thus checking for invalid xsk pointer is redundant and misleads static
code analyzers.
This commit removes redundant xsk pointer check.
This solves the following smatch warning:
drivers/net/ethernet/mellanox/mlx5/core/en/params.c:481
mlx5e_mpwrq_validate_xsk() error: we previously assumed 'xsk' could be
null (see line 478)
Fixes: 6470d2e7e8ed ("net/mlx5e: xsk: Use KSM for unaligned XSK")
Signed-off-by: Adham Faris <afaris@nvidia.com>
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/params.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
index 585bdc8383ee..4ad19c981294 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/params.c
@@ -578,7 +578,6 @@ int mlx5e_mpwrq_validate_xsk(struct mlx5_core_dev *mdev, struct mlx5e_params *pa
{
enum mlx5e_mpwrq_umr_mode umr_mode = mlx5e_mpwrq_umr_mode(mdev, xsk);
u8 page_shift = mlx5e_mpwrq_page_shift(mdev, xsk);
- bool unaligned = xsk ? xsk->unaligned : false;
u16 max_mtu_pkts;
if (!mlx5e_check_fragmented_striding_rq_cap(mdev, page_shift, umr_mode))
@@ -591,7 +590,7 @@ int mlx5e_mpwrq_validate_xsk(struct mlx5_core_dev *mdev, struct mlx5e_params *pa
* needed number of WQEs exceeds the maximum.
*/
max_mtu_pkts = min_t(u8, MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE,
- mlx5e_mpwrq_max_log_rq_pkts(mdev, page_shift, unaligned));
+ mlx5e_mpwrq_max_log_rq_pkts(mdev, page_shift, xsk->unaligned));
if (params->log_rq_mtu_frames > max_mtu_pkts) {
mlx5_core_err(mdev, "Current RQ length %d is too big for XSK with given frame size %u\n",
1 << params->log_rq_mtu_frames, xsk->chunk_size);
--
2.39.0
next prev parent reply other threads:[~2023-01-18 8:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 8:04 [pull request][net 00/10] mlx5 fixes 2023-01-18 Saeed Mahameed
2023-01-18 8:04 ` [net 01/10] net/mlx5: fix missing mutex_unlock in mlx5_fw_fatal_reporter_err_work() Saeed Mahameed
2023-01-19 14:50 ` patchwork-bot+netdevbpf
2023-01-18 8:04 ` [net 02/10] net/mlx5e: Avoid false lock dependency warning on tc_ht even more Saeed Mahameed
2023-01-18 8:04 ` Saeed Mahameed [this message]
2023-01-18 8:04 ` [net 04/10] net/mlx5: E-switch, Fix setting of reserved fields on MODIFY_SCHEDULING_ELEMENT Saeed Mahameed
2023-01-18 8:04 ` [net 05/10] net/mlx5e: QoS, Fix wrongfully setting parent_element_id " Saeed Mahameed
2023-01-18 8:04 ` [net 06/10] net/mlx5e: Set decap action based on attr for sample Saeed Mahameed
2023-01-18 8:04 ` [net 07/10] net/mlx5e: Remove optimization which prevented update of ESN state Saeed Mahameed
2023-01-18 8:04 ` [net 08/10] net/mlx5e: Protect global IPsec ASO Saeed Mahameed
2023-01-18 8:04 ` [net 09/10] net/mlx5: E-switch, Fix switchdev mode after devlink reload Saeed Mahameed
2023-01-18 8:04 ` [net 10/10] net: mlx5: eliminate anonymous module_init & module_exit Saeed Mahameed
2023-01-19 4:55 ` [pull request][net 00/10] mlx5 fixes 2023-01-18 Jakub Kicinski
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=20230118080414.77902-4-saeed@kernel.org \
--to=saeed@kernel.org \
--cc=afaris@nvidia.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=error27@gmail.com \
--cc=kuba@kernel.org \
--cc=lkp@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=tariqt@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;
as well as URLs for NNTP newsgroup(s).