Pause packet transmission on P4

I want to implement a credit-based packet scheduling on P4. The switch needs to block the transmission of frames when all credits have been consumed. I find in this post that bmv2 does not support this feature yet. I would like to know if these features are available on the real P4 switch.

The answer is: maybe, it depends upon exactly what you need, and which real P4 switch you are targeting.

If you want to know the answer for an Intel Tofino switch ASIC, then there are non-public forums on which to ask, which you can get access to either by working for a company that buys these devices, or being affiliated with a university that has access to these forums. I do not know which applies in your situation, but if you are part of a university that has access, you may be able to sign in here: Advance Networking in the Intel® Connectivity Research Program

Does it mean that mechanism like PFC may not be able to implement on P4?

There is nothing in the P4 language spec mentioning the PFC feature, but it also nearly does not mention any networking features at all in the language spec. Whether a particular P4-programmable device implements PFC, and whether it supports modifying how PFC behaves by code in your P4 program, depends upon the exact facilities that the device’s P4 compiler provides to you. So again, the answer is unfortunately “it depends upon exactly what you need, and which P4 switch you are targeting”.

I am not trying to be cryptic, but the commercial reality today is that the cheapest-per-Tbps switch and NIC devices often have their documentation available only under NDA (Non-disclosure Agreement). The features you are asking about are, so far at least, rarely documented in public documentation about such products.