MCUXpresso SDK API Reference Manual  Rev 2.16.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Hardware Port

Overview

Group for PORT features API and data structure. data structures are prefixed with netc_port. APIs are prefixed with NETC_Port.

Modules

 Hardware Port Rx
 
 Hardware Port Tx
 

Data Structures

struct  netc_port_qos_mode_t
 Port Qos mode. More...
 
struct  netc_port_parser_config_t
 Port Parser config. More...
 
struct  netc_port_tg_config_t
 Port time gate config. More...
 
struct  netc_port_tc_cbs_config_t
 Configuration for the Credit Based Shaped for port TC. More...
 
struct  netc_port_tx_tc_config_t
 Configuration for the port Tx Traffic Class. More...
 
struct  netc_port_discard_statistic_t
 Switch or ENETC port Tx/Rx/Bridge discard statistic / reason. More...
 
struct  netc_port_vlan_classify_config_t
 Port accepted Vlan classification config. More...
 
struct  netc_port_qos_classify_config_t
 Port Qos Classification Config. More...
 
struct  netc_port_ipf_config_t
 Port Ingress Filter Config. More...
 
struct  netc_port_psfp_isi_config
 PSFP port config. More...
 
struct  netc_port_common_t
 Port common configuration. More...
 

Enumerations

enum  netc_port_tgsl_status_t {
  kNETC_OperListActive = 0x1U,
  kNETC_AdminListPending
}
 Port time gate scheduling gate list status. More...
 
enum  netc_port_discard_tpye_t {
  kNETC_RxDiscard = 0U,
  kNETC_TxDiscard,
  kNETC_BridgeDiscard
}
 Port Tx/Rx discard counter in the datapath processing pipeline or bridge forwarding processing function. More...
 
enum  netc_port_tpidlist_t {
  kNETC_OuterStanCvlan = 0x1U,
  kNETC_OuterStanSvlan = 0x2U,
  kNETC_OuterCustomVlan1 = 0x4U,
  kNETC_OuterCustomVlan2 = 0x8U,
  kNETC_InnerStanCvlan = 0x1U,
  kNETC_InnerStanSvlan = 0x2U,
  kNETC_InnerCustomVlan1 = 0x4U,
  kNETC_InnerCustomVlan2 = 0x8U
}
 Defines Port TPID acceptance. More...
 
enum  netc_port_ts_select_t {
  kNETC_SyncTime = 0U,
  kNETC_FreeRunningTime
}
 Defines port timestamp selection. More...
 
enum  netc_hw_preemption_mode_t {
  kNETC_PreemptDisable = 0U,
  kNETC_PreemptOn64B,
  kNETC_PreemptOn4B
}
 Port MAC preemption mode. More...
 
enum  netc_tc_sdu_type_t {
  kNETC_PDU = 0U,
  kNETC_MPDU,
  kNETC_MSDU
}
 Type of PDU/SDU (Protocol/Service Data Unit). More...
 
enum  netc_port_sg_ogc_mode_t {
  kNETC_SGCheckSFD = 0U,
  kNETC_SGCheckEntire
}
 Defines the Port's Stream Gate Open Gate Check mode. More...
 

Data Structure Documentation

struct netc_port_qos_mode_t

Data Fields

uint8_t qosVlanMap: 4
 Transmit QoS to VLAN PCP Mapping Profile index, only active on switch port.
 
uint8_t vlanQosMap: 4
 Receive VLAN PCP/DE to QoS Mapping Profile index, only active on switch port.
 
uint8_t defaultIpv: 3
 Port default IPV.
 
uint8_t defaultDr: 2
 Port default DR.
 
bool enVlanInfo: 1
 Enable use VLAN info to determine IPV and DR (base on VLANIPVMPaR0/1 and VLANDRMPaR)
 
bool vlanTagSelect: 1
 True: Outer VLAN, False: Innner VLAN. More...
 

Field Documentation

bool netc_port_qos_mode_t::vlanTagSelect

Active when enVlanInfo is true

struct netc_port_parser_config_t

Data Fields

uint8_t l2PloadCount: 5
 L2 payload fields size in bytes.
 
bool enableL3Parser: 1
 Enable/Disable parser for L3.
 
uint8_t l3PayloadCount: 5
 L3 payload fields size in bytes.
 
bool enableL4Parser: 1
 Enable/Disable parser for L4.
 
uint8_t l4PayloadCount: 5
 L4 payload fields size in bytes.
 
struct netc_port_tg_config_t

Data Fields

uint16_t advOffset
 Advance time offset in ns. More...
 
uint32_t holdSkew
 Hold-Skew in ns, not effective on ports connected to a pseudo-MAC.
 

Field Documentation

uint16_t netc_port_tg_config_t::advOffset
struct netc_port_tc_cbs_config_t
Note
The 802.1Qav bandwidth availability parameters is is calculated as follows:
  • idleSlope (bits) = portTxRate * bwWeight / 100
  • sendSlope (bits) = portTxRate * (100 - bwWeight) / 100
  • lowCredit (bits) = tcMaxFrameSize * (100 - bwWeight) / 100
  • hiCredit (bits) calculation formula depends on the traffic class, Please refer to the Reference manual.
  • hiCredit (credits) = (enetClockFrequency / portTxRate) * 100 * hiCredit (bits)

Data Fields

uint8_t bwWeight
 Percentage units of the port transmit rate and the credit-based shaper (range from 0 ~ 100), the sum of all traffic class credit-based shaper's bandwidth cannot exceed 100.
 
uint32_t hiCredit
 The maximum allowed accumulation of credits when conflicting transfers occur, in credit units ((enetClockFrequency / portTxRate) * 100)
 
struct netc_port_tx_tc_config_t

Data Fields

bool enPreemption: 1
 Frames from traffic class are transmitted on the preemptable MAC, not supported on internal port (ENETC 1 port and Switch port 4)
 
bool enTcGate: 1
 Enable the traffic class gate when no gate control list is operational, or when time gate scheduling is disabled. More...
 
bool enableTsd: 1
 Enable Time Specific Departure traffic class, only applicable to ENETC.
 
bool enableCbs: 1
 Enable Credit based shaper for traffic class.
 
netc_port_tc_cbs_config_t cbsCfg
 
     Configure transmit traffic class credit based shaper (PTC0CBSR0/PTC0CBSR1) if

enableCbs set to ture

 

Field Documentation

bool netc_port_tx_tc_config_t::enTcGate
struct netc_port_discard_statistic_t

Data Fields

uint32_t count
 Count of discarded frames. More...
 
uint32_t reason0
 Discard Reason. More...
 
uint32_t reason1
 Discard Reason. More...
 

Field Documentation

uint32_t netc_port_discard_statistic_t::count

PRXDCR, PTXDCR or BPDCR.

uint32_t netc_port_discard_statistic_t::reason0

Find bit detail from PT/RXDCRR0 or BPDCRR0.

uint32_t netc_port_discard_statistic_t::reason1

Find bit detail from PT/RXDCRR1 or BPDCRR1.

struct netc_port_vlan_classify_config_t

Data Fields

uint8_t innerMask: 4
 Bitmap identifying which TPIDs are acceptable as Inner VLAN tag. More...
 
uint8_t outerMask: 4
 Bitmap identifying which TPIDs are acceptable as Outter VLAN tag. More...
 

Field Documentation

uint8_t netc_port_vlan_classify_config_t::innerMask

See PTAR

uint8_t netc_port_vlan_classify_config_t::outerMask

See PTAR

struct netc_port_qos_classify_config_t

Data Fields

uint8_t vlanQosMap: 4
 Receive VLAN PCP/DE to QoS Mapping Profile index.
 
uint8_t defaultIpv: 3
 Port default IPV.
 
uint8_t defaultDr: 2
 Port default DR.
 
bool enVlanInfo: 1
 Enable use VLAN info to determine IPV and DR ,base on VLAN to IPV map (VLANIPVMPaR0/1) and VLAN to DR map (VLANDRMPaR)
 
bool vlanTagSelect: 1
 True: Use received Outer VLAN, False: Use received Innner VLAN. More...
 

Field Documentation

bool netc_port_qos_classify_config_t::vlanTagSelect

Active when enVlanInfo is true

struct netc_port_ipf_config_t

Data Fields

bool enL2Dos: 1
 Enable port L2 Ethernet DoS Protection.
 
bool enL3Dos: 1
 Enable port L3 IP DoS Protection.
 
bool enIPFTable: 1
 Enable port IPF lookup.
 
struct netc_port_psfp_isi_config

Port ingress stream identification config

Note
The first stream identification find IS_EID has higher precedence value than the second, and the priority of the IS_EID found by the IPF is specified by the IPF entry RRR bit. The possible orderings are as follows
  • RRR = 00b : IPF > enKC0 > enKC1 > defaultISEID
  • RRR = 01b : enKC0 > IPF > enKC1 > defaultISEID
  • RRR = 10b : enKC0 > enKC1 > IPF > defaultISEID

Data Fields

uint16_t defaultISEID
 Default Ingress Stream Entry ID, has lower precedence value than ISI entry and IPF entry defined IS_EID. More...
 
bool enKC1: 1
 Enable do the second stream identification with key construction rule 1 or rule 3.
 
bool enKC0: 1
 Enable do the first stream identification with key construction rule 0 or rule 2.
 
bool kcPair: 1
 Indicates which Key Construction pair to use for this port, false - user pair0. More...
 

Field Documentation

uint16_t netc_port_psfp_isi_config::defaultISEID

0xFFFF means NULL

bool netc_port_psfp_isi_config::kcPair

true - use pair1 only applicable for Switch

struct netc_port_common_t

Data Fields

netc_port_vlan_classify_config_t acceptTpid
 Port acceptable VLAN tpid configure. More...
 
netc_port_ts_select_t rxTsSelect
 Eth MAC Rx or pseudo MAC Tx timestamp clock source.
 
uint16_t pSpeed
 Transmit Port Speed = 10Mbps * (pSpeed+1), Used by ETS, Qbu and to determine if cut-through is permissable.
 
uint8_t rxMacsecBco
 Port receive MACSec byte count overhead which due to MACSec encapsulation.
 
uint8_t rxPpduBco
 Port receive PPDU Byte count overhead which includes IPG, SFD and Preamble.
 
uint8_t txMacsecBco
 Port transmit MACSec byte count overhead which due to MACSec encapsulation.
 
uint8_t txPpduBco
 Port transmit PPDU Byte count overhead which includes IPG, SFD and Preamble.
 
netc_port_sg_ogc_mode_t ogcMode: 1
 
              Stream Gate Open Gate Check mode, 0b is check whether SFD is within the

open gate interval, 1b is check whether the entire frame is within the open gate interval

 
uint32_t pDelay: 24
 Link propagation delay in ns.
 
uint8_t macAddr [6]
 Port MAC address, used for Switch egress frame modification action or ENETC SI0 primary MAC address.
 
netc_port_qos_classify_config_t qosMode
 Port Rx Qos Classification config.
 
netc_port_ipf_config_t ipfCfg
 Port ingress port filter configuration.
 
netc_port_tg_config_t timeGate
 Port Tx time gate config.
 
netc_port_parser_config_t parser
 Port Rx Parser config.
 

Field Documentation

netc_port_vlan_classify_config_t netc_port_common_t::acceptTpid

Enumeration Type Documentation

Enumerator
kNETC_OperListActive 

Port operational gate control list is active.

kNETC_AdminListPending 

Administrative gate control list is pending (configured but not installed yet).

Enumerator
kNETC_RxDiscard 

Discarded frames in the receive port datapath processing pipeline.

kNETC_TxDiscard 

Discarded frames in the egress datapath processing pipeline, only for switch.

kNETC_BridgeDiscard 

Discarded frames in the bridge forwarding processing function, only for switch.

Enumerator
kNETC_OuterStanCvlan 

Accept outer Standard C-VLAN 0x8100.

kNETC_OuterStanSvlan 

Accept outer Standard S-VLAN 0x88A8.

kNETC_OuterCustomVlan1 

Accept outer Custom VLAN as defined by CVLANR1[ETYPE].

kNETC_OuterCustomVlan2 

Accept outer Custom VLAN as defined by CVLANR2[ETYPE].

kNETC_InnerStanCvlan 

Accept inner Standard C-VLAN 0x8100.

kNETC_InnerStanSvlan 

Accept inner Standard S-VLAN 0x88A8.

kNETC_InnerCustomVlan1 

Accept inner Custom VLAN as defined by CVLANR1[ETYPE].

kNETC_InnerCustomVlan2 

Accept inner Custom VLAN as defined by CVLANR2[ETYPE].

Enumerator
kNETC_SyncTime 

Synchronized time.

kNETC_FreeRunningTime 

Free running time.

Enumerator
kNETC_PreemptDisable 

Frame preemption is not enabled.

kNETC_PreemptOn64B 

Frame preemption is enabled, but transmit only preempts frames on 64B boundaries.

kNETC_PreemptOn4B 

Frame preemption is enabled, but transmit only preempts frames on 4B boundaries.

Note
Overhead values which adding to the transmitted frame of Length are specified by Port SDU config as follows:
  • PPDU = add rxPpduBco/txPpduBco + rxMacsecBco/txMacsecBco bytes
  • MPDU = add rxMacsecBco/txMacsecBco bytes
  • MSDU = minus 16B (12B MAC Header + 4B FCS)
Enumerator
kNETC_PDU 

Physical Layer PDU, Preamble, IFG, SFD along with MPDU.

Not supported if cut-through frames are expected

kNETC_MPDU 

MAC PDU, MAC Header, MSDU and FCS.

kNETC_MSDU 

MAC SDU, MPDU minus 12B MAC Header and 4B FCS.

Not supported if cut-through frames are expected

Enumerator
kNETC_SGCheckSFD 

Check whether frame SFD is within the open gate interval.

kNETC_SGCheckEntire 

Check whether the entire frame is within the open gate interval.