Closed dushyantarora13 closed 6 years ago
Have you try use simple_switch_CLI
or something else to add a mirroring port?
For example, you should using simple_switch_CLI
to run following command. And you will get the cloned packet on port 10.
mirroring_add 1024 10
Thanks for replying. I can only use P4Runtime commands to configure the switch (https://github.com/p4lang/PI/blob/master/proto/p4/p4runtime.proto). I don't see any message to add a mirroring port there. According to the declaration of clone in v1model.p4 the second argument is a session number: extern void clone(in CloneType type, in bit<32> session); I don't know what the expected value is for it.
@dushyantarora13 You are using the target independent way to configure switch.
But mirroring_add
is target dependent, that means mirroring_add
is only suitable for target simple_switch
(V1Switch).
So you can't find it in p4runtime.
@dushyantarora13 there are 2 things to take into account:
mirroring_mapping_add(1024, <your CPU port>)
.Edit: It seems that PSA will actually introduce sessions for configuring cloning, which means P4 Runtime should support this in the near future.
Thanks for the reply Antonin and qin-nz.
I wrote a simple clone.p4 file:
and a corresponding test in targets/simple_switch_grpc/tests/
I get a single packet in my output instead of 2. I used clone3 as well with the same result.