[P4-dev] Match + Actions on a cloned packet
dhancock at cs.utah.edu
Wed Feb 3 11:33:23 EST 2016
Ramana, if you have reason to doubt the spec, why don't you write some
test code and try it out? Then, if the results are not what you
expected, tell us about the difference between what you expected and
what you observed. I have done this numerous times. In some cases, I
uncovered a bug in the behavioral model. In other cases, I learned that
a feature was not implemented in the behavioral model, or that it was
implemented a little bit differently than what the spec said. In yet
other cases, I learned that I did not understand the spec correctly. I
think you will best serve yourself and the entire P4 community by taking
That is my answer to your first question. I don't understand your
second question - what do you mean, exactly, by "inject the packet"?
Since this is under the topic of cloning packets, I assume you are
talking about cloning somehow. I will tell you now that you cannot do a
clone_*_pkt_to_ingress - it has not been implemented in bmv2, and per my
discussion with Antonin, it may never be and is likely to be removed
from the spec. If you are talking about a resubmit, no clone is
produced but the packet is sent back to the parser. If you are talking
about clone_*_pkt_to_egress, this sounds like your first question.
One additional hint - neither the cloning primitives nor the resubmit
primitive, nor the recirculate primitive take effect immediately - the
packet continues until the end of the appropriate pipeline, at which
point cloning / resubmission / recirculation happens. That fact caused
me a bit of confusion since I did not read the spec as carefully as I
should have when I started working with these primitives, so I hope this
helps you avoid the same confusion.
On 02/03/2016 06:22 AM, Ramana Reddy wrote:
> Hi All,
> I have few doubts on cloned packets:
> 1. When the packet is cloned using clone_ingress_to_egress primitive, //
> is the match+actions which are mentioned in ingress pipeline only
> applicable to original packet or to the cloned packet as well?
> In the diagram given in the spec (section 14.1.2), the cloned
> packet is directly going to the buffering mechanism.
> 2. When we inject the packet through the application which
> is listing an a particular port, what is the control flow of that
> packet. Is it go again ingress pipeline match+actions tables.
> Thanks & Regards,
> P4-dev mailing list
> P4-dev at lists.p4.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev