Skip to content

Commit fe16667

Browse files
committed
Merge branch 'mlx5-misc-fixes-2024-07-30'
Tariq Toukan says: ==================== mlx5 misc fixes 2024-07-30 This patchset provides misc bug fixes from the team to the mlx5 core and Eth drivers. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 8f73ef8 + 3f8e82a commit fe16667

File tree

9 files changed

+26
-11
lines changed

9 files changed

+26
-11
lines changed

drivers/net/ethernet/mellanox/mlx5/core/en/tc_ct.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -932,6 +932,7 @@ mlx5_tc_ct_entry_replace_rule(struct mlx5_tc_ct_priv *ct_priv,
932932
mlx5_tc_ct_entry_destroy_mod_hdr(ct_priv, zone_rule->attr, mh);
933933
mlx5_put_label_mapping(ct_priv, attr->ct_attr.ct_labels_id);
934934
err_mod_hdr:
935+
*attr = *old_attr;
935936
kfree(old_attr);
936937
err_attr:
937938
kvfree(spec);

drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,10 @@ u32 mlx5_ipsec_device_caps(struct mlx5_core_dev *mdev)
5151
MLX5_CAP_FLOWTABLE_NIC_RX(mdev, decap))
5252
caps |= MLX5_IPSEC_CAP_PACKET_OFFLOAD;
5353

54-
if ((MLX5_CAP_FLOWTABLE_NIC_TX(mdev, ignore_flow_level) &&
55-
MLX5_CAP_FLOWTABLE_NIC_RX(mdev, ignore_flow_level)) ||
56-
MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, ignore_flow_level))
54+
if (IS_ENABLED(CONFIG_MLX5_CLS_ACT) &&
55+
((MLX5_CAP_FLOWTABLE_NIC_TX(mdev, ignore_flow_level) &&
56+
MLX5_CAP_FLOWTABLE_NIC_RX(mdev, ignore_flow_level)) ||
57+
MLX5_CAP_ESW_FLOWTABLE_FDB(mdev, ignore_flow_level)))
5758
caps |= MLX5_IPSEC_CAP_PRIO;
5859

5960
if (MLX5_CAP_FLOWTABLE_NIC_TX(mdev,

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1409,7 +1409,12 @@ static int mlx5e_ethtool_set_link_ksettings(struct mlx5e_priv *priv,
14091409
if (!an_changes && link_modes == eproto.admin)
14101410
goto out;
14111411

1412-
mlx5_port_set_eth_ptys(mdev, an_disable, link_modes, ext);
1412+
err = mlx5_port_set_eth_ptys(mdev, an_disable, link_modes, ext);
1413+
if (err) {
1414+
netdev_err(priv->netdev, "%s: failed to set ptys reg: %d\n", __func__, err);
1415+
goto out;
1416+
}
1417+
14131418
mlx5_toggle_port_link(mdev);
14141419

14151420
out:

drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ int mlx5_fw_reset_set_live_patch(struct mlx5_core_dev *dev)
207207
static void mlx5_fw_reset_complete_reload(struct mlx5_core_dev *dev, bool unloaded)
208208
{
209209
struct mlx5_fw_reset *fw_reset = dev->priv.fw_reset;
210+
struct devlink *devlink = priv_to_devlink(dev);
210211

211212
/* if this is the driver that initiated the fw reset, devlink completed the reload */
212213
if (test_bit(MLX5_FW_RESET_FLAGS_PENDING_COMP, &fw_reset->reset_flags)) {
@@ -218,9 +219,11 @@ static void mlx5_fw_reset_complete_reload(struct mlx5_core_dev *dev, bool unload
218219
mlx5_core_err(dev, "reset reload flow aborted, PCI reads still not working\n");
219220
else
220221
mlx5_load_one(dev, true);
221-
devlink_remote_reload_actions_performed(priv_to_devlink(dev), 0,
222+
devl_lock(devlink);
223+
devlink_remote_reload_actions_performed(devlink, 0,
222224
BIT(DEVLINK_RELOAD_ACTION_DRIVER_REINIT) |
223225
BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE));
226+
devl_unlock(devlink);
224227
}
225228
}
226229

drivers/net/ethernet/mellanox/mlx5/core/irq_affinity.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ static struct mlx5_irq *
4848
irq_pool_request_irq(struct mlx5_irq_pool *pool, struct irq_affinity_desc *af_desc)
4949
{
5050
struct irq_affinity_desc auto_desc = {};
51+
struct mlx5_irq *irq;
5152
u32 irq_index;
5253
int err;
5354

@@ -64,9 +65,12 @@ irq_pool_request_irq(struct mlx5_irq_pool *pool, struct irq_affinity_desc *af_de
6465
else
6566
cpu_get(pool, cpumask_first(&af_desc->mask));
6667
}
67-
return mlx5_irq_alloc(pool, irq_index,
68-
cpumask_empty(&auto_desc.mask) ? af_desc : &auto_desc,
69-
NULL);
68+
irq = mlx5_irq_alloc(pool, irq_index,
69+
cpumask_empty(&auto_desc.mask) ? af_desc : &auto_desc,
70+
NULL);
71+
if (IS_ERR(irq))
72+
xa_erase(&pool->irqs, irq_index);
73+
return irq;
7074
}
7175

7276
/* Looking for the IRQ with the smallest refcount that fits req_mask.

drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1538,7 +1538,7 @@ u8 mlx5_lag_get_slave_port(struct mlx5_core_dev *dev,
15381538
goto unlock;
15391539

15401540
for (i = 0; i < ldev->ports; i++) {
1541-
if (ldev->pf[MLX5_LAG_P1].netdev == slave) {
1541+
if (ldev->pf[i].netdev == slave) {
15421542
port = i;
15431543
break;
15441544
}

drivers/net/ethernet/mellanox/mlx5/core/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,6 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev)
21422142
/* Panic tear down fw command will stop the PCI bus communication
21432143
* with the HCA, so the health poll is no longer needed.
21442144
*/
2145-
mlx5_drain_health_wq(dev);
21462145
mlx5_stop_health_poll(dev, false);
21472146

21482147
ret = mlx5_cmd_fast_teardown_hca(dev);
@@ -2177,6 +2176,7 @@ static void shutdown(struct pci_dev *pdev)
21772176

21782177
mlx5_core_info(dev, "Shutdown was called\n");
21792178
set_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state);
2179+
mlx5_drain_health_wq(dev);
21802180
err = mlx5_try_fast_unload(dev);
21812181
if (err)
21822182
mlx5_unload_one(dev, false);

drivers/net/ethernet/mellanox/mlx5/core/sf/dev/driver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ static void mlx5_sf_dev_shutdown(struct auxiliary_device *adev)
112112
struct mlx5_core_dev *mdev = sf_dev->mdev;
113113

114114
set_bit(MLX5_BREAK_FW_WAIT, &mdev->intf_state);
115+
mlx5_drain_health_wq(mdev);
115116
mlx5_unload_one(mdev, false);
116117
}
117118

drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
/* don't try to optimize STE allocation if the stack is too constaraining */
88
#define DR_RULE_MAX_STES_OPTIMIZED 0
99
#else
10-
#define DR_RULE_MAX_STES_OPTIMIZED 5
10+
#define DR_RULE_MAX_STES_OPTIMIZED 2
1111
#endif
1212
#define DR_RULE_MAX_STE_CHAIN_OPTIMIZED (DR_RULE_MAX_STES_OPTIMIZED + DR_ACTION_MAX_STES)
1313

0 commit comments

Comments
 (0)