Question about mirror

If I want to set the mirror extern 's output port, what should I do? I know that $mirror.cfg is used to config the output port for mirror packet by bfrt’s file. However, If I want to set the $mirror.cfg table by p4runtime, does it can be achieved? I could not find the $mirror.cfg in any file exported by p4c.
Thanks a lot!


Are you using a Tofino switch?


Yes, I’ve participated in ICRP, some open source sdn controller use p4runtime to connect tofino by stratum, its functions are limited to flow tables and flow table enties, Is it possible to let mirror operation controllerd by controller with p4rumtime?

Hi @aoiland,

I have tried to find an answer to your question, but I am not completely sure about the reply.

I can see that the spec talks about cloning and mirroring (CloseSessionEntry): See this section in the P4Runtime specification. I do not know if this section is exactly related to your concern, but it seemed like.

I can also see that ONOS has some code that references CloseSessionEntry. Stratum has some references too.

I have not found any particular examples to help you, and confirm if it works and how it works.

When I used it, I opened a CLI (although this is for bmv2 Simple Switch) like this ONOS wiki page shows. But I think this worked via the old thrift interface. Not sure if this has been ported to P4Runtime and if so, not sure if there is full support in Stratum for the Tofino ASIC.


Best luck

Thanks for yourt reply here and on stratum’ github repo,
I noted that ONOS source code have replication definition ( in xx/pi dir), but not sure about if it will work for tofino. After trying other methods for replication in onos-stratum-tofino system other than using ONOS’s clone/repication, I think the possible solution is to determine whether the stratum can convert the PI entry defined by ONOS into the configuration of mirro.cfg. If not, ONOS may not control Tofino’s mirror operation at present(In my view, but it seems like)

Let’s wait if they reply in Stratum GitHub repository. It also seems like ONOS does not control it yet. But let’s wait.