jafingerhut / p4-guide

Guide to p4lang repositories and some other public info about P4
534 stars 156 forks source link

[Question]A question about lpm #56

Closed XX001104 closed 3 months ago

XX001104 commented 1 year ago

I want to use lpm to match the flow table, my address is set to ipv4 address, but I found out that the bits of lpm can only be 32 bits, otherwise it reports unknown error. I modify the stream table for s1 in the basic exercise in exercise and it reports an error. What should I do if I want to use other bits like 16 bits to match?

ederollora commented 1 year ago

I want to use lpm to match the flow table, my address is set to ipv4 address, but I found out that the bits of lpm can only be 32 bits, otherwise it reports unknown error. I modify the stream table for s1 in the basic exercise in exercise and it reports an error. What should I do if I want to use other bits like 16 bits to match?

This is probably not completely related but when you say that it can only be 32 bits, are you also modifying the rules that you insert?

Because if you try to insert a 32 bit value (IP Address) into a 16 or 128 bit field (a port or an ipv6 address) then it will fail.

These files are sX-runtime.json files.

Cheers

jafingerhut commented 3 months ago

No follow-up questions for quite some time, so closing this issue. Feel free to open another, or ask on https://p4lang.zulipchat.com, if you have other questions.