Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ocs_hal_workaround.c File Reference
#include "ocs_hal.h"

Go to the source code of this file.

Detailed Description

This file contains all HAL runtime workaround code. Based on the asic type, asic revision, and range of fw revisions, a particular workaround may be enabled.

A workaround may consist of overriding a particular HAL/SLI4 value that was initialized during ocs_hal_setup() (for example the MAX_QUEUE overrides for mis-reported queue sizes). Or if required, elements of the ocs_hal_workaround_t structure may be set to control specific runtime behavior.

It is intended that the controls in ocs_hal_workaround_t be defined functionally. So we would have the driver look like: "if (hal->workaround.enable_xxx) then ...", rather than what we might previously see as "if this is a BE3, then do xxx"

Definition in file ocs_hal_workaround.c.

Data Structures

struct  hal_workaround_t
 Internal workaround structure instance. More...
 

Macros

#define HAL_FWREV_ZERO   (0ull)
 
#define HAL_FWREV_MAX   (~0ull)
 
#define SLI4_ASIC_TYPE_ANY   0
 
#define SLI4_ASIC_REV_ANY   0
 

Enumerations

enum  hal_workaround_e {
  HAL_WORKAROUND_TEST = 1, HAL_WORKAROUND_MAX_QUEUE, HAL_WORKAROUND_MAX_RQ, HAL_WORKAROUND_RETAIN_TSEND_IO_LENGTH,
  HAL_WORKAROUND_WQE_COUNT_METHOD, HAL_WORKAROUND_RQE_COUNT_METHOD, HAL_WORKAROUND_USE_UNREGISTERD_RPI, HAL_WORKAROUND_DISABLE_AR_TGT_DIF,
  HAL_WORKAROUND_DISABLE_SET_DUMP_LOC, HAL_WORKAROUND_USE_DIF_QUARANTINE, HAL_WORKAROUND_USE_DIF_SEC_XRI, HAL_WORKAROUND_OVERRIDE_FCFI_IN_SRB,
  HAL_WORKAROUND_FW_VERSION_TOO_LOW, HAL_WORKAROUND_SGLC_MISREPORTED, HAL_WORKAROUND_IGNORE_SEND_FRAME_CAPABLE
}
 Internal definition of workarounds. More...
 

Functions

static int32_t ocs_hal_workaround_match (ocs_hal_t *hal, hal_workaround_t *w)
 Function prototypes. More...
 
static uint64_t parse_fw_version (const char *fwrev_string)
 Parse the firmware version (name) More...
 
void ocs_hal_workaround_setup (struct ocs_hal_s *hal)
 Setup HAL runtime workarounds. More...
 

Variables

static hal_workaround_t hal_workarounds []
 

Macro Details

#define HAL_FWREV_MAX   (~0ull)

Definition at line 52 of file ocs_hal_workaround.c.

#define HAL_FWREV_ZERO   (0ull)

Definition at line 51 of file ocs_hal_workaround.c.

#define SLI4_ASIC_REV_ANY   0

Definition at line 55 of file ocs_hal_workaround.c.

#define SLI4_ASIC_TYPE_ANY   0

Definition at line 54 of file ocs_hal_workaround.c.

Enumeration Details

Internal definition of workarounds.

Enumerator
HAL_WORKAROUND_TEST 
HAL_WORKAROUND_MAX_QUEUE 

Limits all queues

HAL_WORKAROUND_MAX_RQ 

Limits only the RQ

HAL_WORKAROUND_RETAIN_TSEND_IO_LENGTH 
HAL_WORKAROUND_WQE_COUNT_METHOD 
HAL_WORKAROUND_RQE_COUNT_METHOD 
HAL_WORKAROUND_USE_UNREGISTERD_RPI 
HAL_WORKAROUND_DISABLE_AR_TGT_DIF 

Disable of auto-response target DIF

HAL_WORKAROUND_DISABLE_SET_DUMP_LOC 
HAL_WORKAROUND_USE_DIF_QUARANTINE 
HAL_WORKAROUND_USE_DIF_SEC_XRI 

Use secondary xri for multiple data phases

HAL_WORKAROUND_OVERRIDE_FCFI_IN_SRB 

FCFI reported in SRB not correct, use "first" registered domain

HAL_WORKAROUND_FW_VERSION_TOO_LOW 

The FW version is not the min version supported by this driver

HAL_WORKAROUND_SGLC_MISREPORTED 

Chip supports SGL Chaining but SGLC is not set in SLI4_PARAMS

HAL_WORKAROUND_IGNORE_SEND_FRAME_CAPABLE 

Don't use SEND_FRAME capable if FW version is too old

Definition at line 61 of file ocs_hal_workaround.c.

Function Details

static int32_t ocs_hal_workaround_match ( ocs_hal_t *  hal,
hal_workaround_t *  w 
)
static

Function prototypes.

Test for a workaround match.

Looks at the asic type, asic revision, and fw revision, and returns TRUE if match.

Parameters
halPointer to the HAL structure
wPointer to a workaround structure entry
Returns
Return TRUE for a match

Definition at line 217 of file ocs_hal_workaround.c.

void ocs_hal_workaround_setup ( struct ocs_hal_s *  hal)

Setup HAL runtime workarounds.

The function is called at the end of ocs_hal_setup() to setup any runtime workarounds based on the HAL/SLI setup.

Parameters
halPointer to HAL structure
Returns
none

Definition at line 237 of file ocs_hal_workaround.c.

static uint64_t parse_fw_version ( const char *  fwrev_string)
static

Parse the firmware version (name)

Parse a string of the form a.b.c.d, returning a uint64_t packed as defined by the HAL_FWREV() macro

Parameters
fwrev_stringpointer to the firmware string
Returns
packed firmware revision value

Definition at line 181 of file ocs_hal_workaround.c.

Variable Details

hal_workaround_t hal_workarounds[]
static

Definition at line 93 of file ocs_hal_workaround.c.