Packet Generation in P4/Sandbox C

302 views
Skip to first unread message

Sean Choi

unread,
Dec 21, 2018, 7:43:50 PM12/21/18
to open-nfp
Hello,

I am trying to create a packet generator that responds to a specific packet input via P4 and Sandbox C.
I am on the version 6.0.4 SDK, RTE and programmer studio.
I am following gen_pkt.c example that many of the threads have mentioned in this group.

My topology is as follows and I was hoping for the packet from Host 1 to trigger packet generation on Agilio NIC on host 2, without having to reach host 2.
Host1<--->NIC<--->Agilio CX 2x10Gb<-->Host2

So, in my P4 program, I am running the primitive function defined in the file.
I am sure that the function for pkt_nbi_send is being called, but I am not seeing any packets going out the wire.

What can be the culprit of this issue?
Do I have to change things for PORT_TO_TMQ function for Agilio CX?


Any help would be appreciated!

Thank you so much
backup.c

Andreas Kassler

unread,
Dec 22, 2018, 1:48:08 AM12/22/18
to open-nfp
Hello,
We are implementing a P4 code that should call a crypto extern for performing e.g. sha-1 hash operations on keys or encrypting payload with chacha. Any demo code would be really helpful.
Thanks!
Andreas Kassler

Sean Choi

unread,
Dec 24, 2018, 6:23:27 PM12/24/18
to open-nfp
Some additional question

For the nfp-4xxxc-B0 chip with the part number AMDA0096-0001,

Is the still the case that  TMQ_PER_PORT = 64 (MAC_CHAN_PER_PORT  * 8, where MAC_CHAN_PER_PORT = 8)
If not how can I check for the new value? I am trying to send it out to physical port 0.

Is it possible that if I have VFs configured, that the card requires some other value for out_port for pkt_nbi_send?

Also, according to li-2x10GE-prepend.json file, egress_cmd_prepend_mask* seems to be all 0x0.
So, does that mean MAC_PREPEND_BYTES is 0?

Besides these to values what are values should I look at?
I have exhausted my options and it seems like packets are still not generated.

Thank you so much.

David George

unread,
Jan 7, 2019, 4:45:42 AM1/7/19
to Sean Choi, open-nfp
Hi Sean


Some additional question

For the nfp-4xxxc-B0 chip with the part number AMDA0096-0001,

Is the still the case that  TMQ_PER_PORT = 64 (MAC_CHAN_PER_PORT  * 8, where MAC_CHAN_PER_PORT = 8)
If not how can I check for the new value? I am trying to send it out to physical port 0.

Are you using 6.0.x or 6.1.x?  For 6.1.x MAC_CHAN_PER_PORT is always 8 and for 6.0.x it is 4. Obviously for port 0 this will make no difference.
 
Is it possible that if I have VFs configured, that the card requires some other value for out_port for pkt_nbi_send?
No - this shouldn't be a factor. 

Also, according to li-2x10GE-prepend.json file, egress_cmd_prepend_mask* seems to be all 0x0.
So, does that mean MAC_PREPEND_BYTES is 0?

Yes, for the P4 application it is 0, you must also not call pkt_mac_egress_cmd_write.
 
Besides these to values what are values should I look at?
I have exhausted my options and it seems like packets are still not generated.

Hopefully you have a little more luck. If things are still not working I can point you to some counters which might give some indication where the problems are.

David

Zhuo Cheng

unread,
Mar 17, 2022, 10:21:10 PM3/17/22
to open-nfp
Hi,

I am wondering where I can find the 'gen_pkt.c' example. Or could you please share it with me? 

Thanks!
Reply all
Reply to author
Forward
0 new messages