Skip to Content.
Sympa Menu

rare-users - RE: [RARE-users] RARE CPE code compilation on Tofino

Subject: RARE user and assistance email list

List archive

RE: [RARE-users] RARE CPE code compilation on Tofino


Chronological Thread 
  • From: Mingyuan Zang <>
  • To: Alexander Gall <>, "" <>
  • Cc: Henrik Wessing <>, "David Franco" <>
  • Subject: RE: [RARE-users] RARE CPE code compilation on Tofino
  • Date: Thu, 16 Feb 2023 09:10:59 +0000
  • Accept-language: en-US, da-DK
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 192.38.82.197) smtp.rcpttodomain=switch.ch smtp.mailfrom=dtu.dk; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=dtu.dk; dkim=none (message not signed); arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7OXGgHMAYAb2wMMopQU4HAXee2r239Wvpgzo6Aq2ZjY=; b=edQA5ZyFEWzZHfbMk2OW4CF19c+hAVW/8Nbh+pB2/uhOh1wZXYBZR6BfzLvnHbXQKICS05iavyHe9DUoxJ+diTd3l+adz0c8ccsm5SdmRQHu3KG6SbPY6OOInG4hxzRksKTEJipsn0ac6R+GuGsnDzrkktuCBX8rq5N3wbGdd28aHZQBnpzBpZS8uXz3muWX8zEZ2XbYGScQXv5HTuxkQWIaRsPKkKwD5EkYsJS0/3TRmpR2z//0eNX3WYbdEqndt61qopwCuf3wRbJLnQ4awzt1hAMTF2IZfVxRghrzqiJkggpWlH/w0dllc1nJaCTVZtuqrXZWL41KGlkvTxyCoA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YJlynBLozt+VIASDk8TLpCC6YBP9BT/NcaZM0UaxYpnbQ57Ml7q0NixwfwPPxEy0meCpchJDa7S7DKMC4zPCZtv8V2Odo0PFU9B0WipM2abfFyOEBQiLGDsOX8oyiuk6K1BfUyj0Jym/0yw8uylhmyRmCv2+H2gUZBQVbKcz7P2MoI9d36Q1Hj6pQzthcyXsIcn72Glt1tDe9M0xq040Eu5OvY63KhRpU5zrZfWZoF8+8CEr7e3GuPy8fB5LNn7LJyJHocr4r+GobdaocIRnjXQz1TNjhwvAN5nw+0T4SZI/CE+NgA4B/T3IaeNy91qXvq2uqclzEGpdpd0vZFs9dg==

Hi Alex,

Many thanks for your detailed suggestions! Cool we'll try to tweak the table
sizes first to see if we can squeeze it into SDE 9.2.0, if not, we'll upgrade
our SDE to 9.7.2 and try again.


Best Regards,
Ming


-----Original Message-----
From: Alexander Gall <>
Sent: 16. februar 2023 08:41
To:
Cc: Mingyuan Zang <>; Henrik Wessing <>; David
Franco <>
Subject: Re: [RARE-users] RARE CPE code compilation on Tofino

On Wed, 15 Feb 2023 16:29:37 +0100, Frédéric LOUI <>
said:


> Now coming back to your original question:
>> When we try to go through RARE’s data plane functions on Tofino 1 in
>> WEDGE100BF32X (with SDE 9.2.0), we got a compilation error with CPE
>> function enabled saying that the code consumed 13 stages as screenshot
>> below. (We enable the function by defining the CPE profile in bf_router.p4
>> as:https://bitbucket.software.geant.org/projects/RARE/repos/rare/browse/profiles/profile-cpe.p4)
>> Other functions like GGSN also shows the similar warning. We were
>> wondering whether it exceeds the capability of Tofino 1? Do we need to try
>> it on Tofino 2? We found that it would cost 12 stages when other functions
>> like ToR enabled?


> IIRC, I remember that this problem disappeared when you use more recent SDE
> than SDE 9.2.0. INTEL would recommend in any case when you report this type
> of issue to upgrade to latest INTEL SDE.

To expand on this a bit. We're trying to maximize the tables in each profile.
How much resources are actually used on the ASIC depends heavily on the
version of the P4 compiler (newer versions tend to be better at that, i.e.
allowing larger tables for the same P4 program).

There are verion-specific table sizes in the profiles/<SDE-version>/tofino
(and profiles/<SDE-version>/tofino2 for
Tofino2) directories. So if you use one of those versions, simply add that
directory to the compiler include path with "-I".

The profile-*.p4 files in the top-level profiles directory tend to be those
optimized for the newest SDE by csaba but the RARE Nix-based packaging is
currently fixed at SDE 9.7.2 and hence uses profiles/9.7.2.

If you use a version for which there are no optimized tables, you can simply
play with the values in the relevant file, i.e. for the CPE profile

$ grep TABLE_SIZE profiles/profile-cpe.p4
#define PORT_TABLE_SIZE 512
#define BUNDLE_TABLE_SIZE 128
#define VLAN_TABLE_SIZE 512
#define IPV4_LPM_TABLE_SIZE 217088
#define IPV6_LPM_TABLE_SIZE 54272
#define IPV4_HOST_TABLE_SIZE 256
#define IPV6_HOST_TABLE_SIZE 256
#define NEXTHOP_TABLE_SIZE 512
#define _TABLE_SIZE_P4_

In this case you'd want to lower the values of IPV{4,6}_LPM_TABLE_SIZE until
the compiler can fit the tables into the available stages.

--
Alex



Archive powered by MHonArc 2.6.19.

Top of Page