Skip to Content.
Sympa Menu

rare-dev - Re: [rare-dev] RARE@400G

Subject: Rare project developers

List archive

Re: [rare-dev] RARE@400G


Chronological Thread 
  • From: Alexander Gall <>
  • To: <>
  • Cc: <>
  • Subject: Re: [rare-dev] RARE@400G
  • Date: Tue, 28 Jun 2022 14:31:51 +0200

Hi

On Tue, 28 Jun 2022 12:43:36 +0200, mc36 <> said:

> thanks for the work and the explanation... finally i managed to have a vm
> with the model at uses the external ports
> with the attached ports.json... the veth pair is created fine, and brought
> up, but, the physical ports are not...
> they stay down in linux after a reboot and never brought up...

That seems like an issue with the vm, though. As I said, my script
doesn't touch these ports at all.

> ifconfig up them is not enough, i have to reload
> process bfswd too....

That would suggests that the state of the ports is only checked when
the model is started and connects the Tofino ports to those interfaces
and later status changes have no effect (though Vladimir has explained
that the model does detect port changes for the purpose of generating
up/down events via the packet generator).

--
Alex

> br,
> cs



> On 6/28/22 10:45, Alexander Gall wrote:
>> On Wed, 8 Jun 2022 08:24:30 +0200, Alexander Gall <> said:
>>
>>> On Tue, 7 Jun 2022 11:49:53 +0200, mc36 <> said:
>>
>>>> another idea, you support now onie_machine=model in /etc/machine.conf
>>>> please consider splitting it to two... let's say model_veth where the
>>>> current
>>>> functionality would be exposed, and model_ext where you dont spin up the
>>>> veth
>>>> creation but start with an external port map exposing the vm physical
>>>> interfaces...
>>>> this way one could drop the image to gns3 and surround it with other
>>>> boxes...
>>>> this is how i start my dataplane vm:
>>>> https://github.com/rare-freertr/freeRtr/blob/master/misc/p4bf/r1.sh
>>>> https://github.com/rare-freertr/freeRtr/blob/master/misc/p4bf/r2.sh
>>>> https://github.com/rare-freertr/freeRtr/blob/master/misc/p4bf/ports.json
>>
>>> This is on my todo list. What I'm planning to do is to make the
>>> port-configuration JSON file (i.e. your ports.json) for the model
>>> configurable and have a wrapper that creates the veths specified in
>>> that file (if there are any).
>>
>> Added in
>> https://bitbucket.software.geant.org/projects/RARE/repos/rare-nix/commits/89aa6ee7b467bd76c174313b41bc082968ce6c5e
>>
>> With this, the freerouter systemd service is started with the
>> environment variable
>>
>> TOFINO_MODEL_PORTINFO=/etc/freertr/ports.json
>>
>> It only has an effect if RARE is running on the model pseudo-platform,
>> i.e. if /etc/machine.conf contains eiter onie_machine=model or
>> onie_machine=modelT2.
>>
>> By default /etc/freertr/ports.json does not exist. In that case, the
>> model binary is started without "-f" and thus uses the built-in
>> portinfo files with the mappings
>>
>> Tofino1:
>> port 0 -> veth0
>> port 1 -> veth2
>> ...
>> port 16 -> veth32
>> port 64 -> veth250 (CPU port)
>>
>> Tofino2:
>> port 8 -> veth0
>> port 9 -> veth2
>> ...
>> port 24 -> veth32
>> port 2 -> veth250 (CPU port)
>>
>> The wrapper script that starts the model and bf_switchd first creates
>> all of those veth pairs (and deletes them when the service is
>> stopped).
>>
>> /etc/freertr/rtr-hw.txt maps the cpuport process to veth251.
>>
>> If /etc/freertr/ports.json exists, it is passed to the model binary
>> with "-f /etc/freertr/ports.json". In addition, instead of creating
>> the default veth pairs, the wrapper for the model and bf_switchd also
>> parses the portinfo file and creates only those veth pairs specified
>> by the "PortToVeth" JSON objcets. For example
>>
>> {
>> "PortToVeth": [
>> {
>> "device_port": 8,
>> "veth1": 0,
>> "veth2": 1
>> },
>> {
>> "device_port": 2,
>> "veth1": 250,
>> "veth2": 251
>> }
>> ]
>> }
>>
>> will create the pairs veth0/veth1 and veth250/veth251. Interfaces
>> referred to by "PortToIf" objects must already exist or be created by
>> other means.
>>
>> The CPU port must always be mapped to the pair veth250/veth251 due to
>> the fixed setting in rtr-hw.txt. The RARE profiles are compiled with
>> the CPU port assigned to port 64 for Tofino and 2 for Tofino2 (it
>> could be arbitrary but this choice is compatible with the default
>> ports.json files built into the model binary). Hence, the file must
>> always include
>>
>> {
>> "device_port": 64,
>> "veth1": 250,
>> "veth2": 251
>> }
>>
>> for Tofino and
>>
>> {
>> "device_port": 2,
>> "veth1": 250,
>> "veth2": 251
>> }
>>
>> for Tofino2.
>>
>> --
>> Alex



Archive powered by MHonArc 2.6.19.

Top of Page