NetFPGA / P4-NetFPGA-public

P4-NetFPGA wiki
103 stars 31 forks source link

Warning: Table TopPipe.forward key pre-padded with 8 bits #57

Open happyPisces opened 4 years ago

happyPisces commented 4 years ago

hello everyone, I want to use P4 to implement a simple grouping function: hash the packet's 5-tuple and modulo 2 to the hash result. If the final result equals 0, we send it to the corresponding port; if the final result equals 1, we send the eth-address of the packet to cpu.

this is my lines in the table(in command.txt): image

this is my hash function and the length of hash_result is 4 bits: image

I use the hash_result%2 as the value of user_metadata.my_hash_result and transmitted to the control pipe: image image

I use the user_metadata.my_hash_result as the key of forward table: image

however, when I make the P4 program in the director P4_PROJECT_DIR, I meet the problem: image

I had set the length of key in the command.txt with 4 bits and the length of hash_result is also 4 bits, but Why the Table TopPipe.forward key pre-padded with 8 bits? Please help me, thanks!

salvatorg commented 4 years ago

What about the hash_lrc() method?