-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p4c-dpdk back end does not support 128-bit arithmetic #4174
Comments
PR for supporting 128 bitwise operations on dpdk compiler backend. #4952 |
Looks like 4952 in p4lang/p4c is Merged. Can this one be updated? |
The failures are not completely resolved yet and the program is still marked XFail: #4952 (comment) describes the remaining work to do. |
For anyone looking for the gory details, basically the PR #4952 did add a lot of support for 128-bit operations in p4lang/p4c DPDK back end. However, even with that PR it still does not support 128-bit constant values in the P4 source program, which the DASH program does use some of. The bad news is that there are still 2 error messages (shown below) with a 2024-Oct-31 version of p4c source code. The good news is that the number of error messages is down from something-over-20 down to 2 with the changes in PR #4952
|
Nice work!!! (error message decrease) 😊
From: Andy Fingerhut ***@***.***>
Sent: Tuesday, November 5, 2024 4:11 PM
To: p4lang/p4c ***@***.***>
Cc: Kristina Moore ***@***.***>; Comment ***@***.***>
Subject: Re: [p4lang/p4c] p4c-dpdk back end does not support 128-bit arithmetic (Issue #4174)
For anyone looking for the gory details, basically the PR #4952<#4952> did add a lot of support for 128-bit operations in p4lang/p4c DPDK back end. However, even with that PR it still does not support 128-bit constant values in the P4 source program, which the DASH program does use some of. The bad news is the 2 error messages shown below with a 2024-Oct-31 version of p4c source code. The good news is that the number of error messages is down from something-over-20 down to 2 with the changes in PR #4952<#4952>
$ git clone https://github.com/sonic-net/DASH
$ cd DASH
$ git log -n 1 | head -n 3
commit ee1fa2350a444409e20ad825b13fafdf67010e41
Author: Shaofeng Wu ***@***.******@***.***>>
Date: Tue Nov 5 17:24:32 2024 +0800
$ cd dash-pipeline/bmv2
$ mkdir -p output
$ $HOME/forks/p4c/build/p4c-dpdk \
-DTARGET_DPDK_PNA -DPNA_CONNTRACK \
…--arch pna \
--p4runtime-files output/dash_pipeline.p4info.txtpb \
--bf-rt-schema output/dash_pipeline.bfrt.json \
-o output/dash_pipeline.spec \
--pp output/dash_pipeline.pp.p4 \
dash_pipeline.p4
[ ... many warning messages omitted ... ]
[--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit
[--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit
stages/../dash_routing_types.p4(173): [--Werror=overlimit] error: DPDK target supports up-to 64-bit immediate values, 128w0xffffffffffffffffffffffff exceeds the limit
inout metadata_t meta,
^^^^
—
Reply to this email directly, view it on GitHub<#4174 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AFJSI6DZABYRFYTATTVCTJTZ7FGBVAVCNFSM6AAAAABPTYEHQCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJYGM4DGNJVGM>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
With commit #4952, p4c-dpdk supports many operations on 128-bit values.
The one known remaining omission is that it does not support 128-bit constant literal values, which are used by the current DASH program, and seem likely to be desirable to use in many P4 programs that manipulate 128-bit values.
The text of the original issue from 2023-Sep-23 is given below, for historical reference:
With this p4c commit #4171 the p4c-dpdk back end at least usually correctly reports when it does not support a P4 program that uses arithmetic operations on operands larger than 64 bits in size.
This issue is meant to track one possible enhancement that would enable a larger class of useful P4 programs to compile and run on P4-DPDK, which is: implement arithmetic on operands up to 128 bits in size in the P4-DPDK software switch, and then modify the p4c-dpdk back end compiler to take advantage of these operations.
Motivation: IPv6 addresses are commonly manipulated data values in P4 programs, and often arithmetic operations are performed on these values, especially these operations:
(my_ipv6_addr == some_128_bit_constant)
my_ipv6_addr[31:0] = some_bit_32_expression
I believe that implementing at least the operations above would enable the DASH P4 code to compile without changes. For example, see the commands in issue #4156
I have attempted to modify the P4 code mentioned there to work with the current p4c-dpdk back end and P4-DPDK software switch as of 2023-Sep-23, but I do not think this is feasible. It is necessary to at least be able to do an
lpm
match kind in a table key on a full 128-bit IPv6 address, and also to compare a 128-bit value to 0, and to do bit-wise AND, OR, and XOR. There is no practical way in P4 to do anlpm
match on two 64-bit fields that works the same way as a 128-bitlpm
match.I would recommend that the P4-DPDK back end be enhanced to support all of the following operations, too, on any values up to 128 bits wide:
!=
,<
,<=
,>
,>=
at least on unsigned bit strings, but ideally also for signed bit strings.The text was updated successfully, but these errors were encountered: