Managing Network Interfaces
You can add, delete, set properties for, and associate filters with eRTOS network interfaces using the RtConfig.rtreg configuration file accessible from <InstallDrive>\MaxRT\eRTOS\
.
Topics:
- Adding, Modifying, and Deleting Interfaces
- Network Link Layer (NL2) Interface Properties
- TCP/IP Stack Properties
Adding, Modifying, and Deleting Interfaces
Before you can manage interfaces, you must first add the eRTOS network interface to the RtConfig.rtreg configuration file. See Configuring eRTOS Components for RtConfig.rtreg syntax. eRTOS SDK also includes templates for different divers to configure NICs.
To add an interface:
- Open the RtConfig.rtreg configuration file and add the unique SectionPath surrounded by brackets [].
For example:
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX]
where XXX is the name you want to give to this network interface. The name cannot exceed 64 characters and cannot include spaces.
Note: The NL2 starts the network interfaces in the order they appear in the RtConfig.rtreg file.
-
Create the structure that will host all the NIC properties. Under the newly created section, add the following sub-sections:
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\RxQueues\0]
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\RxQueues\1]
…
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\RxQueues\NB_RX_QUEUES-1]
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\TxQueues\0]
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\TxQueues\1]
…
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces \XXX\TxQueues\NB_RX_QUEUES-1]
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces \XXX\MsixMessages\0]
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces \XXX\MsixMessages\1]
…
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces \XXX\MsixMessages\NB_MSIX_MESSAGES-1]
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces \XXX\Protocols\TCPIP]
Note:
- If you are unsure how many Receive Queues your NIC supports, or if you want to use one Receive Queue only, create the “RxQueues\0” sub-section (do as if NB_RX_QUEUES=1)
- If you are unsure how many Transmit Queues your NIC supports, or if you want to use one Transmit Queue only, create the “TxQueues\0” sub-section (do as if NB_TX_QUEUES=1).
- If you are unsure how many MSI-X Messages your NIC supports, or if you don’t want to use MSI-X Multi vector interrupt mode, create the “MsixMessages\0” sub-section (do as if NB_MSIX_MESSAGES=1). -
Create the required data items for this NIC.
-
Add a PciLocation String item under the NIC’s root section to specify the PCI bus Location of the NIC in the form of three semicolon-separated integers.
For example:
"PciLocation"="2;0;0"
You can run the PciScanBus.ertos sample binary to get location information. See the eRTOS SDK Help for information on this sample.
-
Add a DriverPathname String item under the NIC’s root section to specify the eRTOS Driver to use for this NIC.
For example:
"DriverPathname"="RtndIpch.edll"
See eRTOS Supported NICs for a list of NIC drivers which are available out of the box.
-
- Create the optional data items for this NIC. See Network Link Layer (NL2) Properties and TCP/IP Stack Properties below for the exhaustive list of required and optional data items.
To change interface properties:
To change an interface property, follow the steps below.
- Open the RtConfig.rtreg configuration file and find the interface whose properties you want to view or edit under [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX] section.
- Edit the properties you want to change. See Network Link Layer (NL2) Properties and TCP/IP Stack Properties below.
- You must restart the machine running eRTOS.
To delete an interface:
- Open the RtConfig.rtreg configuration file and find the interface you want to delete under [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX] section.
- Delete the section and all its sub-sections.
Network Link Layer (NL2) Interface Properties
To change NL2-specific interface properties for a specific interface, select the interface you want to edit from the RtConfig.rtreg configuration file. You can find these settings under the [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX] section.
eRTOS SDK contains the following NIC-specific configuration templates. You can use these templates as a starting point when configuring interface properties.
- RtConfigi210.rtreg
- RtConfigi219.rtreg
- RtConfigi225.rtreg
- RtConfigi350.rtreg
- RtConfigRealtek.rtreg
- RtConfigx550.rtreg
NL2 interface-level properties
These are the NL2 properties that apply to the whole network interface. They are all represented by data items under the [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX] section.
Setting | Type | Recommended value | Description |
---|---|---|---|
Enable |
DWORD |
1 |
Enable/disable the interface. |
PciLocation | String | - |
The PCI bus location of the network interface card for the interface in the form of three semicolon-separated integers. Note: You can run the PciScanBus.ertos sample binary to get location information. |
DriverPathname | String | - | The eRTOS driver for the NIC. |
JumboEnabled | DWORD | 0 |
Enables Jumbo frames.
|
JumboMaxPacketSize | DWORD |
1514 |
The maximum packet size allowed by the interface, excluding the FCS, in bytes. Note: This property is ignored if JumboEnabled=0. |
AutoNegotiationDisabled | DWORD | 0 |
Disables Auto-negotiation.
|
ForcedFullDuplex | DWORD | - |
Forced duplex mode, in case AutoNegotiationDisabled=1.
|
ForcedSpeedMbps | DWORD | - | Forced speed, in Mbps, in case AutoNegotiationDisabled=1. |
RestrictAdvertisedDuplex | DWORD | 0 |
Advertise a subset of the supported duplex modes.
|
AdvertisedDuplexMode | DWORD | - |
The single duplex mode to advertise in case RestrictAdvertisedDuplex=1.
|
RestrictAdvertisedSpeed | DWORD | 0 |
Advertise a subset of the supported speeds.
|
AdvertisedSpeedMbps | DWORD | - | The single speed to advertise in case RestrictAdvertisedSpeed=1. |
FlowControlSetup | DWORD | 0 |
Use non-hardware-default settings for hardware flow control.
|
FlowControlFrameTransmissionDisabled | DWORD | - |
Disable the transmission of Flow Control frames.
|
FlowControlFrameReceptionDisabled | DWORD | - |
Disable the processing of received Flow Control frames.
|
FlowControlDownshiftEnabled | DWORD |
- |
Allow the driver to downshift the above FlowControlFrameTransmissionDisabled and FlowControlFrameReceptionDisabled settings depending on the results of auto-negotiation.
|
HardwareTimestampingEnabled | DWORD | - |
Globally enable the hardware timestamping logic in the NIC.
Note: Hardware timestamping is not supported by all NICs. |
IngressTimestampingRule | DWORD | - |
Determines the type of incoming packets to timestamp, in case HardwareTimestampingEnabled=1.
Note: Not all options are supported by all NICs. |
IngressTimestampingUdpPort | DWORD | 319 |
The UDP port used to recognize UDP event frames. |
IngressTimestampingEtherType | DWORD | 35063 (0x88F7) |
The EtherType used to recognize ETH event frames. |
InterruptType | DWORD | 2 |
The type of interrupt that will be used:
Note: For improved performance, we recommend you use MSI-X when possible. |
NonMsixIstIdealProcessor |
DWORD |
0 |
The ideal processor for the thread servicing the interface interrupts, in case InterruptType is not equal to 2 (MSI-X). This value must be a valid eRTOS processor. |
NonMsixPriority |
DWORD |
64 |
The interface's interrupt priority, in case InterruptType is not equal to 2 (MSI-X). This value must be a valid eRTOS priority within the range 1-127. |
MsixNonQueueMessageId |
DWORD |
- |
The Message ID to use for non-queue interrupts, in case InterruptType is equal to 2(MSI-X). |
NL2 Receive Queue-level properties
These are the NL2 properties that apply to a specific Receive Queue of the network interface. They are all represented by data items under the [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\RxQueues\N] section, where N is the index of the Receive Queue to configure.
Setting | Type | Recommended value | Description |
---|---|---|---|
Enable |
DWORD |
1 |
Enable/disable the Receive Queue. |
NbBuffers | DWORD | 256 |
The number of NL2 Buffers that the driver must allocate for this Receive Queue at startup. |
TimestampingEnabled | DWORD | - |
Allows NL2 applications to request timestamping of incoming frames on this Receive Queue.
|
ManagementThreadIdealProcessor | DWORD | 0 |
The processor number on which this Receive Queue’s Management thread will run. Note: Processor numbers are zero based. Processor 0 is the first processor. |
ManagementThreadPriority | DWORD |
62 |
The priority of this Receive Queue’s Management thread. This value must be within the range 0 to 127. |
MsixQueueMessageId |
DWORD |
- |
The Message ID to use for interrupts associated with this Receive Queue, in case InterruptType is equal to 2(MSI-X). |
NL2 Transmit Queue-level properties
These are the NL2 properties that apply to a specific Transmit Queue of the network interface. They are all represented by data items under the [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\TxQueues\N section, where N is the index of the Transmit Queue to configure.
Setting | Type | Recommended value | Description |
---|---|---|---|
Enable |
DWORD |
1 |
Enable/disable the Transmit Queue. |
NbBuffers | DWORD | 256 |
The number of NL2 Buffers the driver must allocate for this Transmit Queue at startup. |
TimestampingEnabled | DWORD | - |
Allows NL2 applications to request timestamping of outgoing frames on this Transmit Queue.
Note: Most drivers don’t allow egress timestamping on multiple Transmit Queues at the same time. |
ManagementThreadIdealProcessor | DWORD | 0 |
The processor number on which this Transmit Queue’s Management thread will run. Note: Processor numbers are zero based. Processor 0 is the first processor. |
ManagementThreadPriority | DWORD |
62 |
The priority of this Transmit Queue’s Management thread. This value must be within the range 0 to 127. |
MsixQueueMessageId |
DWORD |
- |
The Message ID to use for interrupts associated with this Transmit Queue, in case InterruptType is equal to 2(MSI-X). |
NL2 MSI-X Message-level properties
These are the NL2 properties that apply to a specific MSI-X Message of the network interface. They are all represented by data items under the [HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\XXX\MsixMessages\N section, where N is the index of the MSI-X Message to configure.
Note: These properties apply only if InterruptType is set to 2(MSI-X).
Setting | Type | Recommended value | Description |
---|---|---|---|
Enabled |
DWORD |
1 |
Enable/disable the MSI-X Message. |
IstIdealProcessor |
DWORD | 0 |
The ideal processor for the thread servicing this MSI-X interrupt. This value must be a valid eRTOS processor. Note: Processor numbers are zero based. Processor 0 is the first processor. |
IstPriority |
DWORD | 64 |
The interrupt priority for this MSI-X Message. This value must be a valid eRTOS priority within the range 1-127. |
TCP/IP Stack Properties
Note: eRTOS does not validate or prevent the configuration of multiple enabled interfaces with the same IP address.
Setting | Type | Recommended value | Description |
---|---|---|---|
Enabled |
DWORD |
1 |
Enable/disable TCP/IP support for this NIC. |
IPAddr | String |
192.168.100.50 |
The IPv4 address of the interface in dotted-quad notation. |
Netmask | String | 255.255.255.0 |
The IPv4 subnet mask of the interface in dotted-quad notation. |
Gateway | String | 0.0.0.0 | The gateway for this interface in dotted-quad notation. Value 0.0.0.0 means No Gateway. |
IPv6Addr | String | Auto | The IPv6 address. If “Auto”, the interface uses the Link-Local IPv6 address only. |
IPv6Prefix | DWORD | 64 | The IPv6 network prefix for IPv6Addr. |
LinkStatus |
DWORD |
1 |
Enable/disable Link Status monitoring.
|
LinkStatusIdealProcessor | DWORD |
0 |
The ideal processor for the Link Status thread. This value must be a valid eRTOS processor. Note: Processor numbers are zero based. Processor 0 is the first processor. |
LinkStatusPriority | DWORD | 0 |
The Link status thread priority. This value must be a valid eRTOS priority within the range 0-127 |
ReceiveIdealProcessor | DWORD | 0 |
The ideal processor for the Receive thread. This value must be a valid eRTOS processor. Note: Processor numbers are zero based. Processor 0 is the first processor. |
ReceivePriority | DWORD | 0 | The Receive thread priority. This value must be a valid eRTOS priority within the range 0-127. |
RxQueueIndex | DWORD | 0 | Index of the Receive Queue that the TCP/IP Stack receives frames from. |
RxBufferCount |
DWORD |
512 |
Maximum number of inflight Ethernet frames from the NIC to the TCP/IP Stack. Note: This is the value of the BufferCount parameter passed by the Stack to the Rtnl2CreateLogicalRxQueue() function when it creates the Logical Rx Queue for this NIC at startup. |
TxQueueIndex |
DWORD |
0 |
Index of the Transmit Queue that the TCP/IP Stack transmits frames to. |
TxBufferCount |
DWORD |
512 |
Maximum number of inflight Ethernet frames from the TCP/IP Stack to the NIC. Note: this is the value of the BufferCount parameter passed by the Stack to the Rtnl2CreateLogicalTxQueue() function when it creates the Logical Tx Queue for this NIC at startup. |
FilterState |
DWORD |
0 |
Enable/disable an Ethernet Filter driver on this NIC.
|
Filter |
String |
- |
Pahtname of the filter driver to use, if FilterState=1. |
RtConfig.rtreg Example
In this example configuration, the NL2 and TCP/IP Stack support one network interface card which uses the RtndIpch driver:
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\I219]
"Enabled"=dword:1
"PciLocation"="0;31;6"
"DriverPathname"="RtndIpch.edll"
"InterruptType"=dword:1
"JumboEnabled"=dword:0
"JumboMaxPacketSize"=dword:0
"AutoNegotiationDisabled"=dword:0
"ForcedFullDuplex"=dword:0
"ForcedSpeedMbps"=dword:0
"RestrictAdvertisedDuplex"=dword:0
"AdvertisedFullDuplex"=dword:0
"RestrictAdvertisedSpeed"=dword:0
"AdvertisedSpeedMbps"=dword:0
"FlowControlSetup"=dword:0
"FlowControlFrameTransmissionDisabled"=dword:0
"FlowControlFrameReceptionDisabled"=dword:0
"FlowControlDownshiftEnabled"=dword:0
"HardwareTimestampingEnanled"=dword:0
"IngressTimestampingRule"=dword:0
"IngressTimestampingUdpPort"=dword:0
"IngressTimestampingEtherType"=dword:0
"NonMsixIstIdealProcessor"=dword:0
"NonMsixIstPriority"=dword:0
"MsixNonQueueMessageId"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\I219\RxQueues\0]
"Enabled"=dword:1
"NbBuffers"=dword:256
"TimestampingEnabled"=dword:0
"ManagementThreadIdealProcessor"=dword:0
"ManagementThreadPriority"=dword:62
"MsixQueueMessageId"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\I219\TxQueues\0]
"Enabled"=dword:1
"NbBuffers"=dword:256
"TimestampingEnabled"=dword:0
"ManagementThreadIdealProcessor"=dword:0
"ManagementThreadPriority"=dword:62
"MsixQueueMessageId"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\I219\MsixMessages\0]
"Enabled"=dword:0
"IstIdealProcessor"=dword:0
"IstPriority"=dword:0
[HKEY_LOCAL_MACHINE\SOFTWARE\INTERVALZERO\eRTOS\NL2Interfaces\I219\Protocols\TCPIP
"Enabled"=dword:1
"IPAddr"="192.168.100.50"
"Netmask"="255.255.255.0"
"IPv6Addr"="Auto"
"IPv6Prefix"=dword:64
"LinkStatus"=dword:1
"LinkStatusIdealProcessor"=dword:0
"LinkStatusPriority"=dword:0
"ReceiveIdealProcessor"=dword:0
"ReceivePriority"=dword:63
"RxQueueIndex"=dword:0
"RxBufferCount"=dword:512
"TxQueueIndex"=dword:0
"TxBufferCOunt"=dword:0
"FilterState"=dword:0
"Filter"=""