Commit 5dc9ffaf authored by Oded Gabbay's avatar Oded Gabbay
Browse files

habanalabs: expose server type in INFO IOCTL



Add the server type property to the hl_info_hw_ip_info structure
that is exposed to the user via the INFO IOCTL.

This is needed by the userspace s/w stack to know the connections map
of the internal links that connect the ASIC among themselves inside the
server.

The F/W will tell us, as part of the NIC information, the server type
that the GAUDI is located in.

Signed-off-by: default avatarOded Gabbay <ogabbay@kernel.org>
parent e62ada5e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

/*
 * Copyright 2016-2019 HabanaLabs, Ltd.
 * Copyright 2016-2021 HabanaLabs, Ltd.
 * All Rights Reserved.
 */

+3 −0
Original line number Diff line number Diff line
@@ -489,6 +489,8 @@ struct hl_hints_range {
 *                                       reserved for the user
 * @first_available_cq: first available CQ for the user.
 * @user_interrupt_count: number of user interrupts.
 * @server_type: Server type that the ASIC is currently installed in.
 *               The value is according to enum hl_server_type in uapi file.
 * @tpc_enabled_mask: which TPCs are enabled.
 * @completion_queues_count: number of completion queues.
 * @fw_security_enabled: true if security measures are enabled in firmware,
@@ -570,6 +572,7 @@ struct asic_fixed_properties {
	u16				first_available_user_msix_interrupt;
	u16				first_available_cq[HL_MAX_DCORES];
	u16				user_interrupt_count;
	u16				server_type;
	u8				tpc_enabled_mask;
	u8				completion_queues_count;
	u8				fw_security_enabled;
+2 −0
Original line number Diff line number Diff line
@@ -94,6 +94,8 @@ static int hw_ip_info(struct hl_device *hdev, struct hl_info_args *args)

	hw_ip.first_available_interrupt_id =
			prop->first_available_user_msix_interrupt;
	hw_ip.server_type = prop->server_type;

	return copy_to_user(out, &hw_ip,
		min((size_t) size, sizeof(hw_ip))) ? -EFAULT : 0;
}
+2 −0
Original line number Diff line number Diff line
@@ -642,6 +642,8 @@ static int gaudi_set_fixed_properties(struct hl_device *hdev)
	prop->hard_reset_done_by_fw = false;
	prop->gic_interrupts_enable = true;

	prop->server_type = HL_SERVER_TYPE_UNKNOWN;

	return 0;
}

+2 −0
Original line number Diff line number Diff line
@@ -469,6 +469,8 @@ int goya_set_fixed_properties(struct hl_device *hdev)
	prop->hard_reset_done_by_fw = false;
	prop->gic_interrupts_enable = true;

	prop->server_type = HL_SERVER_TYPE_UNKNOWN;

	return 0;
}

Loading