Signed-off-by: Aviad Yehezkel <aviadye@xxxxxxxxxxxx> Signed-off-by: Ilya Lesokhin <ilyal@xxxxxxxxxxxx> --- drivers/net/ethernet/mellanox/accelerator/tls/tls.c | 6 ++++++ drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.c | 2 ++ drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.h | 2 ++ 3 files changed, 10 insertions(+) diff --git a/drivers/net/ethernet/mellanox/accelerator/tls/tls.c b/drivers/net/ethernet/mellanox/accelerator/tls/tls.c index 07a4b67..3560f784 100644 --- a/drivers/net/ethernet/mellanox/accelerator/tls/tls.c +++ b/drivers/net/ethernet/mellanox/accelerator/tls/tls.c @@ -494,9 +494,11 @@ static struct sk_buff *mlx_tls_rx_handler(struct sk_buff *skb, u8 *rawpet, static void mlx_tls_free(struct mlx_tls_dev *dev) { list_del(&dev->accel_dev_list); +#if IS_ENABLED(CONFIG_MLX5_CORE_FPGA_QP_SIM) #ifdef MLX_TLS_SADB_RDMA kobject_put(&dev->kobj); #endif +#endif dev_put(dev->netdev); kfree(dev); } @@ -592,6 +594,7 @@ int mlx_tls_add_one(struct mlx_accel_core_device *accel_device) goto err_netdev; } +#if IS_ENABLED(CONFIG_MLX5_CORE_FPGA_QP_SIM) #ifdef MLX_TLS_SADB_RDMA ret = tls_sysfs_init_and_add(&dev->kobj, mlx_accel_core_kobj(dev->accel_device), @@ -603,6 +606,7 @@ int mlx_tls_add_one(struct mlx_accel_core_device *accel_device) goto err_ops_register; } #endif +#endif mutex_lock(&mlx_tls_mutex); list_add(&dev->accel_dev_list, &mlx_tls_devs); @@ -611,10 +615,12 @@ int mlx_tls_add_one(struct mlx_accel_core_device *accel_device) dev->netdev->tlsdev_ops = &mlx_tls_ops; goto out; +#if IS_ENABLED(CONFIG_MLX5_CORE_FPGA_QP_SIM) #ifdef MLX_TLS_SADB_RDMA err_ops_register: mlx_accel_core_client_ops_unregister(accel_device); #endif +#endif err_netdev: dev_put(netdev); err_conn: diff --git a/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.c b/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.c index 2860fc3..76ba784 100644 --- a/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.c +++ b/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.c @@ -36,6 +36,7 @@ #include "tls_sysfs.h" #include "tls_cmds.h" +#if IS_ENABLED(CONFIG_MLX5_CORE_FPGA_QP_SIM) #ifdef MLX_TLS_SADB_RDMA struct mlx_tls_attribute { struct attribute attr; @@ -192,3 +193,4 @@ int tls_sysfs_init_and_add(struct kobject *kobj, struct kobject *parent, fmt, arg); } #endif +#endif diff --git a/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.h b/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.h index bfaa857..d7c3185 100644 --- a/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.h +++ b/drivers/net/ethernet/mellanox/accelerator/tls/tls_sysfs.h @@ -37,9 +37,11 @@ #include "tls.h" +#if IS_ENABLED(CONFIG_MLX5_CORE_FPGA_QP_SIM) #ifdef MLX_TLS_SADB_RDMA int tls_sysfs_init_and_add(struct kobject *kobj, struct kobject *parent, const char *fmt, char *arg); #endif +#endif #endif /* __TLS_SYSFS_H__ */ -- 2.7.4