reconfig_register, reconfig_register_ext, reconfig_unregister, or reconfig_complete, reconfig_register_list Kernel Service

Purpose

Register and unregister reconfiguration handlers.

Syntax

#include <sys/dr.h>

int reconfig_register (handler, actions,
 h_arg, h_token, name)
int (*handler)(void *event, void *h_arg, int req, 
void *resource_info);
int actions;
void *h_arg;
ulong *h_token;
char *name;

int reconfig_register_ext (handler, actions, h_arg, h_token, name)
int (*handler)(void *event, void *h_arg, unsigned long long req, 
void *resource_info);
unsigned long long actions;
void *h_arg;
ulong *h_token;
char *name;

int reconfig_unregister (h_token)
ulong h_token;

void reconfig_complete (event, rc)
void *event;
int rc;

int reconfig_register_list (handler, event_list,  list_size, h_arg, h_token, name)
int (*handler)(void *event, void *h_arg, dr_kevent_t event_in_prog, 
void *resource_info);
dr_kevent_t event_list[];
size_t list_size;
void *h_arg;
ulong *h_token;
char *name;

Description

The reconfig_register, reconfig_register_ext, reconfig_register_list and reconfig_unregister kernel services register and unregister reconfiguration handlers, which are invoked by the kernel both before and after DLPAR operations depending on the set of events specified by the kernel extension when registering.

Starting with AIX® 6.1 with 6100-02, all future kernel extensions use the reconfig_register_list kernel service when registering for DLPAR operations. The reconfig_register_list kernel service supports previous and new DLPAR operations. The reconfig_register or reconfig_register_ext kernel services will no longer support all future DLPAR operations.

The reconfig_complete kernel service is used to indicate that the request has completed. If a kernel extension expects that the operation is likely to take a long time (several seconds), the handler must return DR_WAIT to the caller, but proceed with the request asynchronously. In this case, the handler must indicate that it has completed the request by invoking the reconfig_complete kernel service.

Parameters

Item Description
actions Allows the kernel extension to specify which of the following events require notification:
  • DR_PMIG_CHECK
  • DR_PMIG_PRE
  • DR_PMIG_POST
  • DR_PMIG_POST_ERROR
  • DR_CAP_ADD_CHECK
  • DR_CAP_ADD_PRE
  • DR_CAP_ADD_POST
  • DR_CAP_ADD_POST_ERROR
  • DR_CAP_REMOVE_CHECK
  • DR_CAP_REMOVE_PRE
  • DR_CAP_REMOVE_POST
  • DR_CAP_REMOVE_POST_ERROR
  • DR_CPU_ADD_CHECK
  • DR_CPU_ADD_PRE
  • DR_CPU_ADD_POST
  • DR_CPU_ADD_POST_ERROR
  • DR_CPU_REMOVE_CHECK
  • DR_CPU_REMOVE_PRE
  • DR_CPU_REMOVE_POST
  • DR_CPU_REMOVE_POST_ERROR
  • DR_MEM_ADD_CHECK
  • DR_MEM_ADD_OP_POST
  • DR_MEM_ADD_PRE
  • DR_MEM_ADD_POST
  • DR_MEM_ADD_POST_ERROR
  • DR_MEM_REMOVE_CHECK
  • DR_MEM_REMOVE_OP_POST
  • DR_MEM_REMOVE_OP_PRE
  • DR_MEM_REMOVE_PRE
  • DR_MEM_REMOVE_POST
  • DR_MEM_REMOVE_POST_ERROR
event Passed to the handler and intended to be used only when calling the reconfig_complete kernel service.
event_list Specifies which events require notification. For the supported values, see the dr.h file.
handler Specifies the kernel extension function to be invoked.
h_arg Specified by the kernel extension, remembered by the kernel along with the function descriptor for the handler, and passed to the handler when it is invoked. It is not used directly by the kernel, but is intended to support kernel extensions that manage multiple adapter instances. This parameter points to an adapter control block.
h_token An output parameter that is used when unregistering the handler.
list_size Specifies the memory size of the event_list array.
name Provided for information purposes and may be included within an error log entry, if the driver returns an error. It is provided by the kernel extension and must be limited to 15 ASCII characters.
rc Can be set to DR_FAIL or DR_SUCCESS.
resource_info Identifies the resource specific information for the current DLPAR request. If the request is cpu based, the resource_info data is provided through a dri_cpu structure. Otherwise a dri_mem structure is used. On a Micro-Partitioning® partition, if the request is CPU-capacity based, the resource_info data is provided through a dri_cpu_capacity structure, which has the following format. The kernel extensions are not notified of changes in variable capacity weight in an uncapped Micro-Partitioning environment.
*/
struct dri_cpu_capacity {
	uint64_t	ent_capacity;	/* partition current entitled capacity*/
	int		delta_ent_cap;	/* delta capacity added/removed*/
	int		status;		/* capacity update constrained or not */
};

/*
 * dri_cpu_capacity.status flags.
 */
#define	CAP_UPDATE_SUCCESS	0x0
#define	CAP_UPDATE_CONSTRAINED	0x1
Note: The capacity update is constrained by the Hypervisor.
If the request is memory capacity based, the resource_info data is provided through a dri_mem_capacity structure, which has the following format:
struct dri_mem_capacity {
		size64_t	mem_capacity;	/* partition current entitled capacity*/
		ssize64_t	delta_mem_capacity;
		uint		flags;
		int		status;		/* capacity update constrained or not */
		uchar		reserved[7];
	};

		/*
 		 * dri_mem_capacity.status flags.
 		 */
		#define	CAP_UPDATE_SUCCESS	0x0
		#define	CAP_UPDATE_CONSTRAINED	0x1
req Indicates the following DLPAR operation to be performed by the handler:
  • DR_PMIG_CHECK
  • DR_PMIG_PRE
  • DR_PMIG_POST
  • DR_PMIG_POST_ERROR
  • DR_CAP_ADD_CHECK
  • DR_CAP_ADD_PRE
  • DR_CAP_ADD_POST
  • DR_CAP_ADD_POST_ERROR
  • DR_CAP_REMOVE_CHECK
  • DR_CAP_REMOVE_PRE
  • DR_CAP_REMOVE_POST
  • DR_CAP_REMOVE_POST_ERROR
  • DR_CPU_ADD_CHECK
  • DR_CPU_ADD_PRE
  • DR_CPU_ADD_POST
  • DR_CPU_ADD_POST_EEROR
  • DR_CPU_REMOVE_CHECK
  • DR_CPU_REMOVE_PRE
  • DR_CPU_REMOVE_POST
  • DR_CPU_REMOVE_POST_ERROR
  • DR_MEM_ADD_CHECK
  • DR_MEM_ADD_OP_POST
  • DR_MEM_ADD_PRE
  • DR_MEM_ADD_POST
  • DR_MEM_ADD_POST_ERROR
  • DR_MEM_REMOVE_CHECK
  • DR_MEM_REMOVE_OP_POST
  • DR_MEM_REMOVE_OP_PRE
  • DR_MEM_REMOVE_PRE
  • DR_MEM_REMOVE_POST
  • DR_MEM_REMOVE_POST_ERROR

List of dr_kevent_t events

The following events are used with the reconfig_register_list() call for the event_list array:

Return Values

Upon successful completion, the reconfig_register, reconfig_register_ext and reconfig_unregister kernel services return zero. If unsuccessful, the appropriate errno value is returned.

Execution Environment

The reconfig_register, reconfig_register_ext, reconfig_unregister, and handler interfaces are invoked in the process environment only.

The reconfig_complete kernel service may be invoked in the process or interrupt environment.