Skip to content

Commit

Permalink
Multiport linux support
Browse files Browse the repository at this point in the history
- See doc/multiple_ports.rst for information on how to configure
  and run a mulitport configuration
- Verified on Raspberry Pi with additional USB ethernet interfaces
  • Loading branch information
olbjo committed Jan 26, 2021
1 parent 11f7141 commit f1e70e3
Show file tree
Hide file tree
Showing 26 changed files with 735 additions and 321 deletions.
39 changes: 34 additions & 5 deletions doc/multiple_ports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Multiple ports
==============
This section describes how to configure the p-net stack, sample application
and system for multiple network interfaces or ports.
So far, multiple port has only been tested using the linux port.


Terminology
Expand Down Expand Up @@ -92,12 +93,40 @@ Run ``ifconfig`` to check that the bridge is up and its network interfaces are a
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

Configuration of p-net stack and sample application (TBD)
Configuration of p-net stack and sample application
---------------------------------------------------------
To run p-net and the sample application with multiple ports a couple
of things need to be done:

* Reconfigure setting ``PNET_MAX_PORT`` to the actual number of physical ports available in the system.
For this example ``PNET_MAX_PORT`` shall be set to 2.

* TBD - update this document when multiport support is implemented
Reconfigure setting ``PNET_MAX_PORT`` to the actual number of physical ports available in the system.
For this example ``PNET_MAX_PORT`` shall be set to 2.

Example of initial log when starting the demo application with a multi port configuration::

pi@pndevice-pi:~/profinet/build $ sudo ./pn_dev -v
** Starting Profinet demo application **
Number of slots: 5 (incl slot for DAP module)
P-net log level: 0 (DEBUG=0, FATAL=4)
App verbosity level: 1
Nbr of ports: 2
Network interfaces: br0,eth0,eth1
Button1 file:
Button2 file:
Station name: rt-labs-dev
Management port: br0 C2:38:F3:A6:0A:66
Physical port [1]: eth0 B8:27:EB:67:14:8A
Physical port [2]: eth1 58:EF:68:B5:11:0F
Current hostname: pndevice-pi
Current IP address: 192.168.0.50
Current Netmask: 255.255.255.0
Current Gateway: 192.168.0.1
Storage directory: /home/pi/profinet/build

Update gsdml file
-----------------
The sample app gsdml file contains a commented out block that defines
a second physical port. In the sample application gsdml file, search for "IDS_P2"
and enable commented out lines as described in the gsdml file.

Note that you will have to the reload gsdml file in all tools you are using and
also the Automated RT tester any time the file is changed.
10 changes: 10 additions & 0 deletions sample_app/GSDML-V2.4-rtlabs-IODevice-20201211.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@
<MAUTypeItem Value="16"/>
</MAUTypeList>
</PortSubmoduleItem>
<!-- Enable to support additional port. (PNET_MAX_PORT == 2) -->
<!-- Add additional PortSubmoduleItems to support additional ports -->
<!--
<PortSubmoduleItem ID="IDS_P2" SubmoduleIdentNumber="0x00008002" SubslotNumber="32770" TextId="IDT_NAME_PS2" MaxPortRxDelay="350" MaxPortTxDelay="160">
<MAUTypeList>
<MAUTypeItem Value="16"/>
</MAUTypeList>
</PortSubmoduleItem>
-->
</SystemDefinedSubmoduleList>
</DeviceAccessPointItem>
</DeviceAccessPointList>
Expand Down Expand Up @@ -195,6 +204,7 @@
<Text TextId="IDT_CUSTOM_LOGBOOK_1" Value="Custom Logbook entry"/>
<Text TextId="IDT_NAME_IS" Value="I"/>
<Text TextId="IDT_NAME_PS1" Value="P1"/>
<Text TextId="IDT_NAME_PS2" Value="P2"/>
<!--module name-->
<Text TextId="TOK_TextId_Module_I8" Value="8 bits I"/>
<Text TextId="TOK_TextId_Module_O8" Value="8 bits O"/>
Expand Down
Loading

0 comments on commit f1e70e3

Please sign in to comment.