All of lore.kernel.org
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Roi Dayan <roid@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>
Subject: [net-next 11/16] net/mlx5: DR, Alloc cmd buffer with kvzalloc() instead of kzalloc()
Date: Tue, 13 Apr 2021 12:30:01 -0700	[thread overview]
Message-ID: <20210413193006.21650-12-saeed@kernel.org> (raw)
In-Reply-To: <20210413193006.21650-1-saeed@kernel.org>

From: Roi Dayan <roid@nvidia.com>

The cmd size is 8K so use kvzalloc().

Signed-off-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c  | 4 ++--
 drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c
index 30b0136b5bc7..461473d31e2e 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_cmd.c
@@ -287,7 +287,7 @@ int mlx5dr_cmd_create_empty_flow_group(struct mlx5_core_dev *mdev,
 	u32 *in;
 	int err;
 
-	in = kzalloc(inlen, GFP_KERNEL);
+	in = kvzalloc(inlen, GFP_KERNEL);
 	if (!in)
 		return -ENOMEM;
 
@@ -302,7 +302,7 @@ int mlx5dr_cmd_create_empty_flow_group(struct mlx5_core_dev *mdev,
 	*group_id = MLX5_GET(create_flow_group_out, out, group_id);
 
 out:
-	kfree(in);
+	kvfree(in);
 	return err;
 }
 
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
index 24acced415d3..c1926d927008 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/dr_send.c
@@ -406,7 +406,7 @@ static int dr_get_tbl_copy_details(struct mlx5dr_domain *dmn,
 		alloc_size = *num_stes * DR_STE_SIZE;
 	}
 
-	*data = kzalloc(alloc_size, GFP_KERNEL);
+	*data = kvzalloc(alloc_size, GFP_KERNEL);
 	if (!*data)
 		return -ENOMEM;
 
@@ -505,7 +505,7 @@ int mlx5dr_send_postsend_htbl(struct mlx5dr_domain *dmn,
 	}
 
 out_free:
-	kfree(data);
+	kvfree(data);
 	return ret;
 }
 
@@ -562,7 +562,7 @@ int mlx5dr_send_postsend_formatted_htbl(struct mlx5dr_domain *dmn,
 	}
 
 out_free:
-	kfree(data);
+	kvfree(data);
 	return ret;
 }
 
-- 
2.30.2


  parent reply	other threads:[~2021-04-13 19:31 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-13 19:29 [pull request][net-next 00/16] mlx5 updates 2021-04-13 Saeed Mahameed
2021-04-13 19:29 ` [net-next 01/16] net/mlx5: E-Switch, let user to enable disable metadata Saeed Mahameed
2021-04-13 20:21   ` Jakub Kicinski
2021-04-13 22:40     ` Saeed Mahameed
2021-04-13 22:57       ` Jakub Kicinski
2021-04-13 19:29 ` [net-next 02/16] net/mlx5: E-Switch, Skip querying SF enabled bits Saeed Mahameed
2021-04-13 19:29 ` [net-next 03/16] net/mlx5: E-Switch, Make vport number u16 Saeed Mahameed
2021-04-13 19:29 ` [net-next 04/16] net/mlx5: E-Switch Make cleanup sequence mirror of init Saeed Mahameed
2021-04-13 19:29 ` [net-next 05/16] net/mlx5: E-Switch, Convert a macro to a helper routine Saeed Mahameed
2021-04-13 19:29 ` [net-next 06/16] net/mlx5: E-Switch, Move legacy code to a individual file Saeed Mahameed
2021-04-13 19:29 ` [net-next 07/16] net/mlx5: E-Switch, Initialize eswitch acls ns when eswitch is enabled Saeed Mahameed
2021-04-13 19:29 ` [net-next 08/16] net/mlx5: SF, Use device pointer directly Saeed Mahameed
2021-04-13 19:29 ` [net-next 09/16] net/mlx5: SF, Reuse stored hardware function id Saeed Mahameed
2021-04-13 19:30 ` [net-next 10/16] net/mlx5: DR, Use variably sized data structures for different actions Saeed Mahameed
2021-04-13 19:30 ` Saeed Mahameed [this message]
2021-04-13 19:30 ` [net-next 12/16] net/mlx5: Fix bit-wise and with zero Saeed Mahameed
2021-04-13 19:30 ` [net-next 13/16] net/mlx5: Add a blank line after declarations Saeed Mahameed
2021-04-13 19:30 ` [net-next 14/16] net/mlx5: Remove return statement exist at the end of void function Saeed Mahameed
2021-04-13 19:30 ` [net-next 15/16] net/mlx5: Replace spaces with tab at the start of a line Saeed Mahameed
2021-04-13 19:30 ` [net-next 16/16] net/mlx5e: Fix RQ creation flow for queues which doesn't support XDP Saeed Mahameed

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=20210413193006.21650-12-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=roid@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.