2015-10-23 19:21:55 +00:00
|
|
|
/* **********************************************************
|
2015-10-23 22:39:55 +00:00
|
|
|
* Copyright 2008 - 2014 VMware, Inc. All rights reserved.
|
2015-10-23 19:21:55 +00:00
|
|
|
* **********************************************************/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* @VMKAPIMOD_LICENSE@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* Stress */ /**
|
|
|
|
* \defgroup Stress Stress Options
|
|
|
|
*
|
|
|
|
* The stress option interfaces allow access to special environment
|
|
|
|
* variables that inform code whether or not certain stress code
|
|
|
|
* should be run.
|
|
|
|
*
|
|
|
|
* @{
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _VMKAPI_STRESS_H_
|
|
|
|
#define _VMKAPI_STRESS_H_
|
|
|
|
|
|
|
|
/** \cond never */
|
|
|
|
#ifndef VMK_HEADER_INCLUDED_FROM_VMKAPI_H
|
|
|
|
#error This vmkapi file should never be included directly but only via vmkapi.h
|
|
|
|
#endif
|
|
|
|
/** \endcond never */
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Useful stress option names
|
|
|
|
*/
|
|
|
|
/** \cond nodoc */
|
|
|
|
#define VMK_STRESS_OPT_NET_GEN_TINY_ARP_RARP "NetGenTinyArpRarp"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_CORRUPT_ETHERNET_HDR "NetIfCorruptEthHdr"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_CORRUPT_RX_DATA "NetIfCorruptRxData"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_CORRUPT_RX_TCP_UDP "NetIfCorruptRxTcpUdp"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_CORRUPT_TX "NetIfCorruptTx"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_FAIL_HARD_TX "NetIfFailHardTx"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_FAIL_RX "NetIfFailRx"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_FAIL_TX_AND_STOP_QUEUE "NetIfFailTxAndStopQueue"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_FORCE_HIGH_DMA_OVERFLOW "NetIfForceHighDMAOverflow"
|
|
|
|
#define VMK_STRESS_OPT_NET_IF_FORCE_RX_SW_CSUM "NetIfForceRxSWCsum"
|
|
|
|
#define VMK_STRESS_OPT_NET_NAPI_FORCE_BACKUP_WORLDLET "NetNapiForceBackupWorldlet"
|
|
|
|
#define VMK_STRESS_OPT_NET_BLOCK_DEV_IS_SLUGGISH "NetBlockDevIsSluggish"
|
|
|
|
|
|
|
|
#define VMK_STRESS_OPT_SCSI_ADAPTER_ISSUE_FAIL "ScsiAdapterIssueFail"
|
|
|
|
|
|
|
|
#define VMK_STRESS_OPT_VMKLINUX_DROP_CMD_SCSI_DONE "VmkLinuxDropCmdScsiDone"
|
|
|
|
#define VMK_STRESS_OPT_VMKLINUX_ABORT_CMD_FAILURE "VmkLinuxAbortCmdFailure"
|
|
|
|
|
|
|
|
#define VMK_STRESS_OPT_USB_BULK_DELAY_PROCESS_URB "USBBulkDelayProcessURB"
|
|
|
|
#define VMK_STRESS_OPT_USB_BULK_URB_FAKE_TRANSIENT_ERROR "USBBulkURBFakeTransientError"
|
|
|
|
#define VMK_STRESS_OPT_USB_DELAY_PROCESS_TD "USBDelayProcessTD"
|
|
|
|
#define VMK_STRESS_OPT_USB_FAIL_GP_HEAP_ALLOC "USBFailGPHeapAlloc"
|
|
|
|
#define VMK_STRESS_OPT_USB_STORAGE_DELAY_SCSI_DATA_PHASE "USBStorageDelaySCSIDataPhase"
|
|
|
|
#define VMK_STRESS_OPT_USB_STORAGE_DELAY_SCSI_TRANSFER "USBStorageDelaySCSITransfer"
|
|
|
|
/** \endcond nodoc */
|
|
|
|
|
|
|
|
/**
|
|
|
|
* \brief Opaque stress option handle.
|
|
|
|
*/
|
|
|
|
typedef vmk_uint64 vmk_StressOptionHandle;
|
|
|
|
|
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* vmk_StressOptionOpen -- */ /**
|
|
|
|
*
|
|
|
|
* \ingroup Stress
|
2015-10-23 22:39:55 +00:00
|
|
|
* \brief Open a handle to stress option.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
2015-10-23 19:48:45 +00:00
|
|
|
* \note This function will not block.
|
|
|
|
*
|
2015-10-23 22:39:55 +00:00
|
|
|
* \param[in] name A stress option name.
|
|
|
|
* \param[out] handle Handle to the stress option.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
2015-10-23 22:39:55 +00:00
|
|
|
* \retval VMK_OK Successful.
|
|
|
|
* \retval VMK_BAD_PARAM The stress option id was invalid.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
VMK_ReturnStatus vmk_StressOptionOpen(
|
2015-10-23 19:48:45 +00:00
|
|
|
const char *name,
|
2015-10-23 19:21:55 +00:00
|
|
|
vmk_StressOptionHandle *handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* vmk_StressOptionClose -- */ /**
|
|
|
|
*
|
|
|
|
* \ingroup Stress
|
2015-10-23 22:39:55 +00:00
|
|
|
* \brief Close a handle to stress option.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
2015-10-23 19:48:45 +00:00
|
|
|
* \note This function will not block.
|
|
|
|
*
|
2015-10-23 19:21:55 +00:00
|
|
|
* \param[in] handle Handle to the stress option
|
|
|
|
*
|
2015-10-23 22:39:55 +00:00
|
|
|
* \retval VMK_OK Successful.
|
|
|
|
* \retval VMK_BAD_PARAM The stress option handle was invalid.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
VMK_ReturnStatus vmk_StressOptionClose(
|
|
|
|
vmk_StressOptionHandle handle);
|
|
|
|
|
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* vmk_StressOptionValue -- */ /**
|
|
|
|
*
|
|
|
|
* \ingroup Stress
|
2015-10-23 22:39:55 +00:00
|
|
|
* \brief Get stress option value.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
2015-10-23 19:48:45 +00:00
|
|
|
* \note This function will not block.
|
|
|
|
*
|
2015-10-23 22:39:55 +00:00
|
|
|
* \param[in] handle Handle to the stress option.
|
|
|
|
* \param[out] result Stress option value.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
2015-10-23 22:39:55 +00:00
|
|
|
* \retval VMK_OK Successful.
|
|
|
|
* \retval VMK_BAD_PARAM The stress option handle was invalid.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
VMK_ReturnStatus vmk_StressOptionValue(
|
2015-10-23 19:48:45 +00:00
|
|
|
vmk_StressOptionHandle handle,
|
2015-10-23 19:21:55 +00:00
|
|
|
vmk_uint32 *result);
|
|
|
|
|
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* vmk_StressOptionCounter -- */ /**
|
|
|
|
*
|
|
|
|
* \ingroup Stress
|
2015-10-23 22:39:55 +00:00
|
|
|
* \brief Generate a "hit" once in a while.
|
|
|
|
*
|
|
|
|
* Returns VMK_TRUE with probability 1 / N, where N is the current
|
|
|
|
* value of the stress option. If the stress option is disabled (N = 0),
|
|
|
|
* always returns VMK_FALSE.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
2015-10-23 19:48:45 +00:00
|
|
|
* \note This function will not block.
|
|
|
|
*
|
2015-10-23 22:39:55 +00:00
|
|
|
* \param[in] handle Handle to the stress option.
|
|
|
|
* \param[out] result VMK_TRUE if a "hit" was generated,
|
|
|
|
* VMK_FALSE otherwise.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
2015-10-23 22:39:55 +00:00
|
|
|
* \retval VMK_OK Successful.
|
|
|
|
* \retval VMK_BAD_PARAM The stress option handle was invalid.
|
2015-10-23 19:21:55 +00:00
|
|
|
*
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
VMK_ReturnStatus vmk_StressOptionCounter(
|
2015-10-23 19:48:45 +00:00
|
|
|
vmk_StressOptionHandle handle,
|
2015-10-23 19:21:55 +00:00
|
|
|
vmk_Bool *result);
|
|
|
|
|
2015-10-23 22:39:55 +00:00
|
|
|
/*
|
|
|
|
***********************************************************************
|
|
|
|
* vmk_StressOptionRandValue -- */ /**
|
|
|
|
*
|
|
|
|
* \ingroup Stress
|
|
|
|
* \brief Generate a random integer bound by the stress option.
|
|
|
|
*
|
|
|
|
* Returns a random positive integer less than the current value of the
|
|
|
|
* stress option (or 0 if the current value is 0).
|
|
|
|
*
|
|
|
|
* \note This function will not block.
|
|
|
|
*
|
|
|
|
* \param[in] handle Handle to the stress option.
|
|
|
|
* \param[out] result The random value.
|
|
|
|
*
|
|
|
|
* \retval VMK_OK Successful.
|
|
|
|
* \retval VMK_BAD_PARAM The stress option handle was invalid.
|
|
|
|
*
|
|
|
|
***********************************************************************
|
|
|
|
*/
|
|
|
|
VMK_ReturnStatus vmk_StressOptionRandValue(
|
|
|
|
vmk_StressOptionHandle handle,
|
|
|
|
vmk_uint32 *result);
|
|
|
|
|
2015-10-23 19:21:55 +00:00
|
|
|
#endif /* _VMKAPI_STRESS_H_ */
|
|
|
|
/** @} */
|