PDK API Guide for J721E
Enet Resource Management

Introduction

Data Structures

struct  EnetRm_ResourceInfo
 Enet RM resource information. More...
 
struct  EnetRm_ResPrms
 Enet RM resource parameters. More...
 
struct  EnetRm_IoctlPermissionEntry
 Enet RM IOCTL permission entry. More...
 
struct  EnetRm_IoctlPermissionTable
 Enet RM IOCTL permission table. More...
 
struct  EnetRm_MacAddressPool
 Enet RM MAC address pool. More...
 
struct  EnetRm_AllocRxFlowInArgs
 Input args for ENET_RM_IOCTL_ALLOC_RX_FLOW command. More...
 
struct  EnetRm_AllocRxFlow
 Output args for ENET_RM_IOCTL_ALLOC_RX_FLOW command. More...
 
struct  EnetRm_AllocMacAddrOutArgs
 Input args for ENET_RM_IOCTL_ALLOC_MAC_ADDR command. More...
 
struct  EnetRm_FreeTxChInArgs
 Input args for ENET_RM_IOCTL_FREE_TX_CH_PEERID command. More...
 
struct  EnetRm_FreeRxFlowInArgs
 Input args for ENET_RM_IOCTL_FREE_RX_FLOW command. More...
 
struct  EnetRm_FreeMacAddrInArgs
 Input args for ENET_RM_IOCTL_FREE_MAC_ADDR command. More...
 
struct  EnetRm_ResCfg
 Resource manager configuration parameters. More...
 
struct  EnetRm_ValidatePermissionInArgs
 Input args for ENET_RM_IOCTL_VALIDATE_PERMISSION command. More...
 
struct  EnetRm_AllocInternalRxFlowInArgs
 Input args for ENET_RM_IOCTL_INTERNAL_ALLOC_RX_FLOW command. More...
 
struct  EnetRm_FreeInternalRxFlowInArgs
 Input args for ENET_RM_IOCTL_FREE_RX_FLOW command. More...
 
struct  EnetRm_Cfg
 Enet RM configuration parameters. More...
 
struct  EnetRm_ResEntry_t
 Resource manager entry. More...
 
struct  EnetRm_CoreResInfo_t
 Resources of a given core. More...
 
struct  EnetRm_CoreResTbl_t
 Resource table of all cores. More...
 
struct  EnetRm_TxChObj
 TX resources. More...
 
struct  EnetRm_RxFlowIdxObj
 RX resources. More...
 
struct  EnetRm_MacAddressObj
 MAC address resources. More...
 
struct  EnetRm_CoreAttachInfo
 Information about attached cores. More...
 
struct  EnetRm_Obj
 Enet Resource Manager driver object. More...
 

Functions

int32_t EnetRm_open (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId, const void *cfg, uint32_t cfgSize)
 Open and initialize Enet RM module. More...
 
int32_t EnetRm_rejoin (EnetMod_Handle hMod, Enet_Type enetType, uint32_t instId)
 Rejoin Enet RM module for a running peripheral. More...
 
int32_t EnetRm_ioctl (EnetMod_Handle hMod, uint32_t cmd, Enet_IoctlPrms *prms)
 Run an IOCTL operation on Enet RM. More...
 
void EnetRm_close (EnetMod_Handle hMod)
 Close Enet RM module. More...
 

Typedefs

typedef EnetRm_FreeRxFlowInArgs EnetRm_ValidateRxFlowInArgs
 Input args for ENET_RM_IOCTL_VALIDATE_RX_FLOW command. More...
 
typedef EnetRm_ObjEnetRm_Handle
 Enet RM module handle. More...
 

Enumerations

enum  EnetRm_Ioctls {
  ENET_RM_IOCTL_ALLOC_MAC_ADDR = ENET_RM_PUBLIC_IOCTL(0U), ENET_RM_IOCTL_FREE_MAC_ADDR = ENET_RM_PUBLIC_IOCTL(1U), ENET_RM_IOCTL_ALLOC_RX_FLOW = ENET_RM_PUBLIC_IOCTL(2U), ENET_RM_IOCTL_FREE_RX_FLOW = ENET_RM_PUBLIC_IOCTL(3U),
  ENET_RM_IOCTL_ALLOC_TX_CH_PEERID = ENET_RM_PUBLIC_IOCTL(4U), ENET_RM_IOCTL_FREE_TX_CH_PEERID = ENET_RM_PUBLIC_IOCTL(5U)
}
 Enet RM IOCTL commands. More...
 
enum  EnetRm_PrivIoctls {
  ENET_RM_IOCTL_VALIDATE_PERMISSION = ENET_RM_PRIVATE_IOCTL(0U), ENET_RM_IOCTL_ATTACH = ENET_RM_PRIVATE_IOCTL(1U), ENET_RM_IOCTL_DETACH = ENET_RM_PRIVATE_IOCTL(2U), ENET_RM_IOCTL_INTERNAL_ALLOC_RX_FLOW = ENET_RM_PRIVATE_IOCTL(3U),
  ENET_RM_IOCTL_INTERNAL_FREE_RX_FLOW = ENET_RM_PRIVATE_IOCTL(4U), ENET_RM_IOCTL_VALIDATE_RX_FLOW = ENET_RM_PRIVATE_IOCTL(5U)
}
 Enet RM private IOCTL commands. More...
 

Macros

#define ENET_RM_PUBLIC_IOCTL(x)
 Helper macro to create IOCTL commands for Enet RM module. More...
 
#define ENET_RM_NUM_IOCTL_PERM_ENTRY_MAX   (16U)
 Maximum number of entries for IOCTL permission. More...
 
#define ENET_RM_NUM_MACADDR_MAX   (10U)
 Maximum number of macaddress to be managed by RM. More...
 
#define ENET_RM_NUM_RXCHAN_MAX   (2U)
 Maximum number of RX channels (i.e. sets of flows). More...
 
#define ENET_RM_PRIVATE_IOCTL(x)
 Helper macro to create private IOCTL commands for Enet RM module. More...
 

Resource Manager Error Codes

Error codes returned by RM functions.

#define ENET_RM_TXCHNUM_INVALID   (0xABCDABCDU)
 Enet RM invalid TX channel number. More...
 
#define ENET_RM_RXFLOWIDX_INVALID   (0xABCDABCDU)
 Enet RM invalid RX flow id. More...
 
#define ENET_RM_INVALIDCORE   (0x5562AEFEU)
 Enet RM invalid core. More...
 

Macro Definition Documentation

◆ ENET_RM_PUBLIC_IOCTL

#define ENET_RM_PUBLIC_IOCTL (   x)
Value:
ENET_IOCTL_RM_BASE | \
ENET_IOCTL_PER_GENERIC | \
ENET_IOCTL_MIN(x))
Definition: enet_ioctl.h:167

Helper macro to create IOCTL commands for Enet RM module.

◆ ENET_RM_TXCHNUM_INVALID

#define ENET_RM_TXCHNUM_INVALID   (0xABCDABCDU)

Enet RM invalid TX channel number.

◆ ENET_RM_RXFLOWIDX_INVALID

#define ENET_RM_RXFLOWIDX_INVALID   (0xABCDABCDU)

Enet RM invalid RX flow id.

◆ ENET_RM_INVALIDCORE

#define ENET_RM_INVALIDCORE   (0x5562AEFEU)

Enet RM invalid core.

◆ ENET_RM_NUM_IOCTL_PERM_ENTRY_MAX

#define ENET_RM_NUM_IOCTL_PERM_ENTRY_MAX   (16U)

Maximum number of entries for IOCTL permission.

◆ ENET_RM_NUM_MACADDR_MAX

#define ENET_RM_NUM_MACADDR_MAX   (10U)

Maximum number of macaddress to be managed by RM.

◆ ENET_RM_NUM_RXCHAN_MAX

#define ENET_RM_NUM_RXCHAN_MAX   (2U)

Maximum number of RX channels (i.e. sets of flows).

This is needed only for ICSSG Switch where there are two RX channels (with 8 flows each) for the host port. For all other peripherals, there is a single RX channel and multiple flows.

◆ ENET_RM_PRIVATE_IOCTL

#define ENET_RM_PRIVATE_IOCTL (   x)
Value:
ENET_IOCTL_RM_BASE | \
ENET_IOCTL_PER_GENERIC | \
ENET_IOCTL_MIN(x))
Definition: enet_ioctl.h:170

Helper macro to create private IOCTL commands for Enet RM module.

Typedef Documentation

◆ EnetRm_ValidateRxFlowInArgs

Input args for ENET_RM_IOCTL_VALIDATE_RX_FLOW command.

◆ EnetRm_Handle

Enet RM module handle.

Enumeration Type Documentation

◆ EnetRm_Ioctls

Enet RM IOCTL commands.

Enumerator
ENET_RM_IOCTL_ALLOC_MAC_ADDR 

Alloc MAC address.

IOCTL parameters:

ENET_RM_IOCTL_FREE_MAC_ADDR 

Free MAC address.

IOCTL parameters:

ENET_RM_IOCTL_ALLOC_RX_FLOW 

Alloc RX flow.

IOCTL parameters:

ENET_RM_IOCTL_FREE_RX_FLOW 

Free RX flow.

IOCTL parameters:

ENET_RM_IOCTL_ALLOC_TX_CH_PEERID 

Alloc TX channel peer id.

IOCTL parameters:

  • inArgs: uint32_t coreKey
  • outArgs: uint32_t txPSILThreadId
ENET_RM_IOCTL_FREE_TX_CH_PEERID 

Free TX channel peer id.

IOCTL parameters:

◆ EnetRm_PrivIoctls

Enet RM private IOCTL commands.

Enumerator
ENET_RM_IOCTL_VALIDATE_PERMISSION 

Validate IOCTL permission.

IOCTL parameters:

ENET_RM_IOCTL_ATTACH 

Attach core.

IOCTL parameters:

  • inArgs: uint32_t coreId
  • outArgs: uint32_t coreKey
ENET_RM_IOCTL_DETACH 

Detach core.

IOCTL parameters:

  • inArgs: uint32_t coreKey
  • outArgs: None
ENET_RM_IOCTL_INTERNAL_ALLOC_RX_FLOW 

Internal RX flow allocation.

IOCTL parameters:

ENET_RM_IOCTL_INTERNAL_FREE_RX_FLOW 

Internal RX flow free.

IOCTL parameters:

ENET_RM_IOCTL_VALIDATE_RX_FLOW 

Validate RX flow is allocated resource and is from a attached core.

IOCTL parameters:

  • inArgs: EnetRm_ValidateRxFlowInArgs
  • outArgs: None

Function Documentation

◆ EnetRm_open()

int32_t EnetRm_open ( EnetMod_Handle  hMod,
Enet_Type  enetType,
uint32_t  instId,
const void *  cfg,
uint32_t  cfgSize 
)

Open and initialize Enet RM module.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
cfgConfiguration parameters
cfgSizeSize of the configuration parameters
Returns
Enet_ErrorCodes

◆ EnetRm_rejoin()

int32_t EnetRm_rejoin ( EnetMod_Handle  hMod,
Enet_Type  enetType,
uint32_t  instId 
)

Rejoin Enet RM module for a running peripheral.

Parameters
hModEnet Module handle
enetTypeEnet Peripheral type
instIdEnet Peripheral instance id
Returns
Enet_ErrorCodes

◆ EnetRm_ioctl()

int32_t EnetRm_ioctl ( EnetMod_Handle  hMod,
uint32_t  cmd,
Enet_IoctlPrms prms 
)

Run an IOCTL operation on Enet RM.

Parameters
hModEnet Module handle
cmdIOCTL command Id
prmsIOCTL parameters
Returns
Enet_ErrorCodes

◆ EnetRm_close()

void EnetRm_close ( EnetMod_Handle  hMod)

Close Enet RM module.

Parameters
hModEnet Module handle