Commit 597c1123 authored by Tariq Toukan's avatar Tariq Toukan Committed by Saeed Mahameed

net/mlx5e: Allocate virtually contiguous memory for reps structures

Physical continuity is not necessary, and requested allocation size might
be larger than PAGE_SIZE.
Hence, use v-alloc/free API.
Signed-off-by: default avatarTariq Toukan <tariqt@nvidia.com>
Reviewed-by: default avatarMoshe Shemesh <moshe@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 035e0dd5
...@@ -412,8 +412,8 @@ int mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv) ...@@ -412,8 +412,8 @@ int mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv)
MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_TX_PORT_TS)); MLX5E_GET_PFLAG(&priv->channels.params, MLX5E_PFLAG_TX_PORT_TS));
nch = priv->channels.num + ptp_sq; nch = priv->channels.num + ptp_sq;
sqs = kcalloc(nch * mlx5e_get_dcb_num_tc(&priv->channels.params), sizeof(*sqs), sqs = kvcalloc(nch * mlx5e_get_dcb_num_tc(&priv->channels.params), sizeof(*sqs),
GFP_KERNEL); GFP_KERNEL);
if (!sqs) if (!sqs)
goto out; goto out;
...@@ -430,7 +430,7 @@ int mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv) ...@@ -430,7 +430,7 @@ int mlx5e_add_sqs_fwd_rules(struct mlx5e_priv *priv)
} }
err = mlx5e_sqs2vport_start(esw, rep, sqs, num_sqs); err = mlx5e_sqs2vport_start(esw, rep, sqs, num_sqs);
kfree(sqs); kvfree(sqs);
out: out:
if (err) if (err)
...@@ -1269,7 +1269,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) ...@@ -1269,7 +1269,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
struct mlx5e_rep_priv *rpriv; struct mlx5e_rep_priv *rpriv;
int err; int err;
rpriv = kzalloc(sizeof(*rpriv), GFP_KERNEL); rpriv = kvzalloc(sizeof(*rpriv), GFP_KERNEL);
if (!rpriv) if (!rpriv)
return -ENOMEM; return -ENOMEM;
...@@ -1284,7 +1284,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep) ...@@ -1284,7 +1284,7 @@ mlx5e_vport_rep_load(struct mlx5_core_dev *dev, struct mlx5_eswitch_rep *rep)
err = mlx5e_vport_vf_rep_load(dev, rep); err = mlx5e_vport_vf_rep_load(dev, rep);
if (err) if (err)
kfree(rpriv); kvfree(rpriv);
return err; return err;
} }
...@@ -1312,7 +1312,7 @@ mlx5e_vport_rep_unload(struct mlx5_eswitch_rep *rep) ...@@ -1312,7 +1312,7 @@ mlx5e_vport_rep_unload(struct mlx5_eswitch_rep *rep)
priv->profile->cleanup(priv); priv->profile->cleanup(priv);
mlx5e_destroy_netdev(priv); mlx5e_destroy_netdev(priv);
free_ppriv: free_ppriv:
kfree(ppriv); /* mlx5e_rep_priv */ kvfree(ppriv); /* mlx5e_rep_priv */
} }
static void *mlx5e_vport_rep_get_proto_dev(struct mlx5_eswitch_rep *rep) static void *mlx5e_vport_rep_get_proto_dev(struct mlx5_eswitch_rep *rep)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment