cisco-open / go-p4 Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
hi @rnhaddad ,
Need your suggestion on how we can achieve PacketOut from the p4rt client at a particular rate? For example GDP at 324pps.
Hi,
After increasing the packet qSize (issue was reported in #5), the Rx packets reported is still less than the expected number of the packets.
Here is the code snippet to set the qSize:
client0Stream0 := leader.StreamChannelGet(&streamName)
if client0Stream0 == nil {
t.Logf("'%s' nil stream", streamName)
}
arbCntrs := client0Stream0.GetArbCounters()
t.Logf("stream '%s' Arbitration Counters RxArbCntr(%d) RxArbCntrDrop(%d) RxArbCntrQueued(%d)",
streamName, arbCntrs.RxArbCntr, arbCntrs.RxArbCntrDrop, arbCntrs.RxArbCntrQueued)
qSize := 5000
client0Stream0.SetArbQSize(qSize)
qSizeRead := client0Stream0.GetArbQSize()
if qSize != qSizeRead {
t.Logf("Stream '%s' expecting Arbitration qSize(%d) Got (%d)",
streamName, qSize, qSizeRead)
}
pktCntrs := client0Stream0.GetPacketCounters()
t.Logf("stream '%s' Packet Counters RxPktCntr(%d) RxPktCntrDrop(%d) RxPktCntrQueued(%d)",
streamName, pktCntrs.RxPktCntr, pktCntrs.RxPktCntrDrop, pktCntrs.RxPktCntrQueued)
client0Stream0.SetPacketQSize(qSize)
qSizeRead = client0Stream0.GetPacketQSize()
t.Logf(" qSizeRead is %d", qSizeRead)
if qSize != qSizeRead {
t.Logf("Stream '%s' expecting Packet qSize(%d) Got (%d)",
streamName, qSize, qSizeRead)
}
After the ATE sent more than 1496 packets (GDP and LLDP packets), the packet received reported from the controller is around 331, and no drop packets reported.
This is the snippet of the code to get the RxPktCtr .
// get the packet counters
client0Stream0 := client.StreamChannelGet(&streamName)
pktCntrs := client0Stream0.GetPacketCounters()
t.Logf("stream '%s' Packet Counters RxPktCntr(%d) RxPktCntrDrop(%d) RxPktCntrQueued(%d)",
streamName, pktCntrs.RxPktCntr, pktCntrs.RxPktCntrDrop, pktCntrs.RxPktCntrQueued)
Script run output is shown as below:
// get the packet counters
client0Stream0 := client.StreamChannelGet(&streamName)
pktCntrs := client0Stream0.GetPacketCounters()
t.Logf("stream '%s' Packet Counters RxPktCntr(%d) RxPktCntrDrop(%d) RxPktCntrQueued(%d)",
streamName, pktCntrs.RxPktCntr, pktCntrs.RxPktCntrDrop, pktCntrs.RxPktCntrQueued)
=== RUN TestPacketIn/PacketIn_to_Primary_Controller
p4rt_61_test.go:317: packets len is 0
p4rt_61_test.go:317: stream 'p4rt' Packet Counters RxPktCntr(329) RxPktCntrDrop(0) RxPktCntrQueued(329)
p4rt_61_test.go:318: packets len is 331. <<<<<<<<<<<<<<<<
p4rt_61_test.go:327: Start to decode packet and compare with expected packets.
=== CONT TestPacketIn
p4rt_61_test.go:390: gdpPacketNo is '221'. <<<<<<<<<<<<<<
p4rt_61_test.go:391: lldpPacketNo is '110'. <<<<<<<<<<<<<<<
--- PASS: TestPacketIn (426.50s)
--- PASS: TestPacketIn/PacketIn_to_Primary_Controller (0.01s)
PASS
*** Releasing the testbed...
*** PROPERTY: time.end -> 1671229848
*** PROPERTY: time.begin -> 1671229391
Thanks,
Sharon
When I use the below function to get the packets received from the Cisco controller for PacketIn packets, the returned value is less than expected.
The total number sent from ATE is 3000 packets. but the received from the function is 100
client.StreamChannelGetPacket(&streamName, 0)
Can this function add the loss packets?
thanks,
Sharon
This issue was automatically created by Allstar.
Security Policy Violation
No protection found for branch main
This issue will auto resolve when the policy is in compliance.
Issue created by Allstar. See https://github.com/ossf/allstar/ for more information. For questions specific to the repository, please contact the owner or maintainer.
The P4InfoLoad
function returns a P4Info
struct by value instead of by pointer:
Line 28 in caa766b
The style guide says protocol buffer messages should be passed by pointer:
https://google.github.io/styleguide/go/decisions.html#pass-values
One problem is that it causes the mutex in the struct to be copied, which is forbidden:
https://google.github.io/styleguide/go/decisions.html#copying
Another problem is that the returned value does not satisfy the proto.Message
interface.
It should return the type *p4_v1_config.P4Info
It returns the type p4_v1_config.P4Info
v0.1.0
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.