lpar_get_info Subroutine

Purpose

Retrieves the characteristics of the calling partition.

Syntax

#include <sys/dr.h>

int lpar_get_info (command, lparinfo, bufsize)
int command; 
void *lparinfo;
size_t bufsize;

Description

The lpar_get_info subroutine retrieves processor module information, and both LPAR and Micro-Partitioning® attributes of low-frequency use and high-frequency use. Because the low-frequency attributes, as defined in the lpar_info_format1_t structure, are static in nature, a reboot is required to effect any change. The high-frequency attributes, as defined in the lpar_info_format2_t structure, can be changed dynamically at any time either by the platform or through dynamic logical partitioning (DLPAR) procedures. The latter provides a mechanism for notifying applications of changes. The signature of this system call, its parameter types, and the order of the member fields in both the lpar_info_format1_t and lpar_info_format2_t structures are specific to the AIX® platform. If the WPAR_INFO_FORMAT command is specified, the WPAR attributes are returned in a wpar_info_format_t structure. To request processor module information, specify the PROC_MODULE_INFO command. The information is provided as an array of proc_module_info_t structures. To obtain this information, you must provide a buffer of exact length to accommodate one proc_module_info_t structure for each module type. The module count can be obtained by using the NUM_PROC_MODULE_TYPES command, and it is in the form of a uint64_t type. Processor module information is reported for the entire system. This information is available on POWER6® and later systems.

To see the complete structures of lpar_info_format1_t, lpar_info_format2_t, wpar_info_format_t, and proc_module_info_t, see the dr.h header file.

The lpar_get_info system call provides information about the operating system environment, including the following:
  • Type of partition: dedicated processor partition or micro-partition
  • Type of micro-partition: capped or uncapped
  • Variable capacity weight of micro-partition
  • Partition name and number
  • SMT-capable partition
  • SMT-enabled partition
  • Minimum, desired, online, and maximum number of virtual processors
  • Minimum, online, and maximum number of logical processors
  • Minimum, desired, online, and maximum entitled processor capacity
  • Minimum, desired, online (megabytes), and maximum number of logical memory blocks (LMBs)
  • Maximum number of potential installed physical processors in the server, including unlicensed and potentially hot-pluggable
  • Number of active licensed installed physical processors in the server
  • Number of processors in the shared processor pool
  • Workload partition static identifier
  • Workload partition dynamic identifier
  • Workload partition processor limits
  • Socket, chip, and core topology of the system that the processor module information provides
  • Logical pages coalesced in active memory sharing enabled partitions.
  • Physical pages coalesced in memory pools in active memory sharing enabled partitions.
  • PURR and SPURR consumed for page coalescing in active memory sharing enabled partitions.

This subroutine is used by the DRM to determine whether a client partition is migration capable and MSP capable. The kernel presents these capabilities based on the presence of the hcall-vasi function set and the type of partition that is evident. If the partition is a VIOS partition, the MSP capability will be noted. Otherwise, the OS partition migration capability will be noted.

Parameters

Item Description
command Specifies whether the user wants format1, format2, workload partition, or processor module details.
lparinfo Pointer to the user-allocated buffer that is passed in.
bufsize Size of the buffer that is passed in.

Return Values

Upon success, the lpar_get_info subroutine returns a value of 0. Upon failure, a value of -1 is returned, and errno is set to indicate the appropriate error.

Error Codes

Item Description
EFAULT Buffer size is smaller than expected.
EINVAL Invalid input parameter.
ENOSYS The hardware or the current firmware level does not support this operation.
ENOTSUP The platform does not support this operation.

Example

The following example demonstrates how to retrieve processor module information using the lpar_get_info subroutine:
uint64_t             module_count;
proc_module_info_t   *buffer = NULL;
int                  rc = 0;
		 
/* Retrieve the total count of modules on the system */
rc = lpar_get_info(NUM_PROC_MODULE_TYPES, 
                   &module_count, sizeof(uint64_t));
		 
if (rc)
    return(1);  /* Error */
             
/* Allocate buffer of exact size to accomodate module information */
buffer = malloc(module_count * sizeof(proc_module_info_t));
     
if (buffer == NULL)
    return(2);

rc = lpar_get_info(PROC_MODULE_INFO, buffer, sizeof(buffer));

if (rc)
    return(3);  /* Error */

/*  If rc is 0, then buffer contains an array of proc_module_info_t
 *  structures with module_count elements.  For an element of 
 *  index i:
 *       
 *      buffer[i].nsockets is the total number of sockets
 *      buffer[i].nchips   is the number of chips per socket		 
 *      buffer[i].ncores   is the number of cores per chip
 */