Commit 0373d712 authored by Jakub Kicinski's avatar Jakub Kicinski

Merge branch 'mlx5-misc-fixes-2024-08-15'

Tariq Toukan says:

====================
mlx5 misc fixes 2024-08-15

This patchset provides misc bug fixes from the team to the mlx5 driver.
====================

Link: https://patch.msgid.link/20240815071611.2211873-1-tariqt@nvidia.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 3d93a144 607e1df7
...@@ -998,6 +998,7 @@ void mlx5e_build_ptys2ethtool_map(void); ...@@ -998,6 +998,7 @@ void mlx5e_build_ptys2ethtool_map(void);
bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev, u8 page_shift, bool mlx5e_check_fragmented_striding_rq_cap(struct mlx5_core_dev *mdev, u8 page_shift,
enum mlx5e_mpwrq_umr_mode umr_mode); enum mlx5e_mpwrq_umr_mode umr_mode);
void mlx5e_shampo_fill_umr(struct mlx5e_rq *rq, int len);
void mlx5e_shampo_dealloc_hd(struct mlx5e_rq *rq); void mlx5e_shampo_dealloc_hd(struct mlx5e_rq *rq);
void mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats); void mlx5e_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats);
void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s); void mlx5e_fold_sw_stats64(struct mlx5e_priv *priv, struct rtnl_link_stats64 *s);
......
...@@ -1236,6 +1236,14 @@ void mlx5e_free_rx_missing_descs(struct mlx5e_rq *rq) ...@@ -1236,6 +1236,14 @@ void mlx5e_free_rx_missing_descs(struct mlx5e_rq *rq)
rq->mpwqe.actual_wq_head = wq->head; rq->mpwqe.actual_wq_head = wq->head;
rq->mpwqe.umr_in_progress = 0; rq->mpwqe.umr_in_progress = 0;
rq->mpwqe.umr_completed = 0; rq->mpwqe.umr_completed = 0;
if (test_bit(MLX5E_RQ_STATE_SHAMPO, &rq->state)) {
struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo;
u16 len;
len = (shampo->pi - shampo->ci) & shampo->hd_per_wq;
mlx5e_shampo_fill_umr(rq, len);
}
} }
void mlx5e_free_rx_descs(struct mlx5e_rq *rq) void mlx5e_free_rx_descs(struct mlx5e_rq *rq)
...@@ -3020,15 +3028,18 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv) ...@@ -3020,15 +3028,18 @@ int mlx5e_update_tx_netdev_queues(struct mlx5e_priv *priv)
static void mlx5e_set_default_xps_cpumasks(struct mlx5e_priv *priv, static void mlx5e_set_default_xps_cpumasks(struct mlx5e_priv *priv,
struct mlx5e_params *params) struct mlx5e_params *params)
{ {
struct mlx5_core_dev *mdev = priv->mdev; int ix;
int num_comp_vectors, ix, irq;
num_comp_vectors = mlx5_comp_vectors_max(mdev);
for (ix = 0; ix < params->num_channels; ix++) { for (ix = 0; ix < params->num_channels; ix++) {
int num_comp_vectors, irq, vec_ix;
struct mlx5_core_dev *mdev;
mdev = mlx5_sd_ch_ix_get_dev(priv->mdev, ix);
num_comp_vectors = mlx5_comp_vectors_max(mdev);
cpumask_clear(priv->scratchpad.cpumask); cpumask_clear(priv->scratchpad.cpumask);
vec_ix = mlx5_sd_ch_ix_get_vec_ix(mdev, ix);
for (irq = ix; irq < num_comp_vectors; irq += params->num_channels) { for (irq = vec_ix; irq < num_comp_vectors; irq += params->num_channels) {
int cpu = mlx5_comp_vector_get_cpu(mdev, irq); int cpu = mlx5_comp_vector_get_cpu(mdev, irq);
cpumask_set_cpu(cpu, priv->scratchpad.cpumask); cpumask_set_cpu(cpu, priv->scratchpad.cpumask);
......
...@@ -735,6 +735,7 @@ static int mlx5e_alloc_rx_hd_mpwqe(struct mlx5e_rq *rq) ...@@ -735,6 +735,7 @@ static int mlx5e_alloc_rx_hd_mpwqe(struct mlx5e_rq *rq)
ksm_entries = bitmap_find_window(shampo->bitmap, ksm_entries = bitmap_find_window(shampo->bitmap,
shampo->hd_per_wqe, shampo->hd_per_wqe,
shampo->hd_per_wq, shampo->pi); shampo->hd_per_wq, shampo->pi);
ksm_entries = ALIGN_DOWN(ksm_entries, MLX5E_SHAMPO_WQ_HEADER_PER_PAGE);
if (!ksm_entries) if (!ksm_entries)
return 0; return 0;
...@@ -962,26 +963,31 @@ void mlx5e_free_icosq_descs(struct mlx5e_icosq *sq) ...@@ -962,26 +963,31 @@ void mlx5e_free_icosq_descs(struct mlx5e_icosq *sq)
sq->cc = sqcc; sq->cc = sqcc;
} }
static void mlx5e_handle_shampo_hd_umr(struct mlx5e_shampo_umr umr, void mlx5e_shampo_fill_umr(struct mlx5e_rq *rq, int len)
struct mlx5e_icosq *sq)
{ {
struct mlx5e_channel *c = container_of(sq, struct mlx5e_channel, icosq); struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo;
struct mlx5e_shampo_hd *shampo; int end, from, full_len = len;
/* assume 1:1 relationship between RQ and icosq */
struct mlx5e_rq *rq = &c->rq;
int end, from, len = umr.len;
shampo = rq->mpwqe.shampo;
end = shampo->hd_per_wq; end = shampo->hd_per_wq;
from = shampo->ci; from = shampo->ci;
if (from + len > shampo->hd_per_wq) { if (from + len > end) {
len -= end - from; len -= end - from;
bitmap_set(shampo->bitmap, from, end - from); bitmap_set(shampo->bitmap, from, end - from);
from = 0; from = 0;
} }
bitmap_set(shampo->bitmap, from, len); bitmap_set(shampo->bitmap, from, len);
shampo->ci = (shampo->ci + umr.len) & (shampo->hd_per_wq - 1); shampo->ci = (shampo->ci + full_len) & (shampo->hd_per_wq - 1);
}
static void mlx5e_handle_shampo_hd_umr(struct mlx5e_shampo_umr umr,
struct mlx5e_icosq *sq)
{
struct mlx5e_channel *c = container_of(sq, struct mlx5e_channel, icosq);
/* assume 1:1 relationship between RQ and icosq */
struct mlx5e_rq *rq = &c->rq;
mlx5e_shampo_fill_umr(rq, umr.len);
} }
int mlx5e_poll_ico_cq(struct mlx5e_cq *cq) int mlx5e_poll_ico_cq(struct mlx5e_cq *cq)
......
...@@ -386,7 +386,8 @@ static int ipsec_fs_roce_tx_mpv_create(struct mlx5_core_dev *mdev, ...@@ -386,7 +386,8 @@ static int ipsec_fs_roce_tx_mpv_create(struct mlx5_core_dev *mdev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
peer_priv = mlx5_devcom_get_next_peer_data(*ipsec_roce->devcom, &tmp); peer_priv = mlx5_devcom_get_next_peer_data(*ipsec_roce->devcom, &tmp);
if (!peer_priv) { if (!peer_priv || !peer_priv->ipsec) {
mlx5_core_err(mdev, "IPsec not supported on master device\n");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto release_peer; goto release_peer;
} }
...@@ -455,7 +456,8 @@ static int ipsec_fs_roce_rx_mpv_create(struct mlx5_core_dev *mdev, ...@@ -455,7 +456,8 @@ static int ipsec_fs_roce_rx_mpv_create(struct mlx5_core_dev *mdev,
return -EOPNOTSUPP; return -EOPNOTSUPP;
peer_priv = mlx5_devcom_get_next_peer_data(*ipsec_roce->devcom, &tmp); peer_priv = mlx5_devcom_get_next_peer_data(*ipsec_roce->devcom, &tmp);
if (!peer_priv) { if (!peer_priv || !peer_priv->ipsec) {
mlx5_core_err(mdev, "IPsec not supported on master device\n");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto release_peer; goto release_peer;
} }
......
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