]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net/mlx5: Add mlx5_vport_set_other_func_general_cap macro
authorMoshe Shemesh <moshe@nvidia.com>
Mon, 18 May 2026 07:13:53 +0000 (10:13 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 21 May 2026 10:12:00 +0000 (12:12 +0200)
Add mlx5_vport_set_other_func_general_cap() convenience macro, symmetric
to the existing mlx5_vport_get_other_func_general_cap(), and use it in
mlx5_devlink_port_fn_roce_set().

No functional change in this patch.

Signed-off-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20260518071356.345723-6-tariqt@nvidia.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h

index acbc37b0530856af62112102e5be56c0e02f132a..b06b10d443bdaaf63783b55c0821ad3e42b0a309 100644 (file)
@@ -4951,8 +4951,8 @@ int mlx5_devlink_port_fn_roce_set(struct devlink_port *port, bool enable,
        hca_caps = MLX5_ADDR_OF(query_hca_cap_out, query_ctx, capability);
        MLX5_SET(cmd_hca_cap, hca_caps, roce, enable);
 
-       err = mlx5_vport_set_other_func_cap(esw->dev, hca_caps, vport_num,
-                                           MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE);
+       err = mlx5_vport_set_other_func_general_cap(esw->dev, hca_caps,
+                                                   vport_num);
        if (err) {
                NL_SET_ERR_MSG_MOD(extack, "Failed setting HCA roce cap");
                goto out_free;
index d70907f499a915a8f85ec2f3c0e42397e87a47b3..2eba141bd5213031e0630fba9131d1fee8b1ca15 100644 (file)
@@ -457,6 +457,10 @@ int mlx5_vport_set_other_func_cap(struct mlx5_core_dev *dev, const void *hca_cap
 #define mlx5_vport_get_other_func_general_cap(dev, vport, out)         \
        mlx5_vport_get_other_func_cap(dev, vport, out, MLX5_CAP_GENERAL)
 
+#define mlx5_vport_set_other_func_general_cap(dev, hca_cap, vport)     \
+       mlx5_vport_set_other_func_cap(dev, hca_cap, vport,              \
+                                     MLX5_SET_HCA_CAP_OP_MOD_GENERAL_DEVICE)
+
 static inline u32 mlx5_sriov_get_vf_total_msix(struct pci_dev *pdev)
 {
        struct mlx5_core_dev *dev = pci_get_drvdata(pdev);